aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs29
1 files changed, 6 insertions, 23 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
index 4fab95263..27a7d4ea9 100644
--- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
@@ -235,7 +235,7 @@ namespace MediaBrowser.Server.Implementations.Library
return GetStaticMediaSources(item, enablePathSubstitution).FirstOrDefault(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase));
}
- public IEnumerable<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution)
+ public IEnumerable<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution, User user = null)
{
if (item == null)
{
@@ -247,31 +247,14 @@ namespace MediaBrowser.Server.Implementations.Library
return item.GetMediaSources(enablePathSubstitution);
}
- return item.GetMediaSources(enablePathSubstitution);
- }
-
- public IEnumerable<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution, User user)
- {
- if (item == null)
- {
- throw new ArgumentNullException("item");
- }
-
- if (!(item is Video))
- {
- return item.GetMediaSources(enablePathSubstitution);
- }
-
- if (user == null)
- {
- throw new ArgumentNullException("user");
- }
-
var sources = item.GetMediaSources(enablePathSubstitution).ToList();
- foreach (var source in sources)
+ if (user != null)
{
- SetUserProperties(source, user);
+ foreach (var source in sources)
+ {
+ SetUserProperties(source, user);
+ }
}
return sources;