aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/LibraryService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-13 14:45:20 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-13 14:45:20 -0500
commite1fb68b70c6e8ab9602dfc8bdbdf8be2811286d3 (patch)
tree2c1a8e33a5951222198e17f2e7a5838ab4d2f7ec /MediaBrowser.Api/LibraryService.cs
parent9bb1bf69a5fb1722d69503d8ed2dc263c959aaac (diff)
make sure theme song owner id is correct
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
-rw-r--r--MediaBrowser.Api/LibraryService.cs24
1 files changed, 18 insertions, 6 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs
index 2e9ea6ceb..582eb6f49 100644
--- a/MediaBrowser.Api/LibraryService.cs
+++ b/MediaBrowser.Api/LibraryService.cs
@@ -615,9 +615,15 @@ namespace MediaBrowser.Api
if (album != null)
{
- themeSongIds = album.SoundtrackIds
- .SelectMany(i => _libraryManager.GetItemById(i).ThemeSongIds)
- .ToList();
+ var linkedItemWithThemes = album.SoundtrackIds
+ .Select(i => _libraryManager.GetItemById(i))
+ .FirstOrDefault(i => i.ThemeSongIds.Count > 0);
+
+ if (linkedItemWithThemes != null)
+ {
+ themeSongIds = linkedItemWithThemes.ThemeSongIds;
+ item = linkedItemWithThemes;
+ }
}
}
@@ -677,9 +683,15 @@ namespace MediaBrowser.Api
if (album != null)
{
- themeVideoIds = album.SoundtrackIds
- .SelectMany(i => _libraryManager.GetItemById(i).ThemeVideoIds)
- .ToList();
+ var linkedItemWithThemes = album.SoundtrackIds
+ .Select(i => _libraryManager.GetItemById(i))
+ .FirstOrDefault(i => i.ThemeVideoIds.Count > 0);
+
+ if (linkedItemWithThemes != null)
+ {
+ themeVideoIds = linkedItemWithThemes.ThemeVideoIds;
+ item = linkedItemWithThemes;
+ }
}
}