aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-18 00:44:33 -0500
committerGitHub <noreply@github.com>2016-12-18 00:44:33 -0500
commite7cebb91a73354dc3e0d0b6340c9fbd6511f4406 (patch)
tree6f1c368c766c17b7514fe749c0e92e69cd89194a /MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs
parent025905a3e4d50b9a2e07fbf4ff0a203af6604ced (diff)
parentaaa027f3229073e9a40756c3157d41af2a442922 (diff)
Merge pull request #2350 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs')
-rw-r--r--MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs94
1 files changed, 0 insertions, 94 deletions
diff --git a/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs b/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs
deleted file mode 100644
index de98b83ef..000000000
--- a/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using MediaBrowser.Common.ScheduledTasks;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.FileOrganization;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.FileOrganization;
-using MediaBrowser.Model.Logging;
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using CommonIO;
-
-namespace MediaBrowser.Server.Implementations.FileOrganization
-{
- public class OrganizerScheduledTask : IScheduledTask, IConfigurableScheduledTask, IScheduledTaskActivityLog, IHasKey
- {
- private readonly ILibraryMonitor _libraryMonitor;
- private readonly ILibraryManager _libraryManager;
- private readonly ILogger _logger;
- private readonly IFileSystem _fileSystem;
- private readonly IServerConfigurationManager _config;
- private readonly IFileOrganizationService _organizationService;
- private readonly IProviderManager _providerManager;
-
- public OrganizerScheduledTask(ILibraryMonitor libraryMonitor, ILibraryManager libraryManager, ILogger logger, IFileSystem fileSystem, IServerConfigurationManager config, IFileOrganizationService organizationService, IProviderManager providerManager)
- {
- _libraryMonitor = libraryMonitor;
- _libraryManager = libraryManager;
- _logger = logger;
- _fileSystem = fileSystem;
- _config = config;
- _organizationService = organizationService;
- _providerManager = providerManager;
- }
-
- public string Name
- {
- get { return "Organize new media files"; }
- }
-
- public string Description
- {
- get { return "Processes new files available in the configured watch folder."; }
- }
-
- public string Category
- {
- get { return "Library"; }
- }
-
- private AutoOrganizeOptions GetAutoOrganizeOptions()
- {
- return _config.GetAutoOrganizeOptions();
- }
-
- public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
- {
- if (GetAutoOrganizeOptions().TvOptions.IsEnabled)
- {
- await new TvFolderOrganizer(_libraryManager, _logger, _fileSystem, _libraryMonitor, _organizationService, _config, _providerManager)
- .Organize(GetAutoOrganizeOptions(), cancellationToken, progress).ConfigureAwait(false);
- }
- }
-
- public IEnumerable<ITaskTrigger> GetDefaultTriggers()
- {
- return new ITaskTrigger[]
- {
- new IntervalTrigger{ Interval = TimeSpan.FromMinutes(5)}
- };
- }
-
- public bool IsHidden
- {
- get { return !GetAutoOrganizeOptions().TvOptions.IsEnabled; }
- }
-
- public bool IsEnabled
- {
- get { return GetAutoOrganizeOptions().TvOptions.IsEnabled; }
- }
-
- public bool IsActivityLogged
- {
- get { return false; }
- }
-
- public string Key
- {
- get { return "AutoOrganize"; }
- }
- }
-}