[GH-ISSUE #32] [Bug]: Sync watch status from Jellyfin back to TA not working #26

Closed
opened 2026-03-23 20:34:57 +00:00 by mirror · 16 comments
Owner

Originally created by @arisenfromtheashes on GitHub (Dec 4, 2024).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/32

Originally assigned to: @DarkFighterLuke on GitHub.

I've read the documentation

Operating System

unraid docker

Your Bug Report

Describe the bug

Failing to sync watch status from Jellyfin back to TA

Steps To Reproduce

Configured the plugin per the documentation, Library populated properly, marked an episode as watched, didnt sync on its own after some time. Tried to run the scheduled task manually and still fails. (for context i only have the JF to TA config populated and not bidirectional)

Expected behavior

Should sync the watch status over to TA and be marked with the checkbox

Relevant Jellyfin log output

[2024-12-04 11:48:20.069 -06:00] [INF] [172] Jellyfin.Plugin.TubeArchivistMetadata.Plugin: Starting Jellyfin->TubeArchivist playback progresses synchronization.
[2024-12-04 11:48:20.071 -06:00] [ERR] [172] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task
System.ArgumentException: Invalid username (Parameter 'name')
   at Jellyfin.Server.Implementations.Users.UserManager.GetUserByName(String name)
   at Jellyfin.Plugin.TubeArchivistMetadata.Tasks.JFToTubearchivistProgressSyncTask.ExecuteAsync(IProgress`1 progress, CancellationToken cancellationToken)
   at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
[2024-12-04 11:48:20.071 -06:00] [INF] [172] Emby.Server.Implementations.ScheduledTasks.TaskManager: "JFToTubeArchivistProgressSyncTask" Failed after 0 minute(s) and 0 seconds

Anything else?

No response

Originally created by @arisenfromtheashes on GitHub (Dec 4, 2024). Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/32 Originally assigned to: @DarkFighterLuke on GitHub. ### I've read the documentation - [X] I'm running the latest version of tubearchivist-jf-plugin. - [X] 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. ### Operating System unraid docker ### Your Bug Report ## Describe the bug Failing to sync watch status from Jellyfin back to TA ## Steps To Reproduce Configured the plugin per the documentation, Library populated properly, marked an episode as watched, didnt sync on its own after some time. Tried to run the scheduled task manually and still fails. (for context i only have the JF to TA config populated and not bidirectional) ## Expected behavior Should sync the watch status over to TA and be marked with the checkbox ### Relevant Jellyfin log output ```shell [2024-12-04 11:48:20.069 -06:00] [INF] [172] Jellyfin.Plugin.TubeArchivistMetadata.Plugin: Starting Jellyfin->TubeArchivist playback progresses synchronization. [2024-12-04 11:48:20.071 -06:00] [ERR] [172] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task System.ArgumentException: Invalid username (Parameter 'name') at Jellyfin.Server.Implementations.Users.UserManager.GetUserByName(String name) at Jellyfin.Plugin.TubeArchivistMetadata.Tasks.JFToTubearchivistProgressSyncTask.ExecuteAsync(IProgress`1 progress, CancellationToken cancellationToken) at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options) [2024-12-04 11:48:20.071 -06:00] [INF] [172] Emby.Server.Implementations.ScheduledTasks.TaskManager: "JFToTubeArchivistProgressSyncTask" Failed after 0 minute(s) and 0 seconds ``` ### Anything else? _No response_
mirror 2026-03-23 20:34:58 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@arisenfromtheashes commented on GitHub (Dec 4, 2024):

update: so the play status does work. ie. while im watching via swiftfin on my apple tv, i can refresh TA and see the watch bar move across the video in TA at pretty much real time (refreshing once every 10 seconds or so), but a) after the video is finished, SF or JF didnt automatically mark the checkbox in its UI showing watched, and b) even after manually checking the box on the SF ATV app, the watched status still didnt sync over to TA.

<!-- gh-comment-id:2518300409 --> @arisenfromtheashes commented on GitHub (Dec 4, 2024): update: so the play status does work. ie. while im watching via swiftfin on my apple tv, i can refresh TA and see the watch bar move across the video in TA at pretty much real time (refreshing once every 10 seconds or so), but a) after the video is finished, SF or JF didnt automatically mark the checkbox in its UI showing watched, and b) even after manually checking the box on the SF ATV app, the watched status still didnt sync over to TA.
Author
Owner

@joshrivers commented on GitHub (Dec 7, 2024):

Oddly, I get no playhead sync at all...but I do get checkbox on completion. I do not, however, see any logging. (I wish I could provide better details)

<!-- gh-comment-id:2524960287 --> @joshrivers commented on GitHub (Dec 7, 2024): Oddly, I get no playhead sync at all...but I do get checkbox on completion. I do not, however, see any logging. (I wish I could provide better details)
Author
Owner

@DarkFighterLuke commented on GitHub (Mar 10, 2025):

@arisenfromtheashes from the logs I see that the username you provided in the plugin settings for the JF->TA synchronization is wrong.

<!-- gh-comment-id:2711932396 --> @DarkFighterLuke commented on GitHub (Mar 10, 2025): @arisenfromtheashes from the logs I see that the username you provided in the plugin settings for the JF->TA synchronization is wrong.
Author
Owner

@Jurrer commented on GitHub (Apr 3, 2025):

Hi, I realized my issue https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/44 might be related.
The input fields for the username are not working as they should.
TLDR: use the second field, first one does not work

<!-- gh-comment-id:2777125399 --> @Jurrer commented on GitHub (Apr 3, 2025): Hi, I realized my issue https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/44 might be related. The input fields for the username are not working as they should. TLDR: use the second field, first one does not work
Author
Owner

@dannykorpan commented on GitHub (May 25, 2025):

Same problem here. Any updates?

<!-- gh-comment-id:2907978470 --> @dannykorpan commented on GitHub (May 25, 2025): Same problem here. Any updates?
Author
Owner

@DarkFighterLuke commented on GitHub (May 26, 2025):

I've just released the version 1.3.7, please try with that and let me know if this bug disappeared.

<!-- gh-comment-id:2910674084 --> @DarkFighterLuke commented on GitHub (May 26, 2025): I've just released the version 1.3.7, please try with that and let me know if this bug disappeared.
Author
Owner

@p-rintz commented on GitHub (Jun 15, 2025):

This specific issue works for me with the update.

However, the videos dont seem to get auto deleted after being watched.

<!-- gh-comment-id:2973832031 --> @p-rintz commented on GitHub (Jun 15, 2025): This specific issue works for me with the update. However, the videos dont seem to get auto deleted after being watched.
Author
Owner

@aomann commented on GitHub (Jul 2, 2025):

I am having the same issue where auto deleted isn't working.

I believe is cause since the plugin calls SetWatchedStatus event if the video/channel was already mark as watched.

In TA the watched_date property is then reset at each sync to the current timestamp.

<!-- gh-comment-id:3026170853 --> @aomann commented on GitHub (Jul 2, 2025): I am having the same issue where auto deleted isn't working. I believe is cause since the plugin calls `SetWatchedStatus` event if the video/channel was already mark as watched. In TA the `watched_date` property is then reset at each sync to the current timestamp.
Author
Owner

@Jurrer commented on GitHub (Jul 2, 2025):

@aomann
I fixed similar issue recently here https://github.com/tubearchivist/tubearchivist/pull/926

The watch date was being stamped to all videos when calling /watched endpoint.
Now it's only stamped for the watched videos.

Now the plugin needs to check if the video is watched in TA, and only call SetWatchedStatus when video is not watched.

<!-- gh-comment-id:3028481780 --> @Jurrer commented on GitHub (Jul 2, 2025): @aomann I fixed similar issue recently here https://github.com/tubearchivist/tubearchivist/pull/926 The watch date was being stamped to all videos when calling /watched endpoint. Now it's only stamped for the watched videos. Now the plugin needs to check if the video is watched in TA, and only call `SetWatchedStatus` when video is not watched.
Author
Owner

@bbilly1 commented on GitHub (Jul 10, 2025):

Just documenting here, how watch progress is expected to work, or how it's implemented in the web interface:

  1. During video playback, regularly send position updates to TA:
POST /api/video/<video-id>/progress/
{"position": 12.5}

that is expected to send position updates after the first 10 seconds has passed to avoid cluttering the continue watching section.

The response you get back indicates the watched state:

{"watched":false,"duration":1422,"duration_str":"23m 42s","position":0.0}

the watched boolean will switch to true once TA has marked it as watched, aka after 90% playback or something...

So that's all there is to it, during playback, just send regular progress requests.

  1. To mark a channel/playlist as watched in bulk, that's handled like so:
POST /api/watched/
{"id":"<video-channel-playlist-id>","is_watched":true}

that is meant from when you click in the interface to mark it as watched, that shouldn't be called during playback.

So ideally, jellyfin would do the same:

  • during playback, send updates every 10 seconds or so, mark it in jellyfin as watched once TA reports it as watched too.
  • when marking as watched in the interface with the little checkbox there, send a bulk update request to TA
<!-- gh-comment-id:3057133080 --> @bbilly1 commented on GitHub (Jul 10, 2025): Just documenting here, how watch progress is expected to work, or how it's implemented in the web interface: 1. During video playback, regularly send position updates to TA: ``` POST /api/video/<video-id>/progress/ {"position": 12.5} ``` that is expected to send position updates after the first 10 seconds has passed to avoid cluttering the continue watching section. The response you get back indicates the watched state: ```json {"watched":false,"duration":1422,"duration_str":"23m 42s","position":0.0} ``` the `watched` boolean will switch to `true` once TA has marked it as watched, aka after 90% playback or something... So that's all there is to it, during playback, just send regular progress requests. 2. To mark a channel/playlist as watched in bulk, that's handled like so: ``` POST /api/watched/ {"id":"<video-channel-playlist-id>","is_watched":true} ``` that is meant from when you click in the interface to mark it as watched, that shouldn't be called during playback. So ideally, jellyfin would do the same: - during playback, send updates every 10 seconds or so, mark it in jellyfin as watched once TA reports it as watched too. - when marking as watched in the interface with the little checkbox there, send a bulk update request to TA
Author
Owner

@p-rintz commented on GitHub (Jul 10, 2025):

Makes sense why Tubearchivist is no longer deleting watched videos then.

Because the plugin updates the 'watched_date' all the time for all videos.

I checked a video that I watched 2 weeks ago or so and the 'watched_date' was set to 6 minutes ago.

Not sure if it also has to do with all videos bein in the "Continue Watching" section after turning on progress syncing.

Im not sure with which criteria TubeArchivist puts videos in that section. I cannot see the position variable set for videos in that section that I never actually started.

<!-- gh-comment-id:3057532462 --> @p-rintz commented on GitHub (Jul 10, 2025): Makes sense why Tubearchivist is no longer deleting watched videos then. Because the plugin updates the 'watched_date' all the time for all videos. I checked a video that I watched 2 weeks ago or so and the 'watched_date' was set to 6 minutes ago. Not sure if it also has to do with all videos bein in the "Continue Watching" section after turning on progress syncing. Im not sure with which criteria TubeArchivist puts videos in that section. I cannot see the position variable set for videos in that section that I never actually started.
Author
Owner

@bbilly1 commented on GitHub (Jul 10, 2025):

Any request with a position, even a 0 (zero) position against the progress endpoint will put it into the continue watching section. The web interface starts sending progress requests after 10 seconds playback time.

There is some sanity check coming to deal with that in the API endpoint, to avoid cluttering that, for reference: https://github.com/tubearchivist/tubearchivist/issues/1009, the rest still stands, the progress endpoint is meant for regular updates during playback, the watched endpoint is for the watched state toggle in the interface.

<!-- gh-comment-id:3057610253 --> @bbilly1 commented on GitHub (Jul 10, 2025): Any request with a position, even a 0 (zero) position against the progress endpoint will put it into the continue watching section. The web interface starts sending progress requests after 10 seconds playback time. There is some sanity check coming to deal with that in the API endpoint, to avoid cluttering that, for reference: https://github.com/tubearchivist/tubearchivist/issues/1009, the rest still stands, the progress endpoint is meant for regular updates during playback, the watched endpoint is for the watched state toggle in the interface.
Author
Owner

@aomann commented on GitHub (Jul 10, 2025):

Hello, I find the proposition of @bbilly1 more elegant instead of synchronizing all videos periodically.

The only comment I have regarding the sanity check propose in : https://github.com/tubearchivist/tubearchivist/pull/926 is that it omit that someone could rewatch a video.

For example, auto delete is set after 2 days. I watch a video on day T. I rewatch the video on day T+1. The video will be deleted on D+2 and not on D+3 which, I argue, should be the case. I don’t think it’s an issue on TubeArchivist itself because the watch state would be set to false during the second playback (during progress request). However, when rewatching on Jellyfin thru this plugin, the watch state will not necessarily be set to false if no sync task occurs during playback.

<!-- gh-comment-id:3058170961 --> @aomann commented on GitHub (Jul 10, 2025): Hello, I find the proposition of @bbilly1 more elegant instead of synchronizing all videos periodically. The only comment I have regarding the sanity check propose in : https://github.com/tubearchivist/tubearchivist/pull/926 is that it omit that someone could rewatch a video. For example, auto delete is set after 2 days. I watch a video on day T. I rewatch the video on day T+1. The video will be deleted on D+2 and not on D+3 which, I argue, should be the case. I don’t think it’s an issue on TubeArchivist itself because the watch state would be set to false during the second playback (during progress request). However, when rewatching on Jellyfin thru this plugin, the watch state will not necessarily be set to false if no sync task occurs during playback.
Author
Owner

@DarkFighterLuke commented on GitHub (Jul 10, 2025):

I am not understanding what the problem is and what is the cause according to you, can you please point me that out?

<!-- gh-comment-id:3058580103 --> @DarkFighterLuke commented on GitHub (Jul 10, 2025): I am not understanding what the problem is and what is the cause according to you, can you please point me that out?
Author
Owner

@Jurrer commented on GitHub (Aug 11, 2025):

@aomann The PR #926 was made because this plugin periodically synced all videos and stamped watched date to ALL videos.
I don't think there is anything to add to this logic in TA.
I agree with you.
During re-watch, a new watched date should be stamped.
If the video is re-watched and still has <90 progress, the status should be changed to not watched.

Both things should be implemented on plugin side, but it's not related to this issue. Let's open a new feature request to not clutter this thread. I'll check it in free time :)

<!-- gh-comment-id:3173556475 --> @Jurrer commented on GitHub (Aug 11, 2025): @aomann The PR #926 was made because this plugin periodically synced all videos and stamped watched date to ALL videos. I don't think there is anything to add to this logic in TA. I agree with you. During re-watch, a new watched date should be stamped. If the video is re-watched and still has <90 progress, the status should be changed to not watched. Both things should be implemented on plugin side, but it's not related to this issue. Let's open a new feature request to not clutter this thread. I'll check it in free time :)
Author
Owner

@Jurrer commented on GitHub (Aug 11, 2025):

I've just released the version 1.3.7, please try with that and let me know if this bug disappeared.

Fix worked for me btw. I had to delete whole plugin before update

<!-- gh-comment-id:3173561980 --> @Jurrer commented on GitHub (Aug 11, 2025): > I've just released the version 1.3.7, please try with that and let me know if this bug disappeared. Fix worked for me btw. I had to delete whole plugin before update
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tubearchivist/archived-tubearchivist-jf-plugin#26
No description provided.