From d386f79dfd6b16d1f412d8be4f09345ddc3d13bc Mon Sep 17 00:00:00 2001 From: DarkFighterLuke Date: Thu, 10 Jul 2025 22:32:22 +0200 Subject: [PATCH] Add configuration options --- .../Configuration/PluginConfiguration.cs | 50 +++++++-- .../Configuration/configPage.html | 102 ++++++++++++++---- .../Plugin.cs | 8 +- .../JFToTubeArchivistPlaylistsSyncTask.cs | 7 +- .../JFToTubeArchivistProgressSyncTask.cs | 2 +- .../Tasks/TAToJellyfinPlaylistsSyncTask.cs | 7 +- .../Tasks/TAToJellyfinProgressSyncTask.cs | 4 +- 7 files changed, 139 insertions(+), 41 deletions(-) diff --git a/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/PluginConfiguration.cs index e946fba..85befd0 100644 --- a/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/PluginConfiguration.cs @@ -36,11 +36,17 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration _tubeArchivistUrl = string.Empty; _tubeArchivistApiKey = string.Empty; MaxDescriptionLength = 500; - JFTASync = false; + JFTAProgressSync = false; JFUsernameFrom = string.Empty; - TAJFSync = false; + TAJFProgressSync = false; + JFTAPlaylistsSync = false; + JFTAPlaylistsDelete = false; + TAJFPlaylistsSync = false; + TAJFPlaylistsDelete = false; _jfUsernamesTo = new HashSet(); - TAJFTaskInterval = 1; + TAJFProgressTaskInterval = 60; + JFTAPlaylistsSyncTaskInterval = 60; + TAJFPlaylistsSyncTaskInterval = 60; } /// @@ -100,12 +106,32 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration /// /// Gets or sets a value indicating whether to enable TA->JF playback progress synchronization. /// - public bool TAJFSync { get; set; } + public bool TAJFProgressSync { get; set; } /// /// Gets or sets a value indicating whether to enable JF->TA playback progress synchronization. /// - public bool JFTASync { get; set; } + public bool JFTAProgressSync { get; set; } + + /// + /// Gets or sets a value indicating whether to enable JF->TA playlists synchronization. + /// + public bool JFTAPlaylistsSync { get; set; } + + /// + /// Gets or sets a value indicating whether to delete playlists from TA when not found on JF. + /// + public bool JFTAPlaylistsDelete { get; set; } + + /// + /// Gets or sets a value indicating whether to enable TA->JF playlists synchronization. + /// + public bool TAJFPlaylistsSync { get; set; } + + /// + /// Gets or sets a value indicating whether to delete playlists from JF when not found on TA. + /// + public bool TAJFPlaylistsDelete { get; set; } /// /// Gets or sets the playback progress owner Jellyfin username to synchronize data to TubeArchivist. @@ -146,7 +172,19 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration /// Gets or sets the interval in seconds at which the TubeArchivist to Jellyfin playback progress synchronization task should run. /// It requires Jellyfin server restart to take effect. /// - public int TAJFTaskInterval { get; set; } + public int TAJFProgressTaskInterval { get; set; } + + /// + /// Gets or sets the interval in seconds at which the Jellyfin to TubeArchivist playlists synchronization task should run. + /// It requires Jellyfin server restart to take effect. + /// + public int JFTAPlaylistsSyncTaskInterval { get; set; } + + /// + /// Gets or sets the interval in seconds at which the TubeArchivist to Jellyfin playlists synchronization task should run. + /// It requires Jellyfin server restart to take effect. + /// + public int TAJFPlaylistsSyncTaskInterval { get; set; } /// /// Gets the playback progress owners Jellyfin usernames to synchronize data from TubeArchivist. diff --git a/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html b/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html index d4e07d5..86f016d 100644 --- a/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html +++ b/Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html @@ -42,28 +42,43 @@ and episodes
-

Playback synchronization

+

Synchronization

-
- +
+

Jellyfin to TubeArchivist

+ from -
This is the Jellyfin username to synchronize data from on + placeholder="Username" /> +
This is the Jellyfin username to synchronize data to TubeArchivist
-
+
+
+ +
+ +
+ +
+
+
+

TubeArchivist to Jellyfin

+
@@ -72,13 +87,52 @@
These are the (comma separated) Jellyfin usernames to synchronize data from TubeArchivist
+
+ +
+
+
+ +
+ +
+ +
+
+
+

Tasks intervals

+
-
+
+ + +
This is the Jellyfin to TubeArchivist playlists + synchronization interval in seconds (Jellyfin restart required).
+
+
+ + +
This is the TubeArchivist to Jellyfin playlists + synchronization interval in seconds (Jellyfin restart required).
+