-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14b3267
commit 672ea1d
Showing
7 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>0.0.0.1</Version> | ||
<AssemblyVersion>0.0.0.1</AssemblyVersion> | ||
<FileVersion>0.0.0.1</FileVersion> | ||
<Version>0.0.0.2</Version> | ||
<AssemblyVersion>0.0.0.2</AssemblyVersion> | ||
<FileVersion>0.0.0.2</FileVersion> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 21 additions & 1 deletion
22
Jellyfin.Plugin.DelayedRelease/DelayedReleasePluginServiceRegistrator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
using MediaBrowser.Common.Plugins;using MediaBrowser.Controller.Library;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;namespace Jellyfin.Plugin.DelayedRelease{public class DelayedReleasePluginServiceRegistrator : IPluginServiceRegistrator{public void RegisterServices(IServiceCollection serviceCollection){serviceCollection.AddLogging(configure => configure.AddConsole());serviceCollection.AddSingleton<ILogger>(sp => sp.GetRequiredService<ILogger<DelayedReleasePlugin>>());serviceCollection.AddSingleton<ILibraryPostScanTask, DelayedReleaseScheduler>();}}} | ||
using Jellyfin.Plugin.DelayedRelease.ScheduledTasks; | ||
using MediaBrowser.Common.Plugins; | ||
using MediaBrowser.Controller; | ||
using MediaBrowser.Controller.Library; | ||
using MediaBrowser.Controller.Plugins; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Jellyfin.Plugin.DelayedRelease | ||
{ | ||
/// <summary> | ||
/// Service registrator for the DelayedRelease plugin. | ||
/// </summary> | ||
public class DelayedReleasePluginServiceRegistrator : IPluginServiceRegistrator | ||
{ | ||
/// <inheritdoc /> | ||
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost) | ||
{ | ||
// Keine explizite Registrierung nötig - Jellyfin findet IScheduledTask-Implementierungen automatisch | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
Jellyfin.Plugin.DelayedRelease/ScheduledTasks/DelayedReleaseTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using MediaBrowser.Model.Tasks; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Jellyfin.Plugin.DelayedRelease.ScheduledTasks | ||
{ | ||
/// <summary> | ||
/// Task to handle delayed releases. | ||
/// </summary> | ||
public class DelayedReleaseTask : IScheduledTask | ||
{ | ||
private readonly ILogger<DelayedReleaseTask> _logger; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DelayedReleaseTask"/> class. | ||
/// </summary> | ||
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param> | ||
public DelayedReleaseTask(ILogger<DelayedReleaseTask> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public string Name => "Process delayed releases"; | ||
|
||
/// <inheritdoc/> | ||
public string Key => "DelayedReleaseTask"; | ||
|
||
/// <inheritdoc/> | ||
public string Description => "Processes media files based on their delayed release settings."; | ||
|
||
/// <inheritdoc/> | ||
public string Category => "DelayedRelease"; | ||
|
||
/// <inheritdoc/> | ||
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken) | ||
{ | ||
_logger.LogInformation("=== HELLO WORLD: DelayedReleaseTask started ==="); | ||
progress.Report(0); | ||
|
||
try | ||
{ | ||
// Hier kommt später die eigentliche Implementierung | ||
await Task.Delay(1000, cancellationToken).ConfigureAwait(false); | ||
_logger.LogWarning("=== HELLO WORLD: DelayedReleaseTask is running ==="); | ||
} | ||
catch (Exception ex) | ||
{ | ||
_logger.LogError(ex, "=== HELLO WORLD: Error in DelayedReleaseTask ==="); | ||
throw; | ||
} | ||
|
||
_logger.LogInformation("=== HELLO WORLD: DelayedReleaseTask completed ==="); | ||
progress.Report(100); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() | ||
{ | ||
// Standardmäßig alle 24 Stunden ausführen | ||
yield return new TaskTriggerInfo | ||
{ | ||
Type = TaskTriggerInfo.TriggerInterval, | ||
IntervalTicks = TimeSpan.FromHours(24).Ticks | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters