Skip to content

Conversation

@cj12312021
Copy link
Collaborator

Summary

  • Remove play duration tracking: I think it is best due to how inaccurate the estimate would be for non-linear playback. Inaccurate estimates could skew the analytics that users may be running on that data.
  • Combine database transactions: Resume time and view count updates now happen in a single transaction instead of two separate ones. This provides atomicity (if one fails, both roll back) and better performance (one DB round-trip instead of two).

- Remove play duration tracking: DLNA clients buffer aggressively and
  don't report playback position, making duration estimates unreliable.
  Saving inaccurate values corrupts analytics.

- Combine database transactions: Resume time and view count updates
  now happen in a single transaction for atomicity and performance.

- Keep resume time tracking: While imprecise, it provides useful
  "continue watching" hints. The cost of being wrong is low (user
  just seeks).
@cj12312021 cj12312021 added the improvement Something needed tweaking. label Jan 7, 2026
@feederbox826
Copy link
Collaborator

Is there any point to the play duration check? Since DLNA buffers so aggressively would it be possible to not trigger it?

@cj12312021
Copy link
Collaborator Author

cj12312021 commented Jan 8, 2026

Is there any point to the play duration check? Since DLNA buffers so aggressively would it be possible to not trigger it?

The goal of this PR is to remove the play duration check/tracking from the DLNA service.

@cj12312021
Copy link
Collaborator Author

The goal of that code was to prevent writes for sessions that lasted less than 5 seconds. The 5-second time should be more reliable to calculate, but I see the argument for removing it as well. I can push that change later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Something needed tweaking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants