Skip to content

Refactor: Player, Generator and ViewModel#2764

Merged
fire-light42 merged 3 commits intomasterfrom
fixgeneratorplayer
May 6, 2026
Merged

Refactor: Player, Generator and ViewModel#2764
fire-light42 merged 3 commits intomasterfrom
fixgeneratorplayer

Conversation

@fire-light42
Copy link
Copy Markdown
Collaborator

Closes #2761 #2750 #2751
Fixes #2746

This pull requests refactors the following:

  1. GeneratorPlayer to use the ViewModel state
    • Then the GeneratorPlayer does not have to worry about outdated state.
  2. ViewModel to use an immutable state
    • No concurrency issues, and should be more efficient.
  3. IGenerator to be stateless
    • The old behavior stored the index of what episode was being played inside the Generator, this was a bad design decision because we accessed it in a random order.

Fixes:

  1. "No Links Found" due to a mismatch of state between model and view
  2. Possible race conditions, however there is still some in RepoLinkGenerator
  3. View history for links not visited from the main player, e.g. external videos
  4. Some UI issues that used invalid state

@fire-light42
Copy link
Copy Markdown
Collaborator Author

@Luna712 you might want to test this pull request, it should solve most of your issues ❤️

Copy link
Copy Markdown
Contributor

@Luna712 Luna712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Seems to work. Thank you for doing this!

@fire-light42
Copy link
Copy Markdown
Collaborator Author

Fixed concurrency issues in RepoLinkGenerator and currentQualityProfile cache for better UX.

@fire-light42 fire-light42 merged commit a45f1d9 into master May 6, 2026
2 checks passed
@Luna712
Copy link
Copy Markdown
Contributor

Luna712 commented May 6, 2026

@fire-light42 I think I found a major issue that seems to be related to this. It plays the wrong episode sometimes. The player said it was playing S0E1 even though it was like S20E36 or something. It happened after returning to the app after a couple hours and the player reloaded (probably process death) but previously when the player reloaded it would just load all links again on the right episode. I don't know how to reproduce exactly, but to me that indicates some potential major issue with this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Links Found bug in DownloadedPlayerActivity

2 participants