Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: Marking an item with progress as watched does not update LastPlayedDate #8492

Closed
1 task done
Gylesie opened this issue Oct 4, 2022 · 5 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@Gylesie
Copy link

Gylesie commented Oct 4, 2022

Please describe your bug

When marking an item which has progress associated with it as watched without providing datePlayed query parameter, Jellyfin does not update LastPlayedDate saved in Jellyfin's database.

  1. Watch an item and stop the playback arbitrarily in such a way that it is not automatically marked as watched by Jellyfin
  2. Wait few minutes
  3. Send a Jellyfin API request to mark the item as watched without the datePlayed parameter
  4. Check LastPlayedDate
  5. The time does not correspond to the time at which the request in step 3 was sent.

On the other hand, it seems that marking an item in the same way which does not have progress updates the LastPlayedDate.

Relevant issue: jellyfin/jellyfin-plugin-trakt#168

Jellyfin Version

Other

if other:

10.8.5

Environment

- OS: Debian
- Virtualization: Docker
- Clients: API
- Browser: -
- FFmpeg Version: 5.1.1-Jellyfin
- Playback Method: -
- Hardware Acceleration: -
- Plugins: Trakt
- Reverse Proxy: nginx
- Base URL: none
- Networking: Bridge
- Storage: local

Jellyfin logs

No response

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Gylesie Gylesie added the bug Something isn't working label Oct 4, 2022
@Gylesie
Copy link
Author

Gylesie commented Oct 9, 2022

I have traced it back to this line:

data.LastPlayedDate = datePlayed ?? data.LastPlayedDate ?? DateTime.UtcNow;

It seems that it was intended that way to work. Can I call for a discussion about this behaviour? From my perspective and use-case it would make sense to not fallback to media's lastPlayedDate at all when marking an item as watched, but rather fallback to current time only.

@cvium
Copy link
Member

cvium commented Oct 9, 2022

I have traced it back to this line:

data.LastPlayedDate = datePlayed ?? data.LastPlayedDate ?? DateTime.UtcNow;

It seems that it was intended that way to work. Can I call for a discussion about this behaviour? From my perspective and use-case it would make sense to not fallback to media's lastPlayedDate at all when marking an item as watched, but rather fallback to current time only.

The decision to make it behave this way predates the Jellyfin fork. I agree with you to an extent. If a video contains 20+ minutes of rolling credits, it may not be marked as played. Marking it at a later point, it would make sense to keep lastplayeddate. I don't think there's one specific fallback that fits all.

@jellyfin-bot jellyfin-bot added this to Needs triage in Issue Triage for Main Repo Oct 9, 2022
@Gylesie
Copy link
Author

Gylesie commented Oct 9, 2022

That's interesting. I am actually writing it because of the same problem of long rolling credits. I have encouraged a problem where in the end the progress was overwritten because of lastPlayedDate when importing from Trakt (the linked issue). We could argue that it should be fixed on Trakt plugin's side of things, but I agree with @Shadowghost on this one because of the following reasons:

  1. Consistency
    Currently, when a user is using a native Jellyfin client (mainly speaking about WebUI here) the request that is being sent to the server includes datePlayed which is the current time. There is no other way in the UI to mark an item as watched without the native client implicitly sending the datePlayed parameter.

  2. Intuition (subjective-ish)
    Now I can speak only from my experience. Wherever I clicked the mark as watched button, I always subconsciously thought that the item was being marked (as of right now). This was maybe because of other services that behaved like this by default. Only the help of logs and Trakt plugin contributor helped me discover that it actually behaves like it does right now.

However I also definitely see a use case where lastPlayedDate user would want it to stay the same as you suggested. Based on my opinion, I would keep the current time (DateTime.UtcNow) as the only fallback and I would add to the native WebUI the capability for the user to change the datePlayed parameter which the client sends to the server.

@Gylesie
Copy link
Author

Gylesie commented Oct 9, 2022

Marking it at a later point, it would make sense to keep lastplayeddate

I have just noticed that LastPlayedDate does not equal to the date at which the playback was stopped. It equals to the date at which the last playback started. E.g. starting playback at 16:00, watching it half-way through, stopping the playback at 16:30 and then marking it as watched would result with a media that has LastPlayedDate equal to 16:00.

@cvium
Copy link
Member

cvium commented Oct 10, 2022

Fixed by #8523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants