mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-19 15:33:03 +03:00
update server sync
This commit is contained in:
@@ -3,11 +3,9 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Sync;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Sync;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -58,7 +56,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
foreach (var localItem in localItems)
|
||||
{
|
||||
list.AddRange(GetPlayableMediaSources(localItem));
|
||||
list.AddRange(localItem.Item.MediaSources);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,24 +64,5 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private IEnumerable<MediaSourceInfo> GetPlayableMediaSources(LocalItem item)
|
||||
{
|
||||
return item.Item.MediaSources
|
||||
.Where(IsMediaSourcePlayable);
|
||||
}
|
||||
|
||||
private bool IsMediaSourcePlayable(MediaSourceInfo mediaSource)
|
||||
{
|
||||
if (mediaSource.Protocol == MediaProtocol.File)
|
||||
{
|
||||
if (!File.Exists(mediaSource.Path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user