Compare commits

...

203 Commits

Author SHA1 Message Date
DarkFighterLuke 40194f9f26 Update .NET version in GH actions 2025-10-21 23:32:05 +02:00
DarkFighterLuke 67c6fd0422 Merge branch 'jellyfin-10.11' 2025-10-21 23:28:28 +02:00
DarkFighterLuke 7e496643f8 Adapt calls to IsPlayed method new signature
modified:   Jellyfin.Plugin.TubeArchivistMetadata/Jellyfin.Plugin.TubeArchivistMetadata.csproj
	modified:   Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs
	modified:   Jellyfin.Plugin.TubeArchivistMetadata/Tasks/JFToTubeArchivistProgressSyncTask.cs
2025-10-21 23:16:50 +02:00
DarkFighterLuke 6e7dbd859c Revise installation steps and .NET version in README
Updated installation instructions and image links in README.
2025-10-21 23:14:29 +02:00
DarkFighterLuke 13c4144aab Remove version 1.4.0.0 from manifest.json
Removed version 1.4.0.0 from the versions list in manifest.json.
2025-10-20 23:49:55 +02:00
DarkFighterLuke 98f73185d1 Merge pull request #67 from tubearchivist/jellyfin-10.11
Update plugin for Jellyfin 10.11
2025-10-20 22:29:22 +02:00
DarkFighterLuke f7cbff910d Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-10-20 20:28:12 +00:00
DarkFighterLuke 2d5327d31b Bump version 2025-10-20 22:27:01 +02:00
DarkFighterLuke a2e29dee3b Merge branch 'master' into jellyfin-10.11 2025-10-20 22:14:56 +02:00
DarkFighterLuke bdd99441d1 Fix #52 2025-07-16 22:58:44 +02:00
DarkFighterLuke cfd94260f1 Add same check on wached status event handler 2025-07-13 15:40:49 +02:00
DarkFighterLuke a28b4ccd7c Fix space after if statement and item id 2025-07-13 15:36:04 +02:00
DarkFighterLuke 50c0e1cef2 Merge pull request #54 from hsvflight/patch-1
Update Plugin.cs - Guid empty
2025-07-13 11:43:26 +02:00
DarkFighterLuke ca0a9215fe Change log message
The event is not catastrophic in Jellyfin, so it can be hidden the user unless debug level logs are enabled
2025-07-13 11:39:32 +02:00
DarkFighterLuke 6926a44e7c Merge pull request #57 from Atinoda/master
Reconfigure logging to debug
2025-07-10 22:40:59 +02:00
Che Cameron ab783238c3 Reconfigure logging to debug 2025-07-01 20:06:27 +01:00
DarkFighterLuke 4711a6a742 Update plugin for Jellyfin 10.11 2025-06-21 12:56:37 +02:00
hsvflight a783b3c739 Update Plugin.cs - Guid empty
Getting this error:
[2025-06-16 00:41:58.499 +00:00] [FTL] Unhandled Exception  
System.ArgumentException: Guid can't be empty (Parameter 'id')  
at Jellyfin.Plugin.TubeArchivistMetadata.Plugin.OnPlaybackProgress(...)

And right after playback fails
[2025-06-16 00:42:23.345 +00:00] [INF] Playback stopped reported by app "Jellyfin Roku" "3.0.5" playing "Video". Stopped at "973000" ms
2025-06-15 21:33:33 -05:00
DarkFighterLuke 583e94b35a Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-05-27 18:36:58 +00:00
DarkFighterLuke 80a1b6050d Merge pull request #50 from tubearchivist/bugfix/sync-usernames
Update build.yml
2025-05-27 20:34:48 +02:00
DarkFighterLuke a4942e78b6 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-05-26 21:43:57 +00:00
DarkFighterLuke 48070f311e Merge pull request #49 from tubearchivist/bugfix/sync-usernames
JF->TA Sync fix
2025-05-26 23:43:57 +02:00
DarkFighterLuke 96a72ab909 Update build.yml 2025-05-26 23:41:43 +02:00
DarkFighterLuke 9c6aa56db0 Fix JFToTubearchivistProgressSyncTask 2025-05-26 23:38:04 +02:00
DarkFighterLuke 413f45046d Sync progress status in OnWatchedStatusChange when watched is false
modified:   Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs
2025-05-26 23:37:20 +02:00
DarkFighterLuke 5ad6b2a381 Fix OnPlaybackProgress collection name retrieval 2025-05-26 23:35:42 +02:00
DarkFighterLuke 795047a50e Update README.md 2025-03-13 23:17:08 +01:00
DarkFighterLuke 323a208de2 Update README.md 2025-03-13 23:16:26 +01:00
DarkFighterLuke 55d320c456 Update BUG-REPORT.yml 2025-03-13 23:10:01 +01:00
DarkFighterLuke d5f2f0ae8e Update BUG-REPORT.yml 2025-03-13 23:08:04 +01:00
DarkFighterLuke c3bdfc26ea Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-03-10 22:01:17 +00:00
DarkFighterLuke c6f7f79385 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2025-03-10 23:00:05 +01:00
DarkFighterLuke 53ede13f54 Update build.yml 2025-03-10 22:59:59 +01:00
DarkFighterLuke eeda7dd91e Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-03-10 21:55:37 +00:00
DarkFighterLuke 867fbbae5b Merge pull request #38 from mattkduran/master
Added new method for auth headers
2025-03-10 22:46:11 +01:00
DarkFighterLuke 76ac750de2 Fix UpdateAuthorizationHeader method 2025-03-10 22:44:37 +01:00
DarkFighterLuke ddbbb4ba25 Merge branch 'master' into master 2025-03-10 19:01:34 +01:00
DarkFighterLuke 3fca2d1e09 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2025-03-10 17:47:46 +00:00
DarkFighterLuke 4f2f6c0429 Merge pull request #41 from tubearchivist/ta-v0.5.0
TubeArchivist v0.5.0 new API
2025-03-10 18:45:14 +01:00
Matt Duran ebb2cdfcc6 Modified setter to allow for usernames with spaces 2025-03-06 20:58:19 -08:00
Matt Duran c058a35abe Added new method for auth headers 2025-03-03 09:48:10 -08:00
DarkFighterLuke 11eb456c56 Fix JF crash when setting watched status with TA offline 2025-02-22 15:39:58 +01:00
DarkFighterLuke 4db1ce755a Update build.yaml 2025-02-22 15:15:54 +01:00
DarkFighterLuke a424721d93 Update README.md 2025-02-22 15:14:11 +01:00
DarkFighterLuke 16598bb86e Adapt to the new TA API changes 2025-02-21 17:42:58 +01:00
DarkFighterLuke 98472b5aa6 Fix JF->TA watched status synchronization 2025-02-21 17:41:51 +01:00
DarkFighterLuke ab96b227a1 Merge pull request #31 from AgentK20/tag-nre-fix
Fix ArgumentNullException when channel has no tags
2025-01-08 23:12:25 +01:00
AgentK 5ff96113c8 Spacing 2024-12-01 11:12:34 -06:00
AgentK 6697f2b4cc Correctly handle the possibility of a null-deserialized tags 2024-12-01 11:09:53 -06:00
DarkFighterLuke a45ef87f84 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-11-04 21:30:26 +00:00
DarkFighterLuke 157facdceb Merge workaround for JF crashing when scanning Series pull request by wolffshots 2024-11-04 22:29:26 +01:00
DarkFighterLuke be8481c795 Remove useless comments 2024-11-04 22:26:42 +01:00
DarkFighterLuke bd0a8371a5 Merge pull request #26 from wolffshots/workaround-series-crash
Workaround for JF crashing when scanning Series
2024-11-04 22:23:45 +01:00
DarkFighterLuke a75c474647 Fix manifest.json 2024-11-04 21:52:19 +01:00
DarkFighterLuke 1dd7019676 Fix manifest.json 2024-11-04 21:47:55 +01:00
DarkFighterLuke 355576c283 Update README.md 2024-11-04 21:44:38 +01:00
DarkFighterLuke 9091cdbe5b Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-11-04 20:41:49 +00:00
DarkFighterLuke a162ebb25d Add compatibility with Jellyfin 10.10 2024-11-04 21:40:29 +01:00
DarkFighterLuke 36eec27d9f Update .gitignore 2024-11-04 21:39:19 +01:00
wolffshots 2fee654efe chore: wrap itemYTId stuff in try catch 2024-10-22 15:11:50 +02:00
DarkFighterLuke ce8aea629b Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-09-14 13:42:01 +00:00
DarkFighterLuke a8f821625b Update version 2024-09-14 15:41:00 +02:00
DarkFighterLuke 6cb2d89b95 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-09-14 15:36:40 +02:00
DarkFighterLuke 080f3856b7 Update changelog 2024-09-14 15:36:30 +02:00
DarkFighterLuke b436ae13a1 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-09-14 13:33:10 +00:00
DarkFighterLuke dce122840c Adjust logs levels 2024-09-14 15:31:19 +02:00
DarkFighterLuke 9129bbda71 Report tasks progress
modified:   Jellyfin.Plugin.TubeArchivistMetadata/Tasks/JFToTubeArchivistProgressSyncTask.cs
	modified:   Jellyfin.Plugin.TubeArchivistMetadata/Tasks/TAToJellyfinProgressSyncTask.cs
2024-09-14 15:25:13 +02:00
DarkFighterLuke 698237a77a Merge pull request #18 from IceToast/master
feat: Add backdrop image to series
2024-09-13 15:11:57 +02:00
DarkFighterLuke 0bb2cb1108 Update README.md
Add playback progress synchronization info
2024-09-12 16:10:00 +02:00
DarkFighterLuke 286d43c840 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-09-12 13:36:15 +00:00
DarkFighterLuke 622079c887 Merge pull request #22 from tubearchivist/playback-progress
Playback progress synchronization
2024-09-12 15:33:59 +02:00
DarkFighterLuke c9cc4f150e Switch from watched status synchronization task to an event based solution 2024-09-11 16:19:18 +02:00
DarkFighterLuke 52342b3dc3 Fix typo in log message 2024-09-11 15:08:29 +02:00
DarkFighterLuke 9fff31c451 Fix typo in tasks properties 2024-09-06 13:49:24 +02:00
DarkFighterLuke 233595baac Implement JF->TA watched status synchronization 2024-09-06 13:46:11 +02:00
DarkFighterLuke a968ae838c Implement TA->JF watched status synchronization 2024-09-06 09:49:12 +02:00
DarkFighterLuke 44d00af16f Move TA DTOs to specific category folders and add Player field to Video 2024-09-06 09:48:32 +02:00
DarkFighterLuke 8edb8c9202 Merge branch 'playback-progress' of github.com:tubearchivist/tubearchivist-jf-plugin into playback-progress
Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html
2024-09-06 09:39:56 +02:00
DarkFighterLuke 625b6b6958 Add TA to JF sync task interval to plugin configuration
modified:   Jellyfin.Plugin.TubeArchivistMetadata/Configuration/PluginConfiguration.cs
	modified:   Jellyfin.Plugin.TubeArchivistMetadata/Configuration/configPage.html
	modified:   Jellyfin.Plugin.TubeArchivistMetadata/Tasks/TAToJellyfinProgressSyncTask.cs
2024-09-06 09:38:01 +02:00
DarkFighterLuke 6e76761994 Add TA to JF sync task interval to plugin configuration 2024-09-04 17:40:31 +02:00
DarkFighterLuke b07ffb2a83 Enhance tasks startup 2024-09-04 17:20:02 +02:00
DarkFighterLuke b3ef252edb Add startup task to synchronize Jellyfin plaback progresses to TA 2024-09-04 17:18:58 +02:00
DarkFighterLuke 4ffdbaf7f8 Allow only one Jellyfin user to sync data from 2024-08-30 17:34:26 +02:00
DarkFighterLuke fc221e4407 Set task trigger interval to 1 second 2024-08-30 17:18:31 +02:00
DarkFighterLuke b65f6332cb Swap playback progress options order 2024-08-30 17:17:43 +02:00
DarkFighterLuke 1a3fa6e823 Fix items retrieval 2024-08-30 16:36:52 +02:00
DarkFighterLuke 962794c62c Define JSON constructor 2024-08-30 16:36:16 +02:00
DarkFighterLuke 9a40ba93e8 Add configuration options 2024-08-30 10:13:32 +02:00
DarkFighterLuke fd4a9a0130 Implement TA->JF synchronization 2024-08-27 00:12:14 +02:00
DarkFighterLuke cc28016984 Create progress TA API DTO 2024-08-26 18:11:06 +02:00
DarkFighterLuke 9179ea8602 Send playback progress to TubeArchivist 2024-08-26 15:04:47 +02:00
IceToast 6675f7f762 feat: Add backdrop image to series 2024-07-15 21:47:06 +02:00
DarkFighterLuke 8b49afad25 Update README.md 2024-05-14 22:24:03 +02:00
DarkFighterLuke e355c304a2 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-05-14 20:20:16 +00:00
DarkFighterLuke 2bdee20beb Add packages read permission 2024-05-14 22:19:07 +02:00
DarkFighterLuke a085a5a4bf Add Jellyfin GitHub Nuget registry to sources 2024-05-14 22:06:27 +02:00
DarkFighterLuke 3f0267ced0 Use net8.0 for the builds 2024-05-14 21:57:01 +02:00
DarkFighterLuke 70123f597a Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-14 21:54:55 +02:00
DarkFighterLuke b4d6ea2646 Use net8.0 for the builds 2024-05-14 21:54:13 +02:00
DarkFighterLuke e0ef8b1e86 Update Jellyfin depndencies version 2024-05-14 21:53:49 +02:00
DarkFighterLuke 362582dddf Update version 2024-05-14 20:29:44 +02:00
DarkFighterLuke 1c49427761 Merge branch 'jellyfin-10.9' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-14 20:17:26 +02:00
DarkFighterLuke 49effb3d3f Update README.md 2024-05-14 20:08:01 +02:00
DarkFighterLuke 66e6a49cc7 Change jprm action commit 2024-05-14 19:51:13 +02:00
DarkFighterLuke 3dca19c3e5 Update version 2024-05-14 19:50:24 +02:00
DarkFighterLuke 55ab16a01a Fix plugin URL in manifest.json 2024-05-14 19:50:14 +02:00
DarkFighterLuke 08c8df0292 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-05-14 17:37:20 +00:00
DarkFighterLuke 1a8f3b1aa7 Update build.yaml 2024-05-14 19:32:41 +02:00
DarkFighterLuke 59bfaa077e Use master branch as ref in checkout 2024-05-14 19:23:05 +02:00
DarkFighterLuke 9635a49c06 Fix pull parameter 2024-05-14 19:18:01 +02:00
DarkFighterLuke 00eeff552c Fix pull parameter 2024-05-14 19:14:48 +02:00
DarkFighterLuke 4294e7d138 Add pull parameter 2024-05-14 19:13:04 +02:00
DarkFighterLuke b2c7ba6509 Add fetch paramter 2024-05-14 19:09:22 +02:00
DarkFighterLuke 81895dadab Fix parameter for push 2024-05-14 19:04:06 +02:00
DarkFighterLuke 59710b2aba Fix parameter for push 2024-05-14 19:01:00 +02:00
DarkFighterLuke f34db507b0 Add parameter for push 2024-05-14 18:59:39 +02:00
DarkFighterLuke a2432beaa2 Replace action to commit manifest 2024-05-14 18:56:57 +02:00
DarkFighterLuke c908ea5b9c Update action commit 2024-05-14 18:46:15 +02:00
DarkFighterLuke e61beea66b Update action commit 2024-05-14 18:41:28 +02:00
DarkFighterLuke 61b3849406 Update action commit 2024-05-14 17:25:58 +02:00
DarkFighterLuke cb9f79b3fa Update action commit 2024-05-14 17:23:08 +02:00
DarkFighterLuke cf7cdb1ab3 Set as string 2024-05-14 17:16:13 +02:00
DarkFighterLuke f202240fe6 Remove comment 2024-05-14 17:13:16 +02:00
DarkFighterLuke b9d0aeeb05 Update action commit 2024-05-14 17:11:43 +02:00
DarkFighterLuke 46ac3cfdfa Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
build.yaml
2024-05-14 17:05:48 +02:00
DarkFighterLuke a00060ca9c Use DarkFighterLuke jprm fork 2024-05-14 17:01:31 +02:00
DarkFighterLuke c3f5248c80 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-09 23:56:08 +02:00
DarkFighterLuke 9921dd2308 Update manifest.json 2024-05-09 23:52:37 +02:00
DarkFighterLuke 1fcbbba49f Update manifest.json 2024-05-09 23:37:43 +02:00
DarkFighterLuke 4557ab6efd Update manifest.json 2024-05-09 23:33:53 +02:00
DarkFighterLuke 9febfef12a Ping TubeArchivist API when saving configuration and at boot 2024-05-09 22:53:56 +02:00
DarkFighterLuke 56e8c29a94 Detect directory separators in paths 2024-05-09 15:32:18 +02:00
DarkFighterLuke 7ea9d20e86 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin into dev 2024-05-09 10:50:31 +02:00
DarkFighterLuke bff3b2b59a Update README.md 2024-05-09 10:46:47 +02:00
DarkFighterLuke c4b1d1d954 Update README.md 2024-05-09 10:41:52 +02:00
DarkFighterLuke 8842a5fdf9 Add a second line for testing 2024-05-09 10:17:57 +02:00
DarkFighterLuke bc5fd7fa20 Add missing space 2024-05-09 10:14:52 +02:00
DarkFighterLuke 13fd9de010 Fix double * 2024-05-09 10:10:14 +02:00
DarkFighterLuke 6803016a17 Create release changelog file 2024-05-09 10:06:49 +02:00
DarkFighterLuke 00047b6753 Remove useless branch condition 2024-05-08 23:45:17 +02:00
DarkFighterLuke 107aa0ed6c Allow updates 2024-05-08 23:40:49 +02:00
DarkFighterLuke c93d705216 Set latest tag 2024-05-08 23:35:54 +02:00
DarkFighterLuke 8cbdeee818 Trigger push event 2024-05-08 23:31:09 +02:00
DarkFighterLuke f70527d218 Trigger push event 2024-05-08 23:30:10 +02:00
DarkFighterLuke 9f2c7e4510 Run workflow on tag creation and create release automatically 2024-05-08 23:24:07 +02:00
DarkFighterLuke a5904a5310 Attempt to set release message 2024-05-08 22:35:34 +02:00
DarkFighterLuke a7c6d575ed Attempt to set release message 2024-05-08 22:31:55 +02:00
DarkFighterLuke 5b14b3ac87 Attempt to set RELEASE_MESSAGE 2024-05-08 22:26:51 +02:00
DarkFighterLuke 8b6eae7a6c Fix release message variable 2024-05-08 22:22:09 +02:00
DarkFighterLuke 3c33025cfa Add quotes 2024-05-07 23:01:36 +02:00
DarkFighterLuke da56d00689 Fix variable definition 2024-05-07 22:59:41 +02:00
DarkFighterLuke aab2de6189 Move release message creation before build task 2024-05-07 22:56:52 +02:00
DarkFighterLuke 9b0c4b5d34 Set release message 2024-05-07 22:53:24 +02:00
DarkFighterLuke d6cf76f948 Change plugin description 2024-05-07 22:24:09 +02:00
DarkFighterLuke 03c77fcbc5 Add imageUrl 2024-05-07 16:03:27 +02:00
DarkFighterLuke 1f33b908be Revert "Set correct dotnet-target"
This reverts commit 6e24a61623.
2024-05-07 16:02:25 +02:00
DarkFighterLuke ebb74cf7f5 Fix artifact name 2024-05-07 15:56:47 +02:00
DarkFighterLuke 59550760eb Fix attempt for version in file name 2024-05-07 15:51:31 +02:00
DarkFighterLuke 3b9d235aee Use only version number in file name 2024-05-07 15:47:57 +02:00
DarkFighterLuke 857ca0f8e0 Change asset name 2024-05-07 15:45:12 +02:00
DarkFighterLuke 80f1091af3 Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata 2024-05-07 15:11:44 +02:00
DarkFighterLuke d1ddd4d32d Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
.github/workflows/build.yaml
2024-05-07 15:11:18 +02:00
DarkFighterLuke 924f85260e Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
.github/workflows/build.yaml
2024-05-07 15:09:08 +02:00
DarkFighterLuke ca56fcac34 Give write permission to upload 2024-05-07 15:07:27 +02:00
DarkFighterLuke 37c7056204 Give write permission to upload 2024-05-07 15:04:36 +02:00
DarkFighterLuke 8d89c82660 Add imageUrl 2024-05-07 00:16:58 +02:00
DarkFighterLuke 06efee0051 Fix plugin version in workflow 2024-05-07 00:14:09 +02:00
DarkFighterLuke 83b92f5dfe Fix paths and version 2024-05-07 00:09:15 +02:00
DarkFighterLuke 8e77326c20 Add solution file 2024-05-06 23:59:29 +02:00
DarkFighterLuke 37a49ddabd Fix path 2024-05-04 16:46:13 +02:00
DarkFighterLuke 6e24a61623 Set correct dotnet-target 2024-05-04 16:42:19 +02:00
DarkFighterLuke ddd61fa39c Automate build and release 2024-05-04 16:16:20 +02:00
DarkFighterLuke 3ba7e2ec52 Add compatibility with Windows in paths 2024-05-03 15:46:57 +02:00
DarkFighterLuke 40d5c90c4c Change required .NET version in README.md 2024-05-01 22:19:39 +02:00
DarkFighterLuke 634b3f7dc7 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin into jellyfin-10.9 2024-05-01 22:17:50 +02:00
DarkFighterLuke 057020f0ba Update README.md
Fix wrong replacement
2024-05-01 22:15:34 +02:00
DarkFighterLuke 02846a7d00 Add feature request issue template 2024-04-28 12:07:03 +02:00
DarkFighterLuke c9fee17716 Add bug report issue template 2024-04-28 12:05:10 +02:00
DarkFighterLuke 195acd2f1b Reference Jellyfin 10.9 DLLs 2024-04-26 12:35:53 +02:00
DarkFighterLuke 14032d3ed3 Adapt to support Jellyfin 10.9 API 2024-04-26 11:57:42 +02:00
DarkFighterLuke 604ed24f7c Update version 2024-04-18 21:51:33 +02:00
DarkFighterLuke eefdd2a635 Merge pull request #2 from ThisIsHetz/ThisIsHetz-Patch-1
Add fix for unclosed HTML breaks
2024-04-18 21:36:19 +02:00
Patrick Hetz 30715d5c26 Add fix for unclosed HTML breaks
This changes the order of operations, truncating description before
replacing newlines with HTML breaks, to prevent the creation of unclosed
breaks which may otherwise cause rendering issues in Jellyfin.
2024-04-18 07:29:42 -04:00
DarkFighterLuke c12340583e Change old repository references 2024-04-17 23:01:33 +02:00
DarkFighterLuke a9b335f797 Update README.md
Delete references to old tubearchivist-jf
2024-04-17 22:59:23 +02:00
DarkFighterLuke 6d5c0b86b2 Update README.md
Update references to point to the new repository
2024-04-17 22:48:55 +02:00
DarkFighterLuke 347b2131db Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata 2024-03-15 10:15:32 +01:00
DarkFighterLuke 5a7b43f6e9 Add new version 2024-03-15 10:15:19 +01:00
DarkFighterLuke 6f6cb3dab6 Fix bug on description length substringing 2024-03-15 10:11:25 +01:00
DarkFighterLuke 80b236d643 Update README.md 2024-03-14 22:11:26 +01:00
DarkFighterLuke 8b491ee673 Add new version 2024-03-14 21:51:12 +01:00
DarkFighterLuke 7e6a757aa1 Make maximum description length configurable 2024-03-14 21:47:12 +01:00
DarkFighterLuke c3b2512f6a Truncate descriptions to 500 characters 2024-03-14 21:26:53 +01:00
DarkFighterLuke df36579616 Add new version 2024-03-14 20:01:06 +01:00
DarkFighterLuke 46088c2373 Add episodes and series overview 2024-03-14 19:56:23 +01:00
DarkFighterLuke f9a82e2109 Update manifest 2024-03-14 16:40:43 +01:00
DarkFighterLuke 7436c8643c Fix URL by removing trailing slash for images 2024-03-14 16:34:12 +01:00
DarkFighterLuke c1969a949c Handle empty tags for videos and channels 2024-03-14 15:38:50 +01:00
DarkFighterLuke a2429c89ff Update version 2024-03-13 21:52:54 +01:00
DarkFighterLuke 06860f43fc Update checksum 2024-03-13 21:35:12 +01:00
DarkFighterLuke d03ee06947 Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
manifest.json
2024-03-13 15:27:34 +01:00
DarkFighterLuke a3cf4564b4 Fix image URL 2024-03-13 15:26:05 +01:00
DarkFighterLuke 57263ee789 Fix image URL 2024-03-13 15:22:55 +01:00
28 changed files with 1629 additions and 80 deletions
+59
View File
@@ -0,0 +1,59 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to help improve this project! Please read the [how to open an issue](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#how-to-open-an-issue) guide carefully before continuing.
- type: checkboxes
id: latest
attributes:
label: "I've read the documentation"
options:
- label: I'm running the latest version of tubearchivist-jf-plugin.
required: true
- label: I'm running the latest version of TubeArchivist.
required: true
- label: I have read the [how to open an issue](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#how-to-open-an-issue) guide, particularly the [bug report](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#bug-report) section.
required: true
- label: I have searched for both closed and open already existing issues about the problem I am reporting.
required: true
- type: input
id: os
attributes:
label: Operating System
description: On what operating system are you running Tube Archivist on?
placeholder: eg. Linux, Windows, ...
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: Your Bug Report
value: "## Describe the bug\n\n## Steps To Reproduce\n\n## Expected behavior"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant Jellyfin log output
description: Please copy and paste any relevant Jellyfin logs. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
@@ -0,0 +1,34 @@
name: Feature Request
description: I have an idea for a great addition to this project
title: "[Feature Request]: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to help improve this project! This project is *very* selective with accepting new feature requests. Please read the [how to open an issue](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#how-to-open-an-issue) guide carefully before continuing.
- type: checkboxes
id: already
attributes:
label: "I've read the documentation"
options:
- label: I have read the [how to open an issue](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#how-to-open-an-issue) guide, particularly the [feature request](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#feature-request) section.
required: true
- type: textarea
id: description
attributes:
label: Your Feature Request
value: "## Is your feature request related to a problem? Please describe.\n\n## Describe the solution you'd like\n\n## Additional context"
placeholder: Tell us what you see!
validations:
required: true
- type: checkboxes
id: help
attributes:
label: Your help is needed!
description: This project is ambitious as it is, please contribute.
options:
- label: Yes I will work on this in the next few days or weeks.
+86
View File
@@ -0,0 +1,86 @@
name: TubeArchivistMetadata Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
name: Build & Release
permissions:
contents: write
packages: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Get release version
id: newtag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Setup .Net
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
- name: Add Jellyfin GitHub Nuget registry to sources
run: |
dotnet nuget add source \
--username DarkFighterLuke \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github https://nuget.pkg.github.com/jellyfin/index.json
- name: Get version number only
run: |
TAG=${{ steps.newtag.outputs.tag }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Generate release message
run: |
# Read the YAML file and extract the value of the 'changelog' field
changelog=$(awk '/changelog:/ {flag=1; next} /^[^ ]/ {flag=0} flag' build.yaml | awk '{$1=$1};1')
# Check if changelog contains multiple lines
if [[ $(echo "$changelog" | wc -l) -gt 1 ]]; then
changelog=$(echo "$changelog" | sed 's/^/* /')
else
changelog="* $changelog"
fi
# Create release-changelog.md
echo "Changelog:" > release-changelog.md
echo "$changelog" >> release-changelog.md
- name: Build Jellyfin Plugin
uses: DarkFighterLuke/jellyfin-plugin-repository-manager@7a96768accc155ac7b597351b5033532f3c48173
id: jprm
with:
dotnet-target: net9.0
version: ${VERSION}
update-manifest: "true"
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{ steps.jprm.outputs.artifact }}
makeLatest: latest
bodyFile: release-changelog.md
tag: ${{ steps.newtag.outputs.tag }}
allowUpdates: true
- name: Commit manifest.json
uses: EndBug/add-and-commit@v9
with:
add: manifest.json
commit: --signoff
message: "Update manifest.json"
pull: "--no-rebase -X ours origin master"
+1
View File
@@ -3,3 +3,4 @@ obj/
.vs/
.idea/
artifacts
nuget.config
+7
View File
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<Version>1.4.0.0</Version>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<FileVersion>1.4.0.0</FileVersion>
</PropertyGroup>
</Project>
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Model.Plugins;
using Microsoft.Extensions.Logging;
@@ -13,6 +15,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
{
private ILogger _logger;
private string _tubeArchivistUrl;
private string _tubeArchivistApiKey;
private HashSet<string> _jfUsernamesTo;
/// <summary>
/// Initializes a new instance of the <see cref="PluginConfiguration"/> class.
@@ -30,7 +34,13 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
CollectionTitle = string.Empty;
_tubeArchivistUrl = string.Empty;
TubeArchivistApiKey = string.Empty;
_tubeArchivistApiKey = string.Empty;
MaxDescriptionLength = 500;
JFTASync = false;
JFUsernameFrom = string.Empty;
TAJFSync = false;
_jfUsernamesTo = new HashSet<string>();
TAJFTaskInterval = 1;
}
/// <summary>
@@ -59,12 +69,92 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
_logger.LogInformation("{Message}", "Given TubeArchivist URL contains no schema. Adding http://...");
_tubeArchivistUrl = Utils.SanitizeUrl("http://" + value);
}
Plugin.Instance?.LogTAApiConnectionStatus();
}
}
/// <summary>
/// Gets or sets TubeArchivist API key.
/// </summary>
public string TubeArchivistApiKey { get; set; }
public string TubeArchivistApiKey
{
get
{
return _tubeArchivistApiKey;
}
set
{
_tubeArchivistApiKey = value;
Plugin.Instance?.LogTAApiConnectionStatus();
Plugin.Instance?.UpdateAuthorizationHeader(value);
}
}
/// <summary>
/// Gets or sets maximum series and episodes overviews length.
/// </summary>
public int MaxDescriptionLength { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to enable TA->JF playback progress synchronization.
/// </summary>
public bool TAJFSync { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to enable JF->TA playback progress synchronization.
/// </summary>
public bool JFTASync { get; set; }
/// <summary>
/// Gets or sets the playback progress owner Jellyfin username to synchronize data to TubeArchivist.
/// </summary>
public string JFUsernameFrom { get; set; }
/// <summary>
/// Gets or sets the playback progress owners Jellyfin usernames to synchronize data from TubeArchivist.
/// </summary>
public string JFUsernamesTo
{
get
{
_logger.LogInformation("JFUsernamesTo configured: {Message}", string.Join(", ", _jfUsernamesTo));
return string.Join(", ", _jfUsernamesTo);
}
set
{
// Clear existing usernames
_jfUsernamesTo.Clear();
// Split by comma, then trim each part to remove leading/trailing spaces
foreach (var username in value.Split(','))
{
var trimmedUsername = username.Trim();
if (!string.IsNullOrEmpty(trimmedUsername))
{
_jfUsernamesTo.Add(trimmedUsername);
}
}
_logger.LogInformation("Set JFUsernamesTo to: {Message}", string.Join(", ", _jfUsernamesTo));
}
}
/// <summary>
/// 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.
/// </summary>
public int TAJFTaskInterval { get; set; }
/// <summary>
/// Gets the playback progress owners Jellyfin usernames to synchronize data from TubeArchivist.
/// </summary>
/// <returns>An array of usernames.</returns>
public HashSet<string> GetJFUsernamesToArray()
{
return _jfUsernamesTo;
}
}
}
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Template</title>
<title>TubeArchivistMetadata</title>
</head>
<body>
@@ -12,21 +12,73 @@
<div data-role="content">
<div class="content-primary">
<form id="TemplateConfigForm">
<div>
<h1>TubeArchivistMetadata</h1>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="CollectionTitle">Collection Title</label>
<input id="CollectionTitle" name="CollectionTitle" type="text" is="emby-input" placeholder="eg. YouTube" />
<input id="CollectionTitle" name="CollectionTitle" type="text" is="emby-input"
placeholder="eg. YouTube" />
<div class="fieldDescription">TubeArchivist collection display name</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TubeArchivistUrl">TubeArchivist URL</label>
<input id="TubeArchivistUrl" name="TubeArchivistUrl" type="text" is="emby-input" placeholder="http://..." />
<input id="TubeArchivistUrl" name="TubeArchivistUrl" type="text" is="emby-input"
placeholder="http://..." />
<div class="fieldDescription">TubeArchivist URL</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TubeArchivistApiKey">TubeArchivist API key</label>
<label class="inputLabel inputLabelUnfocused" for="TubeArchivistApiKey">TubeArchivist API
key</label>
<input id="TubeArchivistApiKey" name="TubeArchivistApiKey" type="text" is="emby-input" />
<div class="fieldDescription">TubeArchivist API key</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="MaxDescriptionLength">Maximum overviews
length</label>
<input id="MaxDescriptionLength" name="MaxDescriptionLength" type="number" is="emby-input"
min="0" />
<div class="fieldDescription">This is the maximum length of the descriptions showed in series
and episodes</div>
</div>
<div>
<h2>Playback synchronization</h2>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label" for="JFTASync">
<input id="JFTASync" name="JFTASync" type="checkbox" is="emby-checkbox" />
<span>Synchronize Jellyfin playback progress to TubeArchivist</span>
</label>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="JFUsernameFrom">Jellyfin username to sync
playback status from</label>
<input id="JFUsernameFrom" name="JFUsernameFrom" type="text" is="emby-input"
placeholder="Username1, username2, ..." />
<div class="fieldDescription">This is the Jellyfin username to synchronize data from on
TubeArchivist</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label" for="TAJFSync">
<input id="TAJFSync" name="TAJFSync" type="checkbox" is="emby-checkbox" />
<span>Synchronize TubeArchivist playback progress to Jellyfin</span>
</label>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="JFUsernamesTo">Jellyfin usernames to sync
playback status to</label>
<input id="JFUsernamesTo" name="JFUsernamesTo" type="text" is="emby-input"
placeholder="Username1, username2, ..." />
<div class="fieldDescription">These are the (comma separated) Jellyfin usernames to synchronize
data from TubeArchivist</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TAJFTaskInterval">TubeArchivist to Jellyfin
playback progress synchronization interval</label>
<input id="TAJFTaskInterval" name="TAJFTaskInterval" type="number" is="emby-input" min="1" />
<div class="fieldDescription">This is the TubeArchivist to Jellyfin playback progress
synchronization interval in seconds (Jellyfin restart required).</div>
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
@@ -47,6 +99,12 @@
document.querySelector('#CollectionTitle').value = config.CollectionTitle;
document.querySelector('#TubeArchivistUrl').value = config.TubeArchivistUrl;
document.querySelector('#TubeArchivistApiKey').value = config.TubeArchivistApiKey;
document.querySelector('#MaxDescriptionLength').value = config.MaxDescriptionLength;
document.querySelector('#JFTASync').checked = config.JFTASync;
document.querySelector('#JFUsernamesTo').value = config.JFUsernamesTo;
document.querySelector('#TAJFSync').checked = config.TAJFSync;
document.querySelector('#JFUsernameFrom').value = config.JFUsernameFrom;
document.querySelector('#TAJFTaskInterval').value = config.TAJFTaskInterval;
Dashboard.hideLoadingMsg();
});
});
@@ -58,6 +116,12 @@
config.CollectionTitle = document.querySelector('#CollectionTitle').value;
config.TubeArchivistUrl = document.querySelector('#TubeArchivistUrl').value;
config.TubeArchivistApiKey = document.querySelector('#TubeArchivistApiKey').value;
config.MaxDescriptionLength = document.querySelector('#MaxDescriptionLength').value;
config.JFTASync = document.querySelector('#JFTASync').checked;
config.JFUsernamesTo = document.querySelector('#JFUsernamesTo').value;
config.TAJFSync = document.querySelector('#TAJFSync').checked;
config.JFUsernameFrom = document.querySelector('#JFUsernameFrom').value;
config.TAJFTaskInterval = document.querySelector('#TAJFTaskInterval').value;
ApiClient.updatePluginConfiguration(TAMetadataConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
});
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.TubeArchivistMetadata</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.8.13" />
<PackageReference Include="Jellyfin.Model" Version="10.8.13" />
<PackageReference Include="Jellyfin.Controller" Version="10.11.0" />
<PackageReference Include="Jellyfin.Model" Version="10.11.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
+183 -2
View File
@@ -1,12 +1,23 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Jellyfin.Data.Enums;
using Jellyfin.Plugin.TubeArchivistMetadata.Configuration;
using Jellyfin.Plugin.TubeArchivistMetadata.Tasks;
using Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Plugin.TubeArchivistMetadata
@@ -16,13 +27,27 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
/// </summary>
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
{
private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataManager;
/// <summary>
/// Initializes a new instance of the <see cref="Plugin"/> class.
/// </summary>
/// <param name="applicationPaths">Instance of the <see cref="IApplicationPaths"/> interface.</param>
/// <param name="xmlSerializer">Instance of the <see cref="IXmlSerializer"/> interface.</param>
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, ILogger<Plugin> logger)
/// <param name="sessionManager">Instance of the <see cref="ISessionManager"/> interface.</param>
/// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
/// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param>
/// <param name="userDataManager">Instance of the <see cref="IUserDataManager"/> interface.</param>
public Plugin(
IApplicationPaths applicationPaths,
IXmlSerializer xmlSerializer,
ILogger<Plugin> logger,
ISessionManager sessionManager,
ILibraryManager libraryManager,
IUserManager userManager,
IUserDataManager userDataManager)
: base(applicationPaths, xmlSerializer)
{
Instance = this;
@@ -31,9 +56,18 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
handler.AllowAutoRedirect = false;
handler.CheckCertificateRevocationList = true;
HttpClient = new HttpClient(handler);
HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", Instance?.Configuration.TubeArchivistApiKey);
UpdateAuthorizationHeader(Configuration.TubeArchivistApiKey);
SessionManager = sessionManager;
sessionManager.PlaybackProgress += OnPlaybackProgress;
LibraryManager = libraryManager;
_userManager = userManager;
_userDataManager = userDataManager;
userDataManager.UserDataSaved += OnWatchedStatusChange;
logger.LogInformation("{Message}", "Collection display name: " + Instance?.Configuration.CollectionTitle);
logger.LogInformation("{Message}", "TubeArchivist API URL: " + Instance?.Configuration.TubeArchivistUrl);
logger.LogInformation("{Message}", "Pinging TubeArchivist API...");
}
/// <inheritdoc />
@@ -57,6 +91,16 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
/// </summary>
public HttpClient HttpClient { get; }
/// <summary>
/// Gets the SessionManager used globally by the plugin.
/// </summary>
public ISessionManager SessionManager { get; }
/// <summary>
/// Gets the LibraryManager used globally by the plugin.
/// </summary>
public ILibraryManager LibraryManager { get; }
/// <inheritdoc />
public IEnumerable<PluginPageInfo> GetPages() => new[]
{
@@ -66,5 +110,142 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace)
}
};
/// <summary>
/// Updates the HTTP client's Authorization header with the current API key.
/// </summary>
/// <param name="apiKey">TubeArchivist API key.</param>
public void UpdateAuthorizationHeader(string apiKey)
{
if (!string.IsNullOrEmpty(apiKey))
{
HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", apiKey);
Logger.LogInformation("{Message}", "Updated Authorization header with API key");
}
else
{
Logger.LogWarning("{Message}", "No TubeArchivist API key configured");
}
}
/// <summary>
/// Logs the TubeArchivist API connection status.
/// </summary>
public void LogTAApiConnectionStatus()
{
Logger.LogInformation("{Message}", "Ping...");
var api = TubeArchivistApi.GetInstance();
Task.Run(() => api.Ping()).ContinueWith(
task =>
{
if (task.Result != null)
{
Logger.LogInformation("{Message}", "TubeArchivist API said: " + task.Result.Response + "!");
}
else
{
Logger.LogCritical("{Message}", "TubeArchivist API was unreachable!");
}
},
TaskScheduler.Default);
}
private async void OnPlaybackProgress(object? sender, PlaybackProgressEventArgs eventArgs)
{
if (eventArgs == null || eventArgs.Item.Id == Guid.Empty)
{
Logger.LogDebug("Skipping progress synchronization: PlaybackProgress event triggered with null or empty Guid.");
return;
}
if (Instance!.Configuration.JFTASync && eventArgs.Users.Any(u => Instance!.Configuration.JFUsernameFrom.Equals(u.Username, StringComparison.Ordinal)))
{
BaseItem? season = LibraryManager.GetItemById(eventArgs.Item.ParentId);
BaseItem? channel = LibraryManager.GetItemById(season!.ParentId);
BaseItem? collection = LibraryManager.GetItemById(channel!.ParentId);
if (collection?.Name.ToLower(CultureInfo.CurrentCulture) == Instance?.Configuration.CollectionTitle.ToLower(CultureInfo.CurrentCulture) && eventArgs.PlaybackPositionTicks != null)
{
long progress = (long)eventArgs.PlaybackPositionTicks / TimeSpan.TicksPerSecond;
var videoId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
var statusCode = await TubeArchivistApi.GetInstance().SetProgress(videoId, progress).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
Logger.LogCritical("{Message}", $"POST /video/{videoId}/progress returned {statusCode} for video {eventArgs.Item.Name} with progress {progress} seconds");
}
}
}
}
private async void OnWatchedStatusChange(object? sender, UserDataSaveEventArgs eventArgs)
{
if (eventArgs == null || eventArgs.Item.Id == Guid.Empty)
{
Logger.LogDebug("Skipping watched status synchronization: WatchedStatusChange event triggered with null or empty Guid.");
return;
}
var user = _userManager.GetUserById(eventArgs.UserId);
if (user == null)
{
Logger.LogError("OnWatchedStatusChange callback called without user id for item {ItemName}", eventArgs.Item.Name);
return;
}
var userItemData = _userDataManager.GetUserData(user, eventArgs.Item);
if (Configuration.JFTASync && user != null && Configuration.GetJFUsernamesToArray().Contains(user!.Username))
{
var isPlayed = eventArgs.Item.IsPlayed(user, userItemData);
Logger.LogDebug("User {UserId} changed watched status to {Status} for the item {ItemName}", eventArgs.UserId, isPlayed, eventArgs.Item.Name);
string itemYTId;
try
{
if (eventArgs.Item is Series)
{
itemYTId = Utils.GetChannelNameFromPath(eventArgs.Item.Path);
}
else if (eventArgs.Item is Episode)
{
itemYTId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
}
else
{
return;
}
}
catch (Exception ex)
{
Logger.LogError(ex, "Error while processing item path: {ItemPath}", eventArgs.Item.Path ?? "null");
return;
}
try
{
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed);
}
if (eventArgs.Item is Episode)
{
var progress = _userDataManager.GetUserData(user, eventArgs.Item)?.PlaybackPositionTicks / TimeSpan.TicksPerSecond;
if (progress != null)
{
var videoId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
statusCode = await TubeArchivistApi.GetInstance().SetProgress(videoId, progress.Value).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
Logger.LogCritical("{Message}", $"POST /video/{videoId}/progress returned {statusCode} for video {eventArgs.Item.Name} with progress {progress} seconds");
}
}
}
}
catch (Exception ex)
{
Logger.LogCritical("An exception occurred while calling POST /watched for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}: {ExceptionMessage}", eventArgs.Item.Name, itemYTId, isPlayed, ex.Message);
}
}
}
}
}
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading;
@@ -59,10 +60,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
var list = new List<RemoteImageInfo>();
var taApi = TubeArchivistApi.GetInstance();
var videoTAId = item.Path.Split("/").Last().Split(".").First();
var videoTAId = Utils.GetVideoNameFromPath(item.Path);
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for video: {0} ({1})", video?.Title, videoTAId));
_logger.LogInformation("{Message}", "Thumb URI: " + video?.VidThumbUrl);
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for video: {0} ({1})", video?.Title, videoTAId));
_logger.LogDebug("{Message}", "Thumb URI: " + video?.VidThumbUrl);
if (video != null)
{
@@ -86,7 +87,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading;
@@ -50,10 +51,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
var result = new MetadataResult<Episode>();
var taApi = TubeArchivistApi.GetInstance();
var videoTAId = info.Path.Split("/").Last().Split(".").First();
var videoTAId = Utils.GetVideoNameFromPath(info.Path);
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for video: {0} ({1})", video?.Title, videoTAId));
_logger.LogInformation("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(video));
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for video: {0} ({1})", video?.Title, videoTAId));
_logger.LogDebug("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(video));
if (video != null)
{
@@ -62,7 +63,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
Name = video.Channel.Name,
ImageUrl = video.Channel.ThumbUrl,
Type = PersonType.Actor,
Type = Data.Enums.PersonKind.Actor,
});
result.HasMetadata = true;
result.Item = video.ToEpisode();
@@ -79,7 +80,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
var results = new List<RemoteSearchResult>();
var taApi = TubeArchivistApi.GetInstance();
var videoTAId = searchInfo.Path.Split("/").Last().Split(".").First();
var videoTAId = Utils.GetVideoNameFromPath(searchInfo.Path);
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
if (video != null)
{
@@ -98,7 +99,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -58,12 +58,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
var list = new List<RemoteImageInfo>();
var taApi = TubeArchivistApi.GetInstance();
var channelTAId = item.Path.Split("/").Last();
var channelTAId = Utils.GetChannelNameFromPath(item.Path);
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for channel: {0} ({1})", channel?.Name, channelTAId));
_logger.LogInformation("{Message}", "Thumb URI: " + channel?.ThumbUrl);
_logger.LogInformation("{Message}", "TVArt URI: " + channel?.TvartUrl);
_logger.LogInformation("{Message}", "Banner URI: " + channel?.BannerUrl);
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for channel: {0} ({1})", channel?.Name, channelTAId));
_logger.LogDebug("{Message}", "Thumb URI: " + channel?.ThumbUrl);
_logger.LogDebug("{Message}", "TVArt URI: " + channel?.TvartUrl);
_logger.LogDebug("{Message}", "Banner URI: " + channel?.BannerUrl);
if (channel != null)
{
@@ -85,6 +85,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
Type = ImageType.Banner,
Url = channel.BannerUrl
});
list.Add(new RemoteImageInfo
{
ProviderName = Name,
Type = ImageType.Backdrop,
Url = channel.TvartUrl
});
}
return list;
@@ -99,7 +105,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -50,10 +50,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
var result = new MetadataResult<Series>();
var taApi = TubeArchivistApi.GetInstance();
var channelTAId = info.Path.Split("/").Last();
var channelTAId = Utils.GetChannelNameFromPath(info.Path);
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for channel: {0} ({1})", channel?.Name, channelTAId));
_logger.LogInformation("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(channel));
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for channel: {0} ({1})", channel?.Name, channelTAId));
_logger.LogDebug("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(channel));
if (channel != null)
{
@@ -62,7 +62,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
Name = channel.Name,
ImageUrl = channel.ThumbUrl,
Type = PersonType.Actor,
Type = Data.Enums.PersonKind.Actor,
});
result.HasMetadata = true;
result.Item = channel.ToSeries();
@@ -79,7 +79,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
var results = new List<RemoteSearchResult>();
var taApi = TubeArchivistApi.GetInstance();
var channelTAId = searchInfo.Path.Split("/").Last();
var channelTAId = Utils.GetChannelNameFromPath(searchInfo.Path);
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
if (channel != null)
{
@@ -98,7 +98,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Enums;
using Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
{
/// <summary>
/// Task to sync Jellyfin playback progresses to TubeArchivist.
/// </summary>
public class JFToTubearchivistProgressSyncTask : IScheduledTask
{
private readonly ILogger<Plugin> _logger;
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataManager;
/// <summary>
/// Initializes a new instance of the <see cref="JFToTubearchivistProgressSyncTask"/> class.
/// </summary>
/// <param name="logger">Logger.</param>
/// <param name="libraryManager">Library manager.</param>
/// <param name="userManager">User manager.</param>
/// <param name="userDataManager">User data manager.</param>
public JFToTubearchivistProgressSyncTask(ILogger<Plugin> logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager)
{
_logger = logger;
_libraryManager = libraryManager;
_userManager = userManager;
_userDataManager = userDataManager;
}
/// <inheritdoc/>
public string Name => "JFToTubeArchivistProgressSyncTask";
/// <inheritdoc/>
public string Description => "This tasks syncs Jellyfin playback progresses to TubeArchivist";
/// <inheritdoc/>
public string Category => "TubeArchivistMetadata";
/// <inheritdoc/>
public string Key => "JFToTubeArchivistProgressSyncTask";
/// <inheritdoc/>
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
{
progress.Report(0);
if (Plugin.Instance!.Configuration.JFTASync)
{
var start = DateTime.Now;
_logger.LogInformation("Starting Jellyfin->TubeArchivist playback progresses synchronization.");
var taApi = TubeArchivistApi.GetInstance();
var videosCount = 0;
var jfUsername = Plugin.Instance!.Configuration.JFUsernameFrom;
var user = _userManager.GetUserByName(jfUsername);
if (user == null)
{
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
return;
}
var items = _libraryManager.GetItemList(new InternalItemsQuery
{
Name = Plugin.Instance?.Configuration.CollectionTitle,
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
});
var collectionItem = items.Count > 0 ? items[0] : null;
if (collectionItem == null)
{
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
_logger.LogCritical("{Message}", message);
}
else
{
var collection = (CollectionFolder)collectionItem;
var channels = collection.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Series }
});
_logger.LogDebug("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
_logger.LogDebug("Found {Message} channels", channels.Count);
foreach (Series channel in channels)
{
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
var years = channel.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Season }
});
_logger.LogDebug("Found {Years} years in channel {ChannelName}", years.Count, channel.Name);
foreach (Season year in years)
{
var videos = year.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Episode }
});
_logger.LogDebug("Found {Videos} videos in year {YearName} of the channel {ChannelName}", videos.Count, year.Name, channel.Name);
videosCount += videos.Count;
}
}
}
_logger.LogDebug("Found a total of {VideosCount} videos", videosCount);
var processedVideosCount = 0;
if (collectionItem == null)
{
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
_logger.LogCritical("{Message}", message);
}
else
{
var collection = (CollectionFolder)collectionItem;
var channels = collection.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Series }
});
foreach (Series channel in channels)
{
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
var isChannelWatched = false;
var isChannelCheckedForWatched = false;
var years = channel.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Season }
});
foreach (Season year in years)
{
var videos = year.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Episode }
});
videosCount += videos.Count;
foreach (Episode video in videos)
{
var videoYTId = Utils.GetVideoNameFromPath(video.Path);
_logger.LogDebug("{VideoYtId}", videoYTId);
HttpStatusCode statusCode;
var userItemData = _userDataManager.GetUserData(user, channel);
if (!isChannelCheckedForWatched && channel.IsPlayed(user, userItemData))
{
var isChannelPlayed = channel.IsPlayed(user, userItemData);
statusCode = await taApi.SetWatchedStatus(channelYTId, isChannelPlayed).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for channel {channel.Name} ({channelYTId}) with wacthed status {isChannelPlayed}");
}
else
{
isChannelWatched = true;
}
isChannelCheckedForWatched = true;
}
if (!isChannelWatched)
{
var isVideoPlayed = video.IsPlayed(user, userItemData);
statusCode = await taApi.SetWatchedStatus(videoYTId, isVideoPlayed).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for video {video.Name} ({videoYTId}) with wacthed status {isVideoPlayed}");
}
_logger.LogDebug("{Message}", isVideoPlayed);
if (!isVideoPlayed)
{
var playbackProgress = _userDataManager.GetUserData(user, video)?.PlaybackPositionTicks / TimeSpan.TicksPerSecond;
if (playbackProgress != null)
{
statusCode = await taApi.SetProgress(videoYTId, playbackProgress.Value).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
{
_logger.LogCritical("{Message}", $"POST /video/{videoYTId}/progress returned {statusCode} for video {video.Name} with progress {progress} seconds");
}
}
}
}
processedVideosCount++;
progress.Report(processedVideosCount * 100 / videosCount);
}
}
}
}
_logger.LogInformation("Time elapsed: {Time}", DateTime.Now - start);
}
else
{
_logger.LogInformation("Jellyfin->TubeArchivist playback synchronization is currently disabled.");
}
progress.Report(100);
}
/// <inheritdoc/>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{
return
[
new TaskTriggerInfo
{
Type = TaskTriggerInfoType.StartupTrigger,
},
];
}
}
}
@@ -0,0 +1,227 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Enums;
using Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
{
/// <summary>
/// Task to sync TubeArchivist playback progresses to Jellyfin.
/// </summary>
public class TAToJellyfinProgressSyncTask : IScheduledTask
{
private readonly ILogger<Plugin> _logger;
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataManager;
/// <summary>
/// Initializes a new instance of the <see cref="TAToJellyfinProgressSyncTask"/> class.
/// </summary>
/// <param name="logger">Logger.</param>
/// <param name="libraryManager">Library manager.</param>
/// <param name="userManager">User manager.</param>
/// <param name="userDataManager">User data manager.</param>
public TAToJellyfinProgressSyncTask(ILogger<Plugin> logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager)
{
_logger = logger;
_libraryManager = libraryManager;
_userManager = userManager;
_userDataManager = userDataManager;
}
/// <inheritdoc/>
public string Name => "TAToJellyfinProgressSyncTask";
/// <inheritdoc/>
public string Description => "This tasks syncs TubeArchivist playback progresses to Jellyfin";
/// <inheritdoc/>
public string Category => "TubeArchivistMetadata";
/// <inheritdoc/>
public string Key => "TAToJellyfinProgressSyncTask";
/// <inheritdoc/>
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
{
progress.Report(0);
if (Plugin.Instance!.Configuration.TAJFSync)
{
var start = DateTime.Now;
_logger.LogInformation("Starting TubeArchivist->Jellyfin playback progresses synchronization.");
var taApi = TubeArchivistApi.GetInstance();
var videosCount = 0;
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
{
var user = _userManager.GetUserByName(jfUsername);
if (user == null)
{
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
continue;
}
var items = _libraryManager.GetItemList(new InternalItemsQuery
{
Name = Plugin.Instance?.Configuration.CollectionTitle,
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
});
var collectionItem = items.Count > 0 ? items[0] : null;
if (collectionItem == null)
{
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
_logger.LogCritical("{Message}", message);
}
else
{
var collection = (CollectionFolder)collectionItem;
var channels = collection.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Series }
});
_logger.LogDebug("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
_logger.LogDebug("Found {Message} channels", channels.Count);
foreach (Series channel in channels)
{
var years = channel.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Season }
});
_logger.LogDebug("Found {Years} years in channel {ChannelName}", years.Count, channel.Name);
foreach (Season year in years)
{
var videos = year.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Episode }
});
_logger.LogDebug("Found {Videos} videos in year {YearName} of the channel {ChannelName}", videos.Count, year.Name, channel.Name);
videosCount += videos.Count;
}
}
}
}
_logger.LogDebug("Found a total of {VideosCount} videos", videosCount);
var processedVideosCount = 0;
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
{
var user = _userManager.GetUserByName(jfUsername);
if (user == null)
{
_logger.LogDebug("{Message}", $"Jellyfin user with username {jfUsername} not found");
continue;
}
var items = _libraryManager.GetItemList(new InternalItemsQuery
{
Name = Plugin.Instance?.Configuration.CollectionTitle,
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
});
var collectionItem = items.Count > 0 ? items[0] : null;
if (collectionItem == null)
{
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
_logger.LogCritical("{Message}", message);
}
else
{
var collection = (CollectionFolder)collectionItem;
var channels = collection.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Series }
});
foreach (Series channel in channels)
{
var years = channel.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Season }
});
foreach (Season year in years)
{
var videos = year.GetChildren(user, false, new InternalItemsQuery
{
IncludeItemTypes = new[] { BaseItemKind.Episode }
});
foreach (Episode video in videos)
{
var playbackProgress = await taApi.GetProgress(Utils.GetVideoNameFromPath(video.Path)).ConfigureAwait(true);
if (playbackProgress != null)
{
var userItemData = _userDataManager.GetUserData(user, video);
var userUpdateData = new UpdateUserItemDataDto
{
PlaybackPositionTicks = playbackProgress.Position * TimeSpan.TicksPerSecond
};
var taVideoInfo = await taApi.GetVideo(Utils.GetVideoNameFromPath(video.Path)).ConfigureAwait(true);
if (taVideoInfo != null)
{
if (taVideoInfo.Player.IsWatched)
{
userUpdateData.Played = true;
}
else
{
userUpdateData.Played = false;
}
}
_userDataManager.SaveUserData(user, video, userUpdateData, UserDataSaveReason.UpdateUserData);
_logger.LogInformation("{Message}", $"Playback progress for video {video.Name} set to {userItemData?.PlaybackPositionTicks / TimeSpan.TicksPerSecond} seconds for user {jfUsername}.");
_logger.LogInformation("{Message}", $"Watched status for video {video.Name} set to {userItemData?.Played} seconds for user {jfUsername}.");
processedVideosCount++;
progress.Report(processedVideosCount * 100 / videosCount);
}
}
}
}
}
}
_logger.LogInformation("Time elapsed: {Time}", DateTime.Now - start);
}
else
{
_logger.LogInformation("TubeArchivist->Jellyfin playback synchronization is currently disabled.");
}
progress.Report(100);
}
/// <inheritdoc/>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{
return
[
new TaskTriggerInfo
{
Type = TaskTriggerInfoType.IntervalTrigger,
IntervalTicks = TimeSpan.FromSeconds(Plugin.Instance!.Configuration.TAJFTaskInterval).Ticks
},
];
}
}
}
@@ -0,0 +1,33 @@
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// A class representing TubeArchivist API video watched status.
/// </summary>
public class Watched
{
/// <summary>
/// Initializes a new instance of the <see cref="Watched"/> class.
/// </summary>
/// <param name="id">Id of the video/channel/playlist.</param>
/// <param name="isWatched">Watched status.</param>
public Watched(string id, bool isWatched)
{
Id = id;
IsWatched = isWatched;
}
/// <summary>
/// Gets the id of the video/channel/playlist.
/// </summary>
[JsonProperty(PropertyName = "id")]
public string Id { get; }
/// <summary>
/// Gets a value indicating whether the item has been watched or not.
/// </summary>
[JsonProperty(PropertyName = "is_watched")]
public bool IsWatched { get; }
}
}
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Model.Entities;
@@ -70,6 +71,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// Gets channel tags.
/// </summary>
[JsonProperty(PropertyName = "channel_tags")]
[JsonConverter(typeof(TagsJsonConverter))]
public Collection<string> Tags { get; }
/// <summary>
@@ -108,6 +110,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
return new Series
{
Name = Name,
Overview = Utils.FormatDescription(Description),
Studios = new[] { Name },
ProviderIds = new Dictionary<string, string>()
{
@@ -123,7 +126,9 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
Type = ImageType.Primary
}
},
Tags = this.Tags.ToArray<string>()
Tags = this.Tags != null ?
this.Tags.ToArray<string>() :
[]
};
}
}
@@ -0,0 +1,44 @@
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// A class representing TubeArchivist API ping response data.
/// </summary>
public class PingResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="PingResponse"/> class.
/// </summary>
/// <param name="response">Response from the API ("pong").</param>
/// <param name="user">TubeArchivist user id.</param>
/// <param name="version">TubeArchivist version.</param>
public PingResponse(
string response,
int user,
string version)
{
this.Response = response;
this.User = user;
this.Version = version;
}
/// <summary>
/// Gets response to the ping ("pong").
/// </summary>
[JsonProperty(PropertyName = "response")]
public string Response { get; }
/// <summary>
/// Gets user id.
/// </summary>
[JsonProperty(PropertyName = "user")]
public int User { get; }
/// <summary>
/// Gets TubeArchivist version.
/// </summary>
[JsonProperty(PropertyName = "version")]
public string Version { get; }
}
}
@@ -0,0 +1,54 @@
using System;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// Custom JsonConverter to handle tags list that could be null.
/// </summary>
public class TagsJsonConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return objectType == typeof(Collection<string>);
}
/// <inheritdoc/>
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
JToken token = JToken.Load(reader);
var tags = new Collection<string>();
if (token.Type == JTokenType.Array)
{
var stringArray = token.ToObject<string[]>();
if (stringArray != null)
{
foreach (var tag in stringArray)
{
tags.Add(tag);
}
}
}
return tags;
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
var tags = (Collection<string>)(value ?? Array.Empty<string>());
writer.WriteStartArray();
foreach (var tag in tags)
{
writer.WriteValue(tag);
}
writer.WriteEndArray();
}
}
}
@@ -2,6 +2,7 @@ using System;
using System.Data;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using Microsoft.Extensions.Logging;
@@ -64,7 +65,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// <returns>A task.</returns>
public async Task<Channel?> GetChannel(string channelId)
{
ResponseContainer<Channel>? channel = null;
Channel? channel = null;
var channelsEndpoint = "/api/channel/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance?.Configuration.TubeArchivistUrl + channelsEndpoint + channelId));
@@ -72,19 +73,19 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
while (response.StatusCode == HttpStatusCode.Moved)
{
url = response.Headers.Location;
_logger.LogInformation("{Message}", "Received redirect to: " + url);
_logger.LogDebug("{Message}", "Received redirect to: " + url);
response = await client.GetAsync(url).ConfigureAwait(true);
}
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
if (response.IsSuccessStatusCode)
{
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
channel = JsonConvert.DeserializeObject<ResponseContainer<Channel>>(rawData);
channel = JsonConvert.DeserializeObject<Channel>(rawData);
}
return channel?.Data;
return channel;
}
/// <summary>
@@ -94,7 +95,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// <returns>A task.</returns>
public async Task<Video?> GetVideo(string videoId)
{
ResponseContainer<Video>? video = null;
Video? video = null;
var videosEndpoint = "/api/video/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance?.Configuration.TubeArchivistUrl + videosEndpoint + videoId));
@@ -102,19 +103,103 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
while (response.StatusCode == HttpStatusCode.Moved)
{
url = response.Headers.Location;
_logger.LogInformation("{Message}", "Received redirect to: " + url);
_logger.LogDebug("{Message}", "Received redirect to: " + url);
response = await client.GetAsync(url).ConfigureAwait(true);
}
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
if (response.IsSuccessStatusCode)
{
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
video = JsonConvert.DeserializeObject<ResponseContainer<Video>>(rawData);
_logger.LogDebug("{Message}", rawData);
video = JsonConvert.DeserializeObject<Video>(rawData);
}
return video?.Data;
return video;
}
/// <summary>
/// Validates connection and authentication to TubeArchivist.
/// </summary>
/// <returns>The ping response.</returns>
public async Task<PingResponse?> Ping()
{
PingResponse? pong = null;
var pingEndpoint = "/api/ping/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance!.Configuration.TubeArchivistUrl + pingEndpoint));
var response = await client.GetAsync(url).ConfigureAwait(true);
while (response.StatusCode == HttpStatusCode.Moved)
{
url = response.Headers.Location;
_logger.LogDebug("{Message}", "Received redirect to: " + url);
response = await client.GetAsync(url).ConfigureAwait(true);
}
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
if (response.IsSuccessStatusCode)
{
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
pong = JsonConvert.DeserializeObject<PingResponse>(rawData);
}
return pong;
}
/// <summary>
/// Send video playback progress to TubeArchivist.
/// </summary>
/// <param name="videoId">Video id.</param>
/// <param name="progress">Progress in seconds.</param>
/// <returns>The response <see cref="HttpStatusCode"/>.</returns>
public async Task<HttpStatusCode> SetProgress(string videoId, long progress)
{
var progressEndpoint = $"/api/video/{videoId}/progress/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance!.Configuration.TubeArchivistUrl + progressEndpoint));
var body = JsonConvert.SerializeObject(new Progress(progress));
var response = await client.PostAsync(url, new StringContent(body, Encoding.UTF8, "application/json")).ConfigureAwait(true);
return response.StatusCode;
}
/// <summary>
/// Send video playback progress to TubeArchivist.
/// </summary>
/// <param name="videoId">Video id.</param>
/// <returns>Video playback progress data.</returns>
public async Task<Progress?> GetProgress(string videoId)
{
Progress? progress = null;
var video = await GetVideo(videoId).ConfigureAwait(true);
if (video != null)
{
progress = new Progress((long)video.Player.Position);
_logger.LogDebug("{Message}", $"Retrieved progress {video.Player.Position}");
}
return progress;
}
/// <summary>
/// Set video/channel/playlist as watched on TubeArchivist.
/// </summary>
/// <param name="itemId">Video/channel/playlist id.</param>
/// <param name="isWatched">Whether the item has been watched or not.</param>
/// <returns>The response <see cref="HttpStatusCode"/>.</returns>
public async Task<HttpStatusCode> SetWatchedStatus(string itemId, bool isWatched)
{
var watchedEndpoint = $"/api/watched/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance!.Configuration.TubeArchivistUrl + watchedEndpoint));
var body = JsonConvert.SerializeObject(new Watched(itemId, isWatched));
var response = await client.PostAsync(url, new StringContent(body, Encoding.UTF8, "application/json")).ConfigureAwait(true);
return response.StatusCode;
}
}
}
@@ -0,0 +1,41 @@
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// A class representing TubeArchivist API video player data.
/// </summary>
public class Player
{
/// <summary>
/// Initializes a new instance of the <see cref="Player"/> class.
/// </summary>
/// <param name="duration">Duration of the video.</param>
/// <param name="isWatched">Whether the video is marked as watched.</param>
/// <param name="position">Video watched seconds.</param>
public Player(long duration, bool isWatched, double position)
{
Duration = duration;
IsWatched = isWatched;
Position = position;
}
/// <summary>
/// Gets the duration of the video.
/// </summary>
[JsonProperty(PropertyName = "duration")]
public long Duration { get; }
/// <summary>
/// Gets a value indicating whether the video is marked as watched.
/// </summary>
[JsonProperty(PropertyName = "watched")]
public bool IsWatched { get; }
/// <summary>
/// Gets the video watched seconds.
/// </summary>
[JsonProperty(PropertyName = "position")]
public double Position { get; }
}
}
@@ -0,0 +1,54 @@
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// A class representing TubeArchivist API video progress data.
/// </summary>
public class Progress
{
/// <summary>
/// Initializes a new instance of the <see cref="Progress"/> class.
/// </summary>
/// <param name="position">Playback progress in seconds.</param>
/// <param name="youtubeId">Video YouTube id.</param>
/// <param name="userId">Playback progress user id.</param>
[JsonConstructor]
public Progress(
long position,
string? youtubeId,
long? userId)
{
YoutubeId = youtubeId;
UserId = userId;
Position = position;
}
/// <summary>
/// Initializes a new instance of the <see cref="Progress"/> class.
/// </summary>
/// <param name="position">Playback progress in seconds.</param>
public Progress(long position)
{
Position = position;
}
/// <summary>
/// Gets or sets the video YouTube id.
/// </summary>
[JsonProperty(PropertyName = "youtube_id")]
public string? YoutubeId { get; set; }
/// <summary>
/// Gets or sets playback progress user id.
/// </summary>
[JsonProperty(PropertyName = "user_id")]
public long? UserId { get; set; }
/// <summary>
/// Gets or sets video playback progress (in seconds).
/// </summary>
[JsonProperty(PropertyName = "position")]
public long Position { get; set; }
}
}
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Model.Entities;
@@ -26,6 +27,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// <param name="published">Video published date.</param>
/// <param name="vidThumbUrl">Video thuumb image URL.</param>
/// <param name="youtubeId">Video YouTube id.</param>
/// <param name="player">Player info.</param>
public Video(
Channel channel,
Collection<string> tags,
@@ -33,7 +35,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
string description,
DateTime published,
string vidThumbUrl,
string youtubeId)
string youtubeId,
Player player)
{
this.Channel = channel;
this.Tags = tags;
@@ -42,6 +45,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
this.Published = published;
this.VidThumbUrl = vidThumbUrl;
this.YoutubeId = youtubeId;
Player = player;
}
/// <summary>
@@ -54,6 +58,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// Gets video tags.
/// </summary>
[JsonProperty(PropertyName = "tags")]
[JsonConverter(typeof(TagsJsonConverter))]
public Collection<string> Tags { get; }
/// <summary>
@@ -86,6 +91,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
[JsonProperty(PropertyName = "youtube_id")]
public string YoutubeId { get; set; }
/// <summary>
/// Getsthe player related info.
/// </summary>
[JsonProperty(PropertyName = "player")]
public Player Player { get; }
/// <summary>
/// Converts the TubeArchivist API video to a Jellyfin <see cref="RemoteSearchResult"/> object.
/// </summary>
@@ -112,6 +123,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
return new Episode
{
Name = Title,
Overview = Utils.FormatDescription(Description),
SeasonName = Published.Year.ToString(CultureInfo.CurrentCulture),
ParentIndexNumber = Published.Year,
SeriesName = Channel.Name,
@@ -1,3 +1,5 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
@@ -31,5 +33,62 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
return cleanedUrl;
}
/// <summary>
/// Format episodes and series descriptions replacing newlines with br tags.
/// </summary>
/// <param name="description">String to format.</param>
/// <returns>A string with \n replaced by br tags.</returns>
public static string FormatDescription(string description)
{
var maxLength = 500;
if (Plugin.Instance != null)
{
maxLength = Plugin.Instance.Configuration.MaxDescriptionLength;
}
if (description.Length > maxLength)
{
description = description.Substring(0, maxLength);
description = description.Replace("\n", "<br>", System.StringComparison.CurrentCulture);
}
return description;
}
/// <summary>
/// Get video name from file path on the disk.
/// </summary>
/// <param name="path">File path on disk.</param>
/// <returns>The video name.</returns>
public static string GetVideoNameFromPath(string path)
{
return path.Split(DetectDirectorySeparator(path)).Last().Split(".").First();
}
/// <summary>
/// Get channel name from directory path on the disk.
/// </summary>
/// <param name="path">Directory path on disk.</param>
/// <returns>The channel name.</returns>
public static string GetChannelNameFromPath(string path)
{
return path.Split(DetectDirectorySeparator(path)).Last();
}
private static char DetectDirectorySeparator(string path)
{
int backslashCount = path.Count(c => c == '\\');
int forwardSlashCount = path.Count(c => c == '/');
if (backslashCount > forwardSlashCount)
{
return '\\'; // Windows directory separator
}
else
{
return '/'; // Unix directory separator
}
}
}
}
+57 -24
View File
@@ -1,18 +1,24 @@
<h1 align="center">Jellyfin TubeArchivist Plugin</h1>
<p align="center">
<img alt="Plugin Banner" src="https://raw.githubusercontent.com/DarkFighterLuke/TubeArchivistMetadata/master/images/logo.png"/>
<img alt="Plugin Banner" src="https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png"/>
<br/>
</p>
> [!IMPORTANT]
> Jellyfin release cycle has changed in the past few months and now it is shorter than before. The plugin supports only the latest Jellyfin release, in order to continue using this plugin with all the latest features you will need to upgrade your Jellyfin installation.
> The same rule applies to TubeArchivist: the plugin is only guaranteed to work with the latest TubeArchivist version.
> [!WARNING]
> Jellyfin 10.10 introduced a bug that prevents the plugin to correctly create Season folders by year. The bug has been finally solved on the Jellyfin codebase, but, until the next minor release, a manual build of the Jellyfin branch `release-10.10.z` is required in order to get the fix running.<br>
> This is not a plugin bug, any issue opened about this bug will be immediately closed!
## About
<p>This plugin adds the metadata provider for <a href="https://www.tubearchivist.com/">TubeArchivist</a>.</p>
<p>This plugin offers improved flexibility and native integration with Jellyfin compared to <a href="https://github.com/tubearchivist/tubearchivist-jf">tubearchivist-jf</a> solution.<br> This solution runs also more smoothly than the cited one since it is direcly integrated in Jellyfin and it is not based on strict folder paths on the disk.<br>
Furthermore, it allows to configure a custom collection name.</p>
<p>This plugin adds the metadata provider for <a href="https://www.tubearchivist.com/">TubeArchivist</a>, offering improved flexibility and native integration with Jellyfin compared to previous solutions.</p>
## How it works
The media organization is the same used in [tubearchivist-jf](https://github.com/tubearchivist/tubearchivist-jf), so the collection will be a `Shows` collection, where each channel is a show and its videos are the episodes, organized in seasons by year.<br>
The media organization is a `Shows` collection, where each channel is a show and its videos are the episodes, organized in seasons by year.<br>
The plugin interacts with TubeArchivist APIs to fetch videos and channels metadata.
### Features
@@ -24,29 +30,35 @@ The plugin interacts with TubeArchivist APIs to fetch videos and channels metada
## Installation
### From official repository (recommended)
1. Go to `Dashboard -> Plugins` and select the `Repositories` tab
1. Go to `Dashboard -> Plugins` and click on the `Manage Repositories` button
2. Add a new repository with the following details:
- Repository name: `TubeArchivistMetadata`
- Repository URL: `https://github.com/DarkFighterLuke/TubeArchivistMetadata/raw/master/manifest.json`
![Add repository](https://github.com/DarkFighterLuke/TubeArchivistMetadata/assets/31162436/bc291599-dc5b-4f44-b401-ebf20c016d72)
3. Go to the `Catalog` tab
4. Find `TubeArchivistMetadata` in the `Metadata` section and install it
![Find plugin](https://github.com/DarkFighterLuke/TubeArchivistMetadata/assets/31162436/86897215-bac5-4cef-8bd3-ffec731b0875)
- Repository URL: `https://github.com/tubearchivist/tubearchivist-jf-plugin/raw/master/manifest.json`
![Add repository](https://github.com/user-attachments/assets/337ba921-bc97-47ea-815c-c664cf7661a2)
3. Go back to the catalog
4. Find `TubeArchivistMetadata` and install it
![Find plugin](https://github.com/user-attachments/assets/41f7315b-27c6-47dd-958f-21a232c30013)
5. Restart Jellyfin to apply the changes
### From ZIP in GitHub releases
1. Download the latest available release (`TubeArchivist-*.zip`) from the repository releases section
1. Download the latest available release (`tubearchivistmetadata_*.zip`) from the repository releases section
2. Extract the contained files in the `plugins/TubeArchivistMetadata` folder (you might need to create the folders) of your Jellyfin installation
3. Restart Jellyfin to apply the changes
3. Restart Jellyfin to apply the changes
## Configuration
<p>This plugin requires that you have already an instance of TubeArchivist up and running.</p>
Once installed, you have to configure the following parameters in the plugin configuration:
- Collection display name
- TubeArchivist instance address
- TubeArchivist API key
<ul>
<li>Collection display name</li>
<li>TubeArchivist instance address</li>
<li>TubeArchivist API key</li>
<li>Overviews length (channels and videos descriptions)</li>
<li>Playback synchronization settings discussed in the <a href="#playback-synchronization">Playback synchronization</a> paragraph</li>
</ul>
![Plugin configuration](https://github.com/tubearchivist/tubearchivist-jf-plugin/assets/31162436/d34464ea-ddfb-44b3-9d3e-5d5974956c58)
![Plugin configuration](https://github.com/DarkFighterLuke/TubeArchivistMetadata/assets/31162436/fbd97e50-4c6f-45e4-9a6a-7067eae2e8f3)
## Use the plugin
<p>Using the plugin is very simple. Let's start from the beginning:</p>
@@ -54,20 +66,41 @@ Once installed, you have to configure the following parameters in the plugin con
_NOTE: If you are using Docker containers, it is important to mount the TubeArchivist media path into Jellyfin container as **read-only**, in order to avoid possible operations on the media files that will break TubeArchivist._ <br>
1. Go to `Dashboard -> Libraries` and add a media library
2. In the form select `Shows` as Content type, set a display name for the library and set the TubeArchivist media folder in the `Folders` section
![Add library](https://github.com/DarkFighterLuke/TubeArchivistMetadata/assets/31162436/1eca534e-0929-4134-8587-3cff0009f618)
3. Scrolling down, uncheck all metadata and image providers except `TubeArchivist`. (You won't find TubeArchivist in seasons providers, so just disable everything there)
4. Save and come back to Home, you will see the newly added library. Jellyfin will have executed the metadata fetching for you after the collection creation and then you will see the metadata and the images of channels and videos
![Add library](https://github.com/tubearchivist/tubearchivist-jf-plugin/assets/31162436/1eca534e-0929-4134-8587-3cff0009f618)
4. Scrolling down, uncheck all metadata and image providers except `TubeArchivist`. (You won't find TubeArchivist in seasons providers, so just disable everything there)
5. Save and come back to Home, you will see the newly added library. Jellyfin will have executed the metadata fetching for you after the collection creation and then you will see the metadata and the images of channels and videos
## Playback synchronization
<p>Starting from v1.3.1 this plugin offers playback progress and watched status bidirectional synchronization, but you can choose to enable only a one way synchronization (Jellyfin->TubeArchivist or TubeArchivist->Jellyfin) too.</p>
### Jellyfin->TubeArchivist synchronization
<p>This kind of synchronization is done listening for progress and watched status changes while playing the videos for the specified users.<br>Furthermore, there is a task that runs at Jellyfin startup to synchronize the whole library.</p>
<p>In the plugin configuration you will find these settings:</p>
![JF->TA playback synchronization settings](https://github.com/user-attachments/assets/dc6be82f-e685-4896-a502-317681c47fc7)
<p>In the text field you can specify one Jellyfin username to synchronize data of to TubeArchivist.</p>
### TubeArchivist->Jellyfin synchronization
<p>This kind of synchronization is done using a Jellyfin scheduled task that regularly synchronizes data from TubeArchivist API to Jellyfin.</p>
<p>In the plugin configuration you will find these settings:</p>
![TA->JF playback synchronization settings](https://github.com/user-attachments/assets/1b4c33af-834f-45b3-9057-71830e7c8b4f)
<p>In the first text field you can specify one or more Jellyfin usernames to update data for.<br>
In the second field you can specify the interval in seconds the task should run at, so that you can choose according to your system requirements. The lower is the interval the higher will be the resources consuption on your system.</p>
## Build
1. To build this plugin you will need [.Net 6.x](https://dotnet.microsoft.com/download/dotnet/6.0).
1. To build this plugin you will need [.Net 9.x](https://dotnet.microsoft.com/download/dotnet/9.0).
2. Build plugin with following command
```
dotnet publish Jellyfin.Plugin.TubeArchivistMetadata --configuration Release --output bin
$ dotnet publish Jellyfin.Plugin.TubeArchivistMetadata --configuration Release --output bin
```
3. Place the dll-file in the `plugins/TubeArchivistMetadata` folder (you might need to create the folders) of your Jellyfin installation
3. Place the dll-file in the `plugins/tubearchivist-jf-plugin` folder (you might need to create the folders) of your Jellyfin installation
## License
+22
View File
@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Plugin.TubeArchivistMetadata", "Jellyfin.Plugin.TubeArchivistMetadata\Jellyfin.Plugin.TubeArchivistMetadata.csproj", "{7A112ACB-79E8-4FC9-BCF6-B3AC849DA2D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A112ACB-79E8-4FC9-BCF6-B3AC849DA2D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A112ACB-79E8-4FC9-BCF6-B3AC849DA2D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A112ACB-79E8-4FC9-BCF6-B3AC849DA2D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A112ACB-79E8-4FC9-BCF6-B3AC849DA2D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
+5 -4
View File
@@ -1,9 +1,10 @@
---
name: "TubeArchivistMetadata"
guid: "dc97d0c6-28b0-4242-afb4-5833ae1b3715"
version: "1.0.0.0"
targetAbi: "10.8.0.0"
framework: "net6.0"
imageUrl: https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png
version: "1.4.0.0"
targetAbi: "10.11.0.0"
framework: "net9.0"
overview: "Metadata for your TubeArchivist library on Jellyfin"
description: >
TubeArchivistMetadata is a plugin that automatically manages
@@ -13,4 +14,4 @@ owner: "DarkFighterLuke"
artifacts:
- "Jellyfin.Plugin.TubeArchivistMetadata.dll"
changelog: >
First release
Align compatibility with Jellyfin 10.11.x
+127 -7
View File
@@ -3,26 +3,146 @@
"category": "Metadata",
"guid": "dc97d0c6-28b0-4242-afb4-5833ae1b3715",
"name": "TubeArchivistMetadata",
"description": "A new and fully integrated way to manage metadata and organize your TubeArchivist library videos on Jellyfin.",
"description": "TubeArchivistMetadata is a plugin that automatically manages metadata for videos downloaded with TubeArchivist from YouTube.\n",
"owner": "DarkFighterLuke",
"overview": "Metadata for your TubeArchivist library on Jellyfin",
"imageUrl": "logo.png",
"imageUrl": "https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png",
"versions": [
{
"version": "1.3.7.0",
"changelog": "Fix JF->TA Sync\n",
"targetAbi": "10.10.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.7/tubearchivistmetadata_1.3.7.0.zip",
"checksum": "60d8e9f134912f907dccd30b531da4f6",
"timestamp": "2025-05-27T18:36:55Z"
},
{
"version": "1.3.6.0",
"changelog": "Fix TA auth header\n",
"targetAbi": "10.10.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.6/tubearchivistmetadata_1.3.6.0.zip",
"checksum": "513cde64268867d0047009eb2d986054",
"timestamp": "2025-03-10T22:01:13Z"
},
{
"version": "1.3.5.0",
"changelog": "Adapt to the new TA API changes Fix JF crash when setting watched status with TA offline\n",
"targetAbi": "10.10.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.5/tubearchivistmetadata_1.3.5.0.zip",
"checksum": "2536622c0ec73e6401860929f24849f7",
"timestamp": "2025-03-10T17:47:43Z"
},
{
"version": "1.3.4.0",
"changelog": "Merge workaround for JF crashing when scanning Series pull request by wolffshots\n",
"targetAbi": "10.10.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.4/tubearchivistmetadata_1.3.4.0.zip",
"checksum": "1ee6041139a6fdc3cecc8b2a427c60a8",
"timestamp": "2024-11-04T21:30:24Z"
},
{
"version": "1.3.3.0",
"changelog": "Add compatibility with Jellyfin 10.10\n",
"targetAbi": "10.10.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.3/tubearchivistmetadata_1.3.3.0.zip",
"checksum": "ee6431d8bdaf844672d167b6f3ee0a73",
"timestamp": "2024-11-04T20:41:46Z"
},
{
"version": "1.3.2.0",
"changelog": "Add tasks progress status Adjust logs levels\n",
"targetAbi": "10.9.1.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.2/tubearchivistmetadata_1.3.2.0.zip",
"checksum": "6162235807535a5c2a7570276798e69e",
"timestamp": "2024-09-14T13:41:58Z"
},
{
"version": "1.3.1.0",
"changelog": "Add support for Jellyfin 10.9.1\n",
"targetAbi": "10.9.1.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.1/tubearchivistmetadata_1.3.1.0.zip",
"checksum": "b0b526bbd1702970108e3b9a8c3709de",
"timestamp": "2024-09-12T13:36:12Z"
},
{
"version": "1.3.0.0",
"changelog": "Add support for Jellyfin 10.9.1\n",
"targetAbi": "10.9.1.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.0/tubearchivistmetadata_1.3.0.0.zip",
"checksum": "e1fde6f75a10a5f17bc9cc5814949180",
"timestamp": "2024-05-14T20:20:13Z"
},
{
"version": "1.2.5.0",
"changelog": "Ping the TA API to validate connection\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.5/tubearchivistmetadata_1.2.5.0.zip",
"checksum": "e4a0d076ffd84c976ad66dde91dfb840",
"timestamp": "2024-05-14T17:37:17Z"
},
{
"version": "1.2.4.0",
"changelog": "Fix issues with directory separators\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.4/tubearchivistmetadata_1.2.4.0.zip",
"checksum": "b418a46d458fe28354580d70748b1ced",
"timestamp": "2024-05-09T15:41:00Z"
},
{
"version": "1.2.3.0",
"changelog": "Add fix for unclosed HTML breaks\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.3/tubearchivistmetadata_1.2.3.0.zip",
"checksum": "f5328a662444739eaa7c59855bfcb203",
"timestamp": "2024-04-18T21:45:00Z"
},
{
"version": "1.2.2.0",
"changelog": "Fix bug on description length substringing\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.2/tubearchivistmetadata_1.2.2.0.zip",
"checksum": "82d04546916e1ba76d56de28e648447a",
"timestamp": "2024-03-15T10:12:00Z"
},
{
"version": "1.2.1.0",
"changelog": "Make maximum description length configurable\nTruncate descriptions to 500 characters\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.1/tubearchivistmetadata_1.2.1.0.zip",
"checksum": "cf68d169956f166a6ee68a06192651c2",
"timestamp": "2024-03-14T21:50:00Z"
},
{
"version": "1.2.0.0",
"changelog": "Add episodes and series overview\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.0/tubearchivistmetadata_1.2.0.0.zip",
"checksum": "75812a4464bf68c43fb9dcdb74d924e3",
"timestamp": "2024-03-14T20:00:00Z"
},
{
"version": "1.1.1.0",
"changelog": "Handle empty tags for videos and channels\nFix URL by removing trailing slash for images\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.1/tubearchivistmetadata_1.1.1.0.zip",
"checksum": "84ce752ce662e834690512c88ba48664",
"timestamp": "2024-03-14T16:35:00Z"
},
{
"version": "1.1.0.0",
"changelog": "Fix field name and add placeholders\nFix URL in logs after redirection\nAdd schema to TubeArchivist URL if not present in settings\nFix a particular case\nLog configuration settings at initialization\nSanitize URLs\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/DarkFighterLuke/TubeArchivistMetadata/releases/download/v1.1.0/TubeArchivistMetadata-1.1.0.zip",
"checksum": "167f1aa170e0426fd918c37a647aa882",
"timestamp": "2024-03-13 15:02:00"
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.0/tubearchivistmetadata_1.1.0.0.zip",
"checksum": "de4b6562973b7f75b6afe3a441bb0e19",
"timestamp": "2024-03-13T15:02:00Z"
},
{
"version": "1.0.0.0",
"changelog": "First release\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/DarkFighterLuke/TubeArchivistMetadata/releases/download/v1.0.0/TubeArchivistMetadata-1.0.0.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.0.0/tubearchivistmetadata_1.0.0.0.zip",
"checksum": "444f8980671de494b1875ee7d1657bcf",
"timestamp": "2024-03-11 16:02:00"
"timestamp": "2024-03-11T16:02:00Z"
}
]
}