Skip to content

Commit

Permalink
Update version to 0.0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
grunwalski committed Jan 26, 2025
1 parent 14b3267 commit 672ea1d
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
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>
21 changes: 14 additions & 7 deletions Jellyfin.Plugin.DelayedRelease/DelayedReleasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,39 @@
namespace Jellyfin.Plugin.DelayedRelease
{
/// <summary>
/// Delayed Release Plugin.
/// Plugin that allows delayed release of media items.
/// </summary>
public class DelayedReleasePlugin : BasePlugin<PluginConfiguration>, IHasWebPages
{
private const string PluginName = "DelayedRelease";

/// <summary>
/// Initializes a new instance of the <see cref="DelayedReleasePlugin"/> class.
/// </summary>
/// <param name="applicationPaths">Instance of the <see cref="IApplicationPaths"/> interface.</param>
/// <param name="xmlSerializer">Instance of the <see cref="IXmlSerializer"/> interface.</param>
public DelayedReleasePlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
public DelayedReleasePlugin(
IApplicationPaths applicationPaths,
IXmlSerializer xmlSerializer)
: base(applicationPaths, xmlSerializer)
{
Instance = this;
}

/// <summary>
/// Gets current plugin instance.
/// </summary>
public static DelayedReleasePlugin Instance { get; private set; }
/// <inheritdoc />
public override string Name => PluginName;

/// <inheritdoc />
public override string Name => "Delayed Release";
public override string Description => "This plugin allows you to manage delayed releases for movies and series.";

/// <inheritdoc />
public override Guid Id => Guid.Parse("b7decd4f-e20d-45f5-b16b-da6f55d456a1");

/// <summary>
/// Gets the current plugin instance.
/// </summary>
public static DelayedReleasePlugin? Instance { get; private set; }

/// <inheritdoc />
public IEnumerable<PluginPageInfo> GetPages()
{
Expand Down
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
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>disable</Nullable>
<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
<AssemblyName>Jellyfin.Plugin.DelayedRelease</AssemblyName>
<RootNamespace>Jellyfin.Plugin.DelayedRelease</RootNamespace>
<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>

<ItemGroup>
Expand All @@ -21,15 +22,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Jellyfin.Data" Version="10.8.13" />
<PackageReference Include="Jellyfin.Controller" Version="10.8.13" />
<PackageReference Include="Jellyfin.Common" Version="10.8.13" />
<PackageReference Include="Jellyfin.Model" Version="10.8.13" />
<PackageReference Include="Jellyfin.Data" Version="10.*-*" />
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
<PackageReference Include="Jellyfin.Common" Version="10.*-*" />
<PackageReference Include="Jellyfin.Model" Version="10.*-*" />
</ItemGroup>

<!-- Code Analyzers-->
<ItemGroup>
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
Expand Down
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
};
}
}
}
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cat > Jellyfin.Plugin.DelayedRelease/bin/Debug/net8.0/meta.json << EOF
"owner": "your-username",
"targetAbi": "10.10.0.0",
"timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%S.0000000Z")",
"version": "0.0.0.1",
"version": "0.0.0.2",
"status": "Active",
"autoUpdate": false,
"imagePath": "",
Expand Down
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Delayed Release"
guid: "b7decd4f-e20d-45f5-b16b-da6f55d456a1"
imageUrl: ""
version: "0.0.0.1"
version: "0.0.0.2"
targetAbi: "10.10.0.0"
framework: "net8.0"
owner: "your-username"
Expand Down

0 comments on commit 672ea1d

Please sign in to comment.