From d828e07be0418ba166e170e385c17caf72b0ad3b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 24 Jun 2013 10:12:56 -0400 Subject: [PATCH] save music brainz id in xml --- MediaBrowser.Controller/Entities/Folder.cs | 17 ++++++++--------- .../Providers/BaseItemXmlParser.cs | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index e7c4a293b..4689a4358 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -864,14 +864,7 @@ namespace MediaBrowser.Controller.Entities /// IEnumerable{BaseItem}. protected IEnumerable GetCachedChildren() { - var items = ItemRepository.GetChildren(Id).Select(RetrieveChild).Where(i => i != null).ToList(); - - foreach (var item in items) - { - item.Parent = this; - } - - return items; + return ItemRepository.GetChildren(Id).Select(RetrieveChild).Where(i => i != null); } /// @@ -893,7 +886,13 @@ namespace MediaBrowser.Controller.Entities var item = LibraryManager.RetrieveItem(child.ItemId, itemType); - return item is IByReferenceItem ? LibraryManager.GetOrAddByReferenceItem(item) : item; + if (item is IByReferenceItem) + { + return LibraryManager.GetOrAddByReferenceItem(item); + } + + item.Parent = this; + return item; } /// diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index c9efd2737..29cf43f28 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -417,6 +417,22 @@ namespace MediaBrowser.Controller.Providers break; } + case "MusicbrainzId": + var mbz = reader.ReadElementContentAsString(); + if (!string.IsNullOrWhiteSpace(mbz)) + { + item.SetProviderId(MetadataProviders.Musicbrainz, mbz); + } + break; + + case "RottenTomatoesId": + var rtId = reader.ReadElementContentAsString(); + if (!string.IsNullOrWhiteSpace(rtId)) + { + item.SetProviderId(MetadataProviders.RottenTomatoes, rtId); + } + break; + case "TMDbId": var tmdb = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdb)) @@ -424,7 +440,7 @@ namespace MediaBrowser.Controller.Providers item.SetProviderId(MetadataProviders.Tmdb, tmdb); } break; - + case "CollectionNumber": var tmdbCollection = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdbCollection))