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

Set play button to first unwatched Episode on TV #996

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

KingLucius
Copy link
Contributor

Fixes #755

val first = episodes.value.firstOrNull()
if (first != null) {

val lastWatchedIndex = episodes.value.indexOfLast { ep -> ep.videoWatchState == VideoWatchState.Watched }
Copy link
Collaborator

Choose a reason for hiding this comment

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

no? this will get you a wrong result as watchstate is seperate from watched. use getWatchProgress, getDisplayPosition or getRealPosition

Copy link
Collaborator

Choose a reason for hiding this comment

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

watch state if smth that you manually toggle

Copy link
Collaborator

Choose a reason for hiding this comment

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

or did you mean watch state? because you need to specify that if that is the case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to get the last index of the "marked as watched" episode, then i return rhe next one so this will be the first unwatched

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ep.videoWatchState become VideoWatchState.Watched after actual watching or use "Mark as watched"
both works

@fire-light42 fire-light42 merged commit fb89fd6 into recloudstream:master Mar 25, 2024
2 checks passed
@KingLucius KingLucius deleted the playFirstUnwatched branch March 25, 2024 01:13
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.

Play button doesn't currently show the next unwatched episode to play
2 participants