mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
rework media source methods
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user