diff --git a/Shoko.Server/API/v3/Models/TMDB/Movie.cs b/Shoko.Server/API/v3/Models/TMDB/Movie.cs index c2820beb1..5116b9f57 100644 --- a/Shoko.Server/API/v3/Models/TMDB/Movie.cs +++ b/Shoko.Server/API/v3/Models/TMDB/Movie.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json.Converters; using Shoko.Models.Enums; using Shoko.Plugin.Abstractions.DataModels; +using Shoko.Plugin.Abstractions.Extensions; using Shoko.Server.API.v3.Helpers; using Shoko.Server.API.v3.Models.Common; using Shoko.Server.API.v3.Models.Shoko; @@ -59,8 +60,7 @@ public class Movie /// /// Original language the movie was shot in. /// - [JsonConverter(typeof(StringEnumConverter))] - public TitleLanguage OriginalLanguage { get; init; } + public string OriginalLanguage { get; init; } /// /// Indicates the movie is restricted to an age group above the legal age, @@ -176,7 +176,7 @@ public Movie(TMDB_Movie movie, IncludeDetails? includeDetails = null, IReadOnlyS if (include.HasFlag(IncludeDetails.Overviews)) Overviews = movie.GetAllOverviews() .ToDto(movie.EnglishOverview, preferredOverview, language); - OriginalLanguage = movie.OriginalLanguage; + OriginalLanguage = movie.OriginalLanguageCode; IsRestricted = movie.IsRestricted; IsVideo = movie.IsVideo; UserRating = new() diff --git a/Shoko.Server/API/v3/Models/TMDB/Search.cs b/Shoko.Server/API/v3/Models/TMDB/Search.cs index b7033dd65..52c47dfc6 100644 --- a/Shoko.Server/API/v3/Models/TMDB/Search.cs +++ b/Shoko.Server/API/v3/Models/TMDB/Search.cs @@ -113,8 +113,7 @@ public class RemoteSearchMovie /// /// Original language the movie was shot in. /// - [JsonConverter(typeof(StringEnumConverter))] - public TitleLanguage OriginalLanguage { get; init; } + public string OriginalLanguage { get; init; } /// /// Preferred overview based upon description preference. @@ -175,7 +174,7 @@ public RemoteSearchMovie(TMDB_Movie movie) ID = movie.Id; Title = movie.EnglishTitle; OriginalTitle = movie.OriginalTitle; - OriginalLanguage = movie.OriginalLanguage; + OriginalLanguage = movie.OriginalLanguageCode; Overview = movie.EnglishOverview ?? string.Empty; IsRestricted = movie.IsRestricted; IsVideo = movie.IsVideo; @@ -202,7 +201,7 @@ public RemoteSearchMovie(RemoteMovie movie) ID = movie.Id; Title = movie.Title; OriginalTitle = movie.OriginalTitle; - OriginalLanguage = movie.OriginalLanguage.GetTitleLanguage(); + OriginalLanguage = movie.OriginalLanguage; Overview = movie.Overview ?? string.Empty; IsRestricted = movie.Adult; IsVideo = movie.Video; @@ -229,7 +228,7 @@ public RemoteSearchMovie(SearchMovie movie) ID = movie.Id; Title = movie.Title; OriginalTitle = movie.OriginalTitle; - OriginalLanguage = movie.OriginalLanguage.GetTitleLanguage(); + OriginalLanguage = movie.OriginalLanguage; Overview = movie.Overview ?? string.Empty; IsRestricted = movie.Adult; IsVideo = movie.Video; @@ -275,8 +274,7 @@ public class RemoteSearchShow /// /// Original language the show was shot in. /// - [JsonConverter(typeof(StringEnumConverter))] - public TitleLanguage OriginalLanguage { get; init; } + public string OriginalLanguage { get; init; } /// /// Preferred overview based upon description preference. @@ -313,7 +311,7 @@ public RemoteSearchShow(TMDB_Show show) ID = show.Id; Title = show.EnglishTitle; OriginalTitle = show.OriginalTitle; - OriginalLanguage = show.OriginalLanguage; + OriginalLanguage = show.OriginalLanguageCode; Overview = show.EnglishOverview ?? string.Empty; FirstAiredAt = show.FirstAiredAt; Poster = !string.IsNullOrEmpty(show.PosterPath) && !string.IsNullOrEmpty(TmdbMetadataService.ImageServerUrl) @@ -338,7 +336,7 @@ public RemoteSearchShow(RemoteShow show) ID = show.Id; Title = show.Name; OriginalTitle = show.OriginalName; - OriginalLanguage = show.OriginalLanguage.GetTitleLanguage(); + OriginalLanguage = show.OriginalLanguage; Overview = show.Overview ?? string.Empty; FirstAiredAt = show.FirstAirDate.HasValue ? DateOnly.FromDateTime(show.FirstAirDate.Value) : null; Poster = !string.IsNullOrEmpty(show.PosterPath) && !string.IsNullOrEmpty(TmdbMetadataService.ImageServerUrl) @@ -363,7 +361,7 @@ public RemoteSearchShow(SearchTv show) ID = show.Id; Title = show.Name; OriginalTitle = show.OriginalName; - OriginalLanguage = show.OriginalLanguage.GetTitleLanguage(); + OriginalLanguage = show.OriginalLanguage; Overview = show.Overview ?? string.Empty; FirstAiredAt = show.FirstAirDate.HasValue ? DateOnly.FromDateTime(show.FirstAirDate.Value) : null; Poster = !string.IsNullOrEmpty(show.PosterPath) && !string.IsNullOrEmpty(TmdbMetadataService.ImageServerUrl) diff --git a/Shoko.Server/API/v3/Models/TMDB/Show.cs b/Shoko.Server/API/v3/Models/TMDB/Show.cs index 4666409c5..7ee649e38 100644 --- a/Shoko.Server/API/v3/Models/TMDB/Show.cs +++ b/Shoko.Server/API/v3/Models/TMDB/Show.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json.Converters; using Shoko.Models.Enums; using Shoko.Plugin.Abstractions.DataModels; +using Shoko.Plugin.Abstractions.Extensions; using Shoko.Server.API.v3.Helpers; using Shoko.Server.API.v3.Models.Common; using Shoko.Server.Models.CrossReference; @@ -54,8 +55,7 @@ public class Show /// /// Original language the show was shot in. /// - [JsonConverter(typeof(StringEnumConverter))] - public TitleLanguage OriginalLanguage { get; init; } + public string OriginalLanguage { get; init; } /// /// Indicates the show is restricted to an age group above the legal age, @@ -178,7 +178,7 @@ public Show(TMDB_Show show, TMDB_AlternateOrdering? alternateOrdering, IncludeDe if (include.HasFlag(IncludeDetails.Overviews)) Overviews = show.GetAllOverviews() .ToDto(show.EnglishTitle, preferredOverview, language); - OriginalLanguage = show.OriginalLanguage; + OriginalLanguage = show.OriginalLanguageCode; IsRestricted = show.IsRestricted; UserRating = new() {