diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-16 15:16:29 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-16 15:16:29 -0400 |
| commit | 26aa47eefddf89a00ad64ab19af31b511142040d (patch) | |
| tree | 39c4d65ba0bec28dbedaf79a0884f8a5010d9fab /MediaBrowser.Controller | |
| parent | 20bcc40e2305f2a2623007701cf3da9fea72b20e (diff) | |
move people page into main editor
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/AdultVideo.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Movies/Movie.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/MusicVideo.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Trailer.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/BaseItemXmlParser.cs | 73 |
5 files changed, 61 insertions, 32 deletions
diff --git a/MediaBrowser.Controller/Entities/AdultVideo.cs b/MediaBrowser.Controller/Entities/AdultVideo.cs index 9791f7cf79..00270accf1 100644 --- a/MediaBrowser.Controller/Entities/AdultVideo.cs +++ b/MediaBrowser.Controller/Entities/AdultVideo.cs @@ -3,7 +3,7 @@ using MediaBrowser.Controller.Providers; namespace MediaBrowser.Controller.Entities { - public class AdultVideo : Video, IHasPreferredMetadataLanguage, IHasTaglines + public class AdultVideo : Video, IHasProductionLocations, IHasPreferredMetadataLanguage, IHasTaglines { /// <summary> /// Gets or sets the preferred metadata language. @@ -16,12 +16,14 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The preferred metadata country code.</value> public string PreferredMetadataCountryCode { get; set; } + public List<string> ProductionLocations { get; set; } public List<string> Taglines { get; set; } public AdultVideo() { Taglines = new List<string>(); + ProductionLocations = new List<string>(); } public override bool BeforeMetadataRefresh() diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index f53b676105..5510c795a0 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities.Movies /// <summary> /// Class Movie /// </summary> - public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasPreferredMetadataLanguage, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping + public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasPreferredMetadataLanguage, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping { public List<Guid> SpecialFeatureIds { get; set; } @@ -22,6 +22,7 @@ namespace MediaBrowser.Controller.Entities.Movies public List<Guid> ThemeSongIds { get; set; } public List<Guid> ThemeVideoIds { get; set; } + public List<string> ProductionLocations { get; set; } /// <summary> /// This is just a cache to enable quick access by Id @@ -48,6 +49,7 @@ namespace MediaBrowser.Controller.Entities.Movies BoxSetIdList = new List<Guid>(); Taglines = new List<string>(); Keywords = new List<string>(); + ProductionLocations = new List<string>(); } public string AwardSummary { get; set; } diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 554914ec6b..bbb2bc8755 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -9,7 +9,7 @@ using System.Runtime.Serialization; namespace MediaBrowser.Controller.Entities { - public class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasBudget, IHasLookupInfo<MusicVideoInfo> + public class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasProductionLocations, IHasBudget, IHasLookupInfo<MusicVideoInfo> { /// <summary> /// Gets or sets the artist. @@ -34,6 +34,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The revenue.</value> public double? Revenue { get; set; } + public List<string> ProductionLocations { get; set; } + + public MusicVideo() + { + ProductionLocations = new List<string>(); + } [IgnoreDataMember] public List<string> AllArtists diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 53ec030a78..569334ec3f 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -12,11 +12,12 @@ namespace MediaBrowser.Controller.Entities /// <summary> /// Class Trailer /// </summary> - public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasPreferredMetadataLanguage, IHasMetascore, IHasLookupInfo<TrailerInfo> + public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasPreferredMetadataLanguage, IHasMetascore, IHasLookupInfo<TrailerInfo> { public List<Guid> SoundtrackIds { get; set; } public string PreferredMetadataLanguage { get; set; } + public List<string> ProductionLocations { get; set; } /// <summary> /// Gets or sets the preferred metadata country code. @@ -31,6 +32,7 @@ namespace MediaBrowser.Controller.Entities SoundtrackIds = new List<Guid>(); LocalTrailerIds = new List<Guid>(); Keywords = new List<string>(); + ProductionLocations = new List<string>(); } public float? Metascore { get; set; } diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index a6714f6561..41f994303b 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -62,34 +62,6 @@ namespace MediaBrowser.Controller.Providers ValidationType = ValidationType.None }; - var hasTaglines = item as IHasTaglines; - if (hasTaglines != null) - { - hasTaglines.Taglines.Clear(); - } - - item.Studios.Clear(); - item.Genres.Clear(); - item.People.Clear(); - - var hasTags = item as IHasTags; - if (hasTags != null) - { - hasTags.Tags.Clear(); - } - - var hasKeywords = item as IHasKeywords; - if (hasKeywords != null) - { - hasKeywords.Keywords.Clear(); - } - - var hasTrailers = item as IHasTrailers; - if (hasTrailers != null) - { - hasTrailers.RemoteTrailers.Clear(); - } - //Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken); Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken); } @@ -373,6 +345,15 @@ namespace MediaBrowser.Controller.Providers break; } + case "Countries": + { + using (var subtree = reader.ReadSubtree()) + { + FetchFromCountriesNode(subtree, item); + } + break; + } + case "ContentRating": case "MPAARating": { @@ -857,6 +838,42 @@ namespace MediaBrowser.Controller.Providers } } + private void FetchFromCountriesNode(XmlReader reader, T item) + { + reader.MoveToContent(); + + while (reader.Read()) + { + if (reader.NodeType == XmlNodeType.Element) + { + switch (reader.Name) + { + case "Country": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + var hasProductionLocations = item as IHasProductionLocations; + if (hasProductionLocations != null) + { + if (!string.IsNullOrWhiteSpace(val)) + { + hasProductionLocations.AddProductionLocation(val); + } + } + } + break; + } + + default: + reader.Skip(); + break; + } + } + } + } + /// <summary> /// Fetches from taglines node. /// </summary> |
