[GH-ISSUE #69] [Bug]: Playback Syncing #47

Closed
opened 2026-03-23 20:35:22 +00:00 by mirror · 17 comments
Owner

Originally created by @bashman83 on GitHub (Oct 28, 2025).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/69

Originally assigned to: @DarkFighterLuke on GitHub.

I've read the documentation

  • I'm running the latest version of tubearchivist-jf-plugin.
  • I'm running the latest version of TubeArchivist.
  • I have read the how to open an issue guide, particularly the bug report section.
  • I have searched for both closed and open already existing issues about the problem I am reporting.

Operating System

Synology

Your Bug Report

It seems on the new 1.4.2.0 plug in is not syncing the plackback details again.
It had been working perfectly on 1.4.0.0
Not sure if this error is the same as the previous errors the plugin had or if this is something new.
I've had Jellyfin update, to 10.11.1, the TA-JF plugin updated to 1.4.2.0
I had to fill out the settings in the plugin. I've tried the username in Jellyfin & also the Jellyfin user ID, from inside the Jellyfin settings, however there hasn't been any luck yet.

Relevant Jellyfin log output

I believe this is the line in the log:
Jellyfin.Plugin.TubeArchivistMetadata.Plugin: OnWatchedStatusChange callback called without user id for item

Anything else?

No response

Originally created by @bashman83 on GitHub (Oct 28, 2025). Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf-plugin/issues/69 Originally assigned to: @DarkFighterLuke on GitHub. ### I've read the documentation - [x] I'm running the latest version of tubearchivist-jf-plugin. - [x] I'm running the latest version of TubeArchivist. - [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. - [x] I have searched for both closed and open already existing issues about the problem I am reporting. ### Operating System Synology ### Your Bug Report It seems on the new 1.4.2.0 plug in is not syncing the plackback details again. It had been working perfectly on 1.4.0.0 Not sure if this error is the same as the previous errors the plugin had or if this is something new. I've had Jellyfin update, to 10.11.1, the TA-JF plugin updated to 1.4.2.0 I had to fill out the settings in the plugin. I've tried the username in Jellyfin & also the Jellyfin user ID, from inside the Jellyfin settings, however there hasn't been any luck yet. ### Relevant Jellyfin log output ```shell I believe this is the line in the log: Jellyfin.Plugin.TubeArchivistMetadata.Plugin: OnWatchedStatusChange callback called without user id for item ``` ### Anything else? _No response_
mirror 2026-03-23 20:35:22 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@bashman83 commented on GitHub (Oct 28, 2025):

I've done a little playing around. The playback sync is correct, IE as the episode is being played, it's all correct. However, it seems when they are marked as played, without being played, this doesn't translate back to TA. Also, when there is a JF reboot, the played marker in TA, is also removed.

<!-- gh-comment-id:3458213121 --> @bashman83 commented on GitHub (Oct 28, 2025): I've done a little playing around. The playback sync is correct, IE as the episode is being played, it's all correct. However, it seems when they are marked as played, without being played, this doesn't translate back to TA. Also, when there is a JF reboot, the played marker in TA, is also removed.
Author
Owner

@Jurrer commented on GitHub (Nov 9, 2025):

yes, seems like JF -> TA task is broken.
I just downgraded plugin and it seems to be broken starting 1.4.0.
On 1.3.7 it was 100% working, can't go back to it, because I upgraded to Jellyfin 10.11.

Looking at TA logs, it seems to be setting every video status to False, even the watched videos, example:

BXbW42uTKYo: change watched state to False
INFO: 172.18.0.15:0 - "POST /api/watched/ HTTP/1.0" 200 OK
INFO: 172.18.0.15:0 - "POST /api/video/BXbW42uTKYo/progress/ HTTP/1.0" 200 OK

Looking at the changes between 1.3.7 and 1.4.0, there were only minor changes to the JFToTubeArchivistProgressSyncTask.cs and TubeArchivistApi.cs

Don't see any big changes in logic,

link to diff between versions:
https://github.com/tubearchivist/tubearchivist-jf-plugin/compare/v1.3.7...v1.4.0#diff-6e12253dcd80b45f0c2996e0a8b1204bdfa9e24ab3a273f3c8287e7e8bf74965

Could it be related to changes in Jellyfin then?

<!-- gh-comment-id:3507221397 --> @Jurrer commented on GitHub (Nov 9, 2025): yes, seems like JF -> TA task is broken. I just downgraded plugin and it seems to be broken starting 1.4.0. On 1.3.7 it was 100% working, can't go back to it, because I upgraded to Jellyfin 10.11. Looking at TA logs, it seems to be setting every video status to False, even the watched videos, example: > BXbW42uTKYo: change watched state to False > INFO: 172.18.0.15:0 - "POST /api/watched/ HTTP/1.0" 200 OK > INFO: 172.18.0.15:0 - "POST /api/video/BXbW42uTKYo/progress/ HTTP/1.0" 200 OK Looking at the changes between 1.3.7 and 1.4.0, there were only minor changes to the `JFToTubeArchivistProgressSyncTask.cs` and `TubeArchivistApi.cs` Don't see any big changes in logic, link to diff between versions: https://github.com/tubearchivist/tubearchivist-jf-plugin/compare/v1.3.7...v1.4.0#diff-6e12253dcd80b45f0c2996e0a8b1204bdfa9e24ab3a273f3c8287e7e8bf74965 Could it be related to changes in Jellyfin then?
Author
Owner

@Jurrer commented on GitHub (Nov 9, 2025):

I see this commit that changed the isVideoPlayed variable that sets the watch status of the video.

Based on my logs, this line is always false.
var isVideoPlayed = video.IsPlayed(user, userItemData);

I think userItemData is reused after checking the channels loop, and not updated when used in videos loop.
var userItemData = _userDataManager.GetUserData(user, channel);

I'll try fixing that, and will do a PR if it works!!

<!-- gh-comment-id:3507254899 --> @Jurrer commented on GitHub (Nov 9, 2025): I see [this commit](https://github.com/Jurrer/tubearchivist-jf-plugin/commit/7e496643f8f235ebacb1ae078a6f2e5300f76e18) that changed the isVideoPlayed variable that sets the watch status of the video. Based on my logs, this line is always false. `var isVideoPlayed = video.IsPlayed(user, userItemData);` I think userItemData is reused after checking the channels loop, and not updated when used in videos loop. `var userItemData = _userDataManager.GetUserData(user, channel);` I'll try fixing that, and will do a PR if it works!!
Author
Owner

@Jurrer commented on GitHub (Nov 9, 2025):

On a side note, in 1.4.0 you could mark a video as watched and it would correctly send this info to TA. In 1.4.2 it does not work.
It correlates with these changes to OnWatchedStatusChange

Image
<!-- gh-comment-id:3507265416 --> @Jurrer commented on GitHub (Nov 9, 2025): On a side note, in 1.4.0 you could mark a video as watched and it would correctly send this info to TA. In 1.4.2 it does not work. It correlates with these changes to `OnWatchedStatusChange` <img width="1289" height="624" alt="Image" src="https://github.com/user-attachments/assets/a7615847-2636-4c96-9e8f-02ec15e35772" />
Author
Owner

@Jurrer commented on GitHub (Nov 9, 2025):

So I was right with this comment, tested the fix locally and prepared a PR
https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/71

I see this commit that changed the isVideoPlayed variable that sets the watch status of the video.

Based on my logs, this line is always false. var isVideoPlayed = video.IsPlayed(user, userItemData);

I think userItemData is reused after checking the channels loop, and not updated when used in videos loop. var userItemData = _userDataManager.GetUserData(user, channel);

I'll try fixing that, and will do a PR if it works!!

<!-- gh-comment-id:3507341748 --> @Jurrer commented on GitHub (Nov 9, 2025): So I was right with this comment, tested the fix locally and prepared a PR https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/71 > I see [this commit](https://github.com/Jurrer/tubearchivist-jf-plugin/commit/7e496643f8f235ebacb1ae078a6f2e5300f76e18) that changed the isVideoPlayed variable that sets the watch status of the video. > > Based on my logs, this line is always false. `var isVideoPlayed = video.IsPlayed(user, userItemData);` > > I think userItemData is reused after checking the channels loop, and not updated when used in videos loop. `var userItemData = _userDataManager.GetUserData(user, channel);` > > I'll try fixing that, and will do a PR if it works!!
Author
Owner

@Jurrer commented on GitHub (Nov 9, 2025):

I also fixed the syncing of watch status when you manually mark video as "watched" or when you watch whole video to the end. https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/73

This issue I mentioned above

On a side note, in 1.4.0 you could mark a video as watched and it would correctly send this info to TA. In 1.4.2 it does not work.
It correlates with these changes to OnWatchedStatusChange

<!-- gh-comment-id:3508954920 --> @Jurrer commented on GitHub (Nov 9, 2025): I also fixed the syncing of watch status when you manually mark video as "watched" or when you watch whole video to the end. https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/73 This issue I mentioned above > On a side note, in 1.4.0 you could mark a video as watched and it would correctly send this info to TA. In 1.4.2 it does not work. It correlates with these changes to OnWatchedStatusChange
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

@DarkFighterLuke could we merge these fixes?

<!-- gh-comment-id:3523503829 --> @Jurrer commented on GitHub (Nov 12, 2025): @DarkFighterLuke could we merge these fixes?
Author
Owner

@DarkFighterLuke commented on GitHub (Nov 12, 2025):

@Jurrer this PR #73 doesn't make sense. You're actually removing the check on the fact that the user who triggered the WatchedStatusChange event must be in the list configured in plugin settings...

About #72 I sincerely doubt about the need of checking the watched status of the video on TA, it was done has it's now since the old times, so the problem shouldn't be there, but maybe it is in the things you are proposing in #71.

<!-- gh-comment-id:3524069935 --> @DarkFighterLuke commented on GitHub (Nov 12, 2025): @Jurrer this PR #73 doesn't make sense. You're actually removing the check on the fact that the user who triggered the WatchedStatusChange event must be in the list configured in plugin settings... About #72 I sincerely doubt about the need of checking the watched status of the video on TA, it was done has it's now since the old times, so the problem shouldn't be there, but maybe it is in the things you are proposing in #71.
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

#73 The first check has wrong logic. We're just reporting error callback called without user id and exiting the loop.
The check is user != null. It should be user == null if I understand the error correctly.

You are checking the user who triggered WatchedStatusChange event later on in line 204

Image

<!-- gh-comment-id:3524099966 --> @Jurrer commented on GitHub (Nov 12, 2025): #73 The first check has wrong logic. We're just reporting error `callback called without user id` and exiting the loop. The check is `user != null`. It should be `user == null` if I understand the error correctly. You are checking the user who triggered WatchedStatusChange event later on in [line 204 ](https://github.com/tubearchivist/tubearchivist-jf-plugin/blob/v1.4.2/Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs#L204) <img width="1795" height="451" alt="Image" src="https://github.com/user-attachments/assets/64202b9b-de38-4774-a8dd-103b66e48b2e" />
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

Thanks for checking #72, I am using it in my server and can elaborate on why it is needed.

Regarding #71, it did fix the reported issue, I'm welcome too the feedback.

<!-- gh-comment-id:3524122081 --> @Jurrer commented on GitHub (Nov 12, 2025): Thanks for checking #72, I am using it in my server and can elaborate on why it is needed. Regarding #71, it did fix the reported issue, I'm welcome too the feedback.
Author
Owner

@DarkFighterLuke commented on GitHub (Nov 12, 2025):

I am very sorry about #73 , i misread the condition (i pointed to the identical check in the following if statement). Now it makes sense and i think to have identified another problem: GetJFUsernamesToArray() is wrong, JFUsernameFrom should be considered instead

<!-- gh-comment-id:3524136382 --> @DarkFighterLuke commented on GitHub (Nov 12, 2025): I am very sorry about #73 , i misread the condition (i pointed to the identical check in the following if statement). Now it makes sense and i think to have identified another problem: GetJFUsernamesToArray() is wrong, JFUsernameFrom should be considered instead
Author
Owner

@DarkFighterLuke commented on GitHub (Nov 12, 2025):

Thanks for checking #72, I am using it in my server and can elaborate on why it is needed.

Can you explain me your reasoning about the need of retrieving the video from TA?

<!-- gh-comment-id:3524141263 --> @DarkFighterLuke commented on GitHub (Nov 12, 2025): > Thanks for checking [#72](https://github.com/tubearchivist/tubearchivist-jf-plugin/pull/72), I am using it in my server and can elaborate on why it is needed. Can you explain me your reasoning about the need of retrieving the video from TA?
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

sure, #72 is needed because of how TubeArchivist is designed.
It has a very useful function that auto-deletes videos that were watched X days ago. It checks the last date video was watched.
This date is stamped every time we call /api/watched/{video_id} endpoint.

Now, when the JF->TA sync task is running each day, it is stamping the new date. Now TA thinks the videos were watched a day ago, and it will never delete them.

By retrieving video from TA, we're checking its watch state, and only reporting if it changed.

watched in TubeArchivist not watched in TubeArchivist
watched in Jellyfin Not syncing Syncing to TA
not watched in Jellyfin Syncing to TA Not syncing
<!-- gh-comment-id:3524222621 --> @Jurrer commented on GitHub (Nov 12, 2025): sure, #72 is needed because of how TubeArchivist is designed. It has a very useful function that auto-deletes videos that were watched X days ago. It checks the last date video was watched. This date is [stamped](https://github.com/Jurrer/tubearchivist/blob/21f0a09f5f9f94681d1a0a2c25c271f652a92161/backend/common/src/watched.py#L48) every time we call `/api/watched/{video_id}` [endpoint](https://github.com/Jurrer/tubearchivist/blob/21f0a09f5f9f94681d1a0a2c25c271f652a92161/backend/common/views.py#L149). Now, when the JF->TA sync task is running each day, it is stamping the new date. Now TA thinks the videos were watched a day ago, and it will never delete them. By retrieving video from TA, we're checking its watch state, and only reporting if it changed. | | watched in TubeArchivist | not watched in TubeArchivist | |-------------------------|---------------------------|------------------------------| | watched in Jellyfin | Not syncing | Syncing to TA | | not watched in Jellyfin | Syncing to TA | Not syncing |
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

i think to have identified another problem: GetJFUsernamesToArray() is wrong, JFUsernameFrom should be considered instead

Ahhh you're right. The naming is so similar.

<!-- gh-comment-id:3524237142 --> @Jurrer commented on GitHub (Nov 12, 2025): > i think to have identified another problem: GetJFUsernamesToArray() is wrong, JFUsernameFrom should be considered instead Ahhh you're right. The naming is so similar.
Author
Owner

@Jurrer commented on GitHub (Nov 12, 2025):

@DarkFighterLuke I'll fix the JFUsernameFrom naming in #73

I think we can also check the collection name before syncing OnWatchedStatusChange.
Now it is only checked before reporting the error.

I'll add to L204 string.Equals(topParent?.Name, Instance?.Configuration.CollectionTitle, StringComparison.OrdinalIgnoreCase)

I'll test that rn

<!-- gh-comment-id:3524243418 --> @Jurrer commented on GitHub (Nov 12, 2025): @DarkFighterLuke I'll fix the JFUsernameFrom naming in #73 I think we can also check the collection name before syncing OnWatchedStatusChange. Now it is only checked before reporting the error. I'll add to [L204](https://github.com/tubearchivist/tubearchivist-jf-plugin/blob/v1.4.2/Jellyfin.Plugin.TubeArchivistMetadata/Plugin.cs#L204) `string.Equals(topParent?.Name, Instance?.Configuration.CollectionTitle, StringComparison.OrdinalIgnoreCase)` I'll test that rn
Author
Owner

@DarkFighterLuke commented on GitHub (Nov 13, 2025):

Thanks for the explanation, I don't use those features of TubeArchivist and so I didn't know about this mechanism.

Everything holds now, I'll make a test and eventually merge your PRs.

Thanks for your contribution!

<!-- gh-comment-id:3529263756 --> @DarkFighterLuke commented on GitHub (Nov 13, 2025): Thanks for the explanation, I don't use those features of TubeArchivist and so I didn't know about this mechanism. Everything holds now, I'll make a test and eventually merge your PRs. Thanks for your contribution!
Author
Owner

@DarkFighterLuke commented on GitHub (Nov 13, 2025):

#71 #72 and #73 merged, thanks for your contribution @Jurrer !

<!-- gh-comment-id:3529405690 --> @DarkFighterLuke commented on GitHub (Nov 13, 2025): #71 #72 and #73 merged, thanks for your contribution @Jurrer !
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#47
No description provided.