From 8d5c0cbe0420efabdfccef5e1d98972ab085a1bf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 25 Aug 2013 13:18:56 -0400 Subject: [PATCH] fixes around saving music brainz id's to xml --- MediaBrowser.Api/ItemUpdateService.cs | 7 ------- MediaBrowser.Controller/Dto/DtoBuilder.cs | 10 +++++----- .../Entities/Audio/MusicAlbum.cs | 6 ------ MediaBrowser.Controller/Entities/BaseItem.cs | 18 ++++++++++++++++- MediaBrowser.Controller/Entities/Folder.cs | 15 -------------- MediaBrowser.Controller/IO/FileData.cs | 6 +++++- .../Providers/BaseItemXmlParser.cs | 20 ++++++++++++++----- .../Entities/MetadataProviders.cs | 3 ++- .../Music/FanArtAlbumProvider.cs | 15 ++++++++------ .../Savers/XmlSaverHelpers.cs | 11 +++++++++- 10 files changed, 63 insertions(+), 48 deletions(-) diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 54b2c0ea7..09e175e30 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -273,13 +273,6 @@ namespace MediaBrowser.Api song.Artist = request.Artists[0]; } - var musicAlbum = item as MusicAlbum; - - if (musicAlbum != null) - { - musicAlbum.MusicBrainzReleaseGroupId = request.GetProviderId("MusicBrainzReleaseGroupId"); - } - var musicVideo = item as MusicVideo; if (musicVideo != null) diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs index 85d2a2003..b2b858b6d 100644 --- a/MediaBrowser.Controller/Dto/DtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs @@ -90,6 +90,11 @@ namespace MediaBrowser.Controller.Dto } } + if (fields.Contains(ItemFields.DisplayPreferencesId)) + { + dto.DisplayPreferencesId = item.DisplayPreferencesId.ToString("N"); + } + if (user != null) { AttachUserSpecificInfo(dto, item, user, fields); @@ -272,11 +277,6 @@ namespace MediaBrowser.Controller.Dto /// The fields. private void AttachUserSpecificInfo(BaseItemDto dto, BaseItem item, User user, List fields) { - if (item.IsFolder && fields.Contains(ItemFields.DisplayPreferencesId)) - { - dto.DisplayPreferencesId = ((Folder) item).DisplayPreferencesId.ToString("N"); - } - if (item.IsFolder) { var hasItemCounts = fields.Contains(ItemFields.ItemCounts); diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index 1526cf46a..1668b91d4 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -91,11 +91,5 @@ namespace MediaBrowser.Controller.Entities.Audio { return RecursiveChildren.OfType