aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-24 12:03:10 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-24 12:03:10 -0400
commitd78c378452df2ce75c7208fe7ba919ab54455448 (patch)
tree691d47b4552344030dc00ec44c9af0c4b8cc9026 /MediaBrowser.Server.Implementations/Library
parent0d15e1d631a220f2d1288ad9632e3cfaa8ede479 (diff)
added theme song support
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
-rw-r--r--MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs11
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs21
2 files changed, 24 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
index cebd5e192..a120f074e 100644
--- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
+++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
@@ -1,4 +1,6 @@
-using MediaBrowser.Controller.Library;
+using System.IO;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,7 +38,12 @@ namespace MediaBrowser.Server.Implementations.Library
// Ignore hidden files and folders
if (args.IsHidden)
{
- return true;
+ var parentFolderName = Path.GetFileName(Path.GetDirectoryName(args.Path));
+
+ if (!string.Equals(parentFolderName, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
}
if (args.IsDirectory)
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 132dca4e2..5f07e0d87 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -274,9 +274,11 @@ namespace MediaBrowser.Server.Implementations.Library
var specialFeatures = items.OfType<Movie>().SelectMany(i => i.SpecialFeatures).ToList();
var localTrailers = items.SelectMany(i => i.LocalTrailers).ToList();
+ var themeSongs = items.SelectMany(i => i.ThemeSongs).ToList();
items.AddRange(specialFeatures);
items.AddRange(localTrailers);
+ items.AddRange(themeSongs);
// Need to use DistinctBy Id because there could be multiple instances with the same id
// due to sharing the default library
@@ -325,22 +327,29 @@ namespace MediaBrowser.Server.Implementations.Library
{
LibraryItemsCache.AddOrUpdate(item.Id, item, delegate { return item; });
- foreach (var trailer in item.LocalTrailers)
+ foreach (var subItem in item.LocalTrailers)
{
// Prevent access to foreach variable in closure
- var trailer1 = trailer;
- LibraryItemsCache.AddOrUpdate(trailer.Id, trailer, delegate { return trailer1; });
+ var trailer1 = subItem;
+ LibraryItemsCache.AddOrUpdate(subItem.Id, subItem, delegate { return trailer1; });
+ }
+
+ foreach (var subItem in item.ThemeSongs)
+ {
+ // Prevent access to foreach variable in closure
+ var trailer1 = subItem;
+ LibraryItemsCache.AddOrUpdate(subItem.Id, subItem, delegate { return trailer1; });
}
var movie = item as Movie;
if (movie != null)
{
- foreach (var special in movie.SpecialFeatures)
+ foreach (var subItem in movie.SpecialFeatures)
{
// Prevent access to foreach variable in closure
- var special1 = special;
- LibraryItemsCache.AddOrUpdate(special.Id, special, delegate { return special1; });
+ var special1 = subItem;
+ LibraryItemsCache.AddOrUpdate(subItem.Id, subItem, delegate { return special1; });
}
}
}