jellyfin-smart-playlist/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs
2024-06-27 01:47:44 +02:00

34 lines
1.3 KiB
C#

using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks {
public class GeneratePlaylist : IScheduledTask {
private readonly ILogger _logger;
public GeneratePlaylist(
ILogger<Plugin> logger
) {
_logger = logger;
_logger.LogInformation("Constructed Task");
}
public string Category => "Library";
public string Name => "(re)generate Smart Playlists";
public string Description => "Generate or regenerate all Smart Playlists";
public string Key => nameof(GeneratePlaylist);
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() {
return new[] {
new TaskTriggerInfo {
IntervalTicks = TimeSpan.FromMinutes(1).Ticks,
Type = TaskTriggerInfo.TriggerInterval,
}
};
}
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken) {
_logger.LogInformation("This is a test");
}
}
}