2015-03-07 15:43:53 -07:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
2015-03-07 16:39:24 -07:00
|
|
|
|
using MediaBrowser.Controller.Sync;
|
2015-03-07 15:43:53 -07:00
|
|
|
|
using MediaBrowser.Model.Dto;
|
2015-03-07 16:39:24 -07:00
|
|
|
|
using MediaBrowser.Model.Sync;
|
2015-03-07 15:43:53 -07:00
|
|
|
|
using System.Collections.Generic;
|
2015-03-07 16:39:24 -07:00
|
|
|
|
using System.Linq;
|
2015-03-07 15:43:53 -07:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
|
{
|
|
|
|
|
public class SyncedMediaSourceProvider : IMediaSourceProvider
|
|
|
|
|
{
|
2015-03-07 16:39:24 -07:00
|
|
|
|
private readonly ISyncManager _syncManager;
|
|
|
|
|
|
|
|
|
|
public SyncedMediaSourceProvider(ISyncManager syncManager)
|
|
|
|
|
{
|
|
|
|
|
_syncManager = syncManager;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-07 15:43:53 -07:00
|
|
|
|
public async Task<IEnumerable<MediaSourceInfo>> GetMediaSources(IHasMediaSources item, CancellationToken cancellationToken)
|
|
|
|
|
{
|
2015-03-07 16:39:24 -07:00
|
|
|
|
var jobItemResult = _syncManager.GetJobItems(new SyncJobItemQuery
|
|
|
|
|
{
|
|
|
|
|
AddMetadata = false,
|
|
|
|
|
Statuses = new List<SyncJobItemStatus> { SyncJobItemStatus.Synced },
|
|
|
|
|
ItemId = item.Id.ToString("N")
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var jobItems = jobItemResult
|
|
|
|
|
.Items
|
|
|
|
|
.Where(i => true);
|
|
|
|
|
|
2015-03-07 15:43:53 -07:00
|
|
|
|
return new List<MediaSourceInfo>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|