From 1c484b486bb03c9f34a9f6054d766542b5d52f86 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 6 May 2013 23:00:24 -0400 Subject: [PATCH 1/2] display tags on detail page --- MediaBrowser.Controller/Dto/DtoBuilder.cs | 5 ++++ .../Providers/Movies/MovieDbProvider.cs | 27 ++++++++++++------- MediaBrowser.Model/DTO/BaseItemDto.cs | 6 +++++ MediaBrowser.Model/Querying/ItemFields.cs | 5 ++++ 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs index 3a2412aebf..e9c472e429 100644 --- a/MediaBrowser.Controller/Dto/DtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs @@ -279,6 +279,11 @@ namespace MediaBrowser.Controller.Dto dto.HomePageUrl = item.HomePageUrl; } + if (fields.Contains(ItemFields.Tags)) + { + dto.Tags = item.Tags; + } + if (fields.Contains(ItemFields.ProductionLocations)) { dto.ProductionLocations = item.ProductionLocations; diff --git a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs index dbeba42d92..c5bd0b03b4 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs @@ -933,20 +933,29 @@ namespace MediaBrowser.Controller.Providers.Movies if (ourRelease.release_date > new DateTime(1900, 1, 1)) { - movie.PremiereDate = ourRelease.release_date.ToUniversalTime(); - movie.ProductionYear = ourRelease.release_date.Year; + if (ourRelease.release_date.Year != 1) + { + movie.PremiereDate = ourRelease.release_date.ToUniversalTime(); + movie.ProductionYear = ourRelease.release_date.Year; + } } else { - movie.PremiereDate = usRelease.release_date.ToUniversalTime(); - movie.ProductionYear = usRelease.release_date.Year; + if (usRelease.release_date.Year != 1) + { + movie.PremiereDate = usRelease.release_date.ToUniversalTime(); + movie.ProductionYear = usRelease.release_date.Year; + } } } else { - //no specific country release info at all - movie.PremiereDate = movieData.release_date.ToUniversalTime(); - movie.ProductionYear = movieData.release_date.Year; + if (movieData.release_date.Year != 1) + { + //no specific country release info at all + movie.PremiereDate = movieData.release_date.ToUniversalTime(); + movie.ProductionYear = movieData.release_date.Year; + } } //if that didn't find a rating and we are a boxset, use the one from our first child @@ -960,8 +969,8 @@ namespace MediaBrowser.Controller.Providers.Movies boxset.OfficialRating = firstChild != null ? firstChild.OfficialRating : null; } - //if (movie.RunTimeTicks == null && movieData.runtime > 0) - // movie.RunTimeTicks = TimeSpan.FromMinutes(movieData.runtime).Ticks; + if (movie.RunTimeTicks == null && movieData.runtime > 0) + movie.RunTimeTicks = TimeSpan.FromMinutes(movieData.runtime).Ticks; //studios if (movieData.production_companies != null) diff --git a/MediaBrowser.Model/DTO/BaseItemDto.cs b/MediaBrowser.Model/DTO/BaseItemDto.cs index e8f389940d..076fa7bfcc 100644 --- a/MediaBrowser.Model/DTO/BaseItemDto.cs +++ b/MediaBrowser.Model/DTO/BaseItemDto.cs @@ -276,6 +276,12 @@ namespace MediaBrowser.Model.Dto /// The index options. public string[] IndexOptions { get; set; } + /// + /// Gets or sets the tags. + /// + /// The tags. + public List Tags { get; set; } + /// /// Gets or sets the primary image aspect ratio. /// diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 2e6e6b7dcb..875329c70f 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -131,6 +131,11 @@ namespace MediaBrowser.Model.Querying /// Taglines, + /// + /// The tags + /// + Tags, + /// /// The trailer url of the item /// From bee343c7b3e942b320a72615bbe55609f920e58d Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Mon, 6 May 2013 23:20:51 -0400 Subject: [PATCH 2/2] Add collection id --- MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs | 6 ++++++ MediaBrowser.Model/Entities/MetadataProviders.cs | 6 +++++- MediaBrowser.sln | 3 --- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs index dbeba42d92..b2a556e3d2 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieDbProvider.cs @@ -916,6 +916,12 @@ namespace MediaBrowser.Controller.Providers.Movies } movie.SetProviderId(MetadataProviders.Imdb, movieData.imdb_id); + + if (movieData.belongs_to_collection != null) + { + movie.SetProviderId(MetadataProviders.TmdbCollection, movieData.belongs_to_collection.id.ToString(CultureInfo.InvariantCulture)); + } + float rating; string voteAvg = movieData.vote_average.ToString(CultureInfo.InvariantCulture); //tmdb appears to have unified their numbers to always report "7.3" regardless of country diff --git a/MediaBrowser.Model/Entities/MetadataProviders.cs b/MediaBrowser.Model/Entities/MetadataProviders.cs index 15648604fd..3c7b2ff019 100644 --- a/MediaBrowser.Model/Entities/MetadataProviders.cs +++ b/MediaBrowser.Model/Entities/MetadataProviders.cs @@ -29,6 +29,10 @@ namespace MediaBrowser.Model.Entities /// /// The rotten tomatoes /// - RottenTomatoes + RottenTomatoes, + /// + /// Tmdb Collection Id + /// + TmdbCollection } } diff --git a/MediaBrowser.sln b/MediaBrowser.sln index eb3251f741..f9f5e94365 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -173,7 +173,4 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection EndGlobal