mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 16:25:28 +03:00
stub out mock sync provider
This commit is contained in:
@@ -3,6 +3,7 @@ using MediaBrowser.Controller.Sync;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Sync;
|
||||
using ServiceStack;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Api.Sync
|
||||
@@ -50,9 +51,11 @@ namespace MediaBrowser.Api.Sync
|
||||
{
|
||||
}
|
||||
|
||||
[Route("/Sync/Schedules", "POST", Summary = "Gets sync schedules.")]
|
||||
public class CreateSyncSchedule : SyncScheduleRequest
|
||||
[Route("/Sync/Targets", "GET", Summary = "Gets a list of available sync targets.")]
|
||||
public class GetSyncTarget : IReturn<List<SyncTarget>>
|
||||
{
|
||||
[ApiMember(Name = "UserId", Description = "UserId", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
|
||||
[Authenticated]
|
||||
@@ -65,6 +68,13 @@ namespace MediaBrowser.Api.Sync
|
||||
_syncManager = syncManager;
|
||||
}
|
||||
|
||||
public object Get(GetSyncTarget request)
|
||||
{
|
||||
var result = _syncManager.GetSyncTargets(request.UserId);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
public object Get(GetSyncJobs request)
|
||||
{
|
||||
var result = _syncManager.GetJobs(new SyncJobQuery
|
||||
@@ -119,12 +129,5 @@ namespace MediaBrowser.Api.Sync
|
||||
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
|
||||
public void Post(CreateSyncSchedule request)
|
||||
{
|
||||
var task = _syncManager.CreateSchedule(request);
|
||||
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user