diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-20 11:09:53 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-20 11:09:53 -0500 |
| commit | c798529caca49ef8c323c0e003dd9f4ba0394b5a (patch) | |
| tree | 635794b946774e151976f5a36327ecd10a88caf7 /MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs | |
| parent | 5917d66172bb870102778222919575df6aa72dda (diff) | |
#680 - Support new episode file sorting
Diffstat (limited to 'MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs b/MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs new file mode 100644 index 000000000..9d8236bde --- /dev/null +++ b/MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs @@ -0,0 +1,38 @@ +using MediaBrowser.Common.ScheduledTasks; +using MediaBrowser.Controller.FileOrganization; +using MediaBrowser.Controller.Persistence; +using MediaBrowser.Model.FileOrganization; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Server.Implementations.FileOrganization +{ + public class FileOrganizationService : IFileOrganizationService + { + private readonly ITaskManager _taskManager; + private readonly IFileOrganizationRepository _repo; + + public FileOrganizationService(ITaskManager taskManager, IFileOrganizationRepository repo) + { + _taskManager = taskManager; + _repo = repo; + } + + public void BeginProcessNewFiles() + { + _taskManager.CancelIfRunningAndQueue<OrganizerScheduledTask>(); + } + + + public Task SaveResult(FileOrganizationResult result, CancellationToken cancellationToken) + { + return _repo.SaveResult(result, cancellationToken); + } + + public IEnumerable<FileOrganizationResult> GetResults(FileOrganizationResultQuery query) + { + return _repo.GetResults(query); + } + } +} |
