Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import com.lagradost.cloudstream3.ui.result.ResultFragment
import com.lagradost.cloudstream3.ui.result.ResultViewModel2
import com.lagradost.cloudstream3.ui.result.setLinearListLayout
import com.lagradost.cloudstream3.ui.result.SyncViewModel
import com.lagradost.cloudstream3.ui.result.VideoWatchState
import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
import com.lagradost.cloudstream3.ui.settings.Globals.PHONE
Expand All @@ -102,6 +103,7 @@ import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.Coroutines.runOnMainThread
import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.DataStoreHelper.getViewPos
import com.lagradost.cloudstream3.utils.DataStoreHelper.setVideoWatchState
import com.lagradost.cloudstream3.utils.EpisodeSkip
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType
Expand Down Expand Up @@ -1607,6 +1609,13 @@ class GeneratorPlayer : FullScreenPlayer() {

viewModel.getId()?.let {
DataStoreHelper.setViewPos(it, position, duration)
when(val meta = currentMeta){
is ResultEpisode->{
if(meta.videoWatchState == VideoWatchState.Watched){
setVideoWatchState(it, VideoWatchState.None)
}
}
}
}

val percentage = position * 100L / duration
Expand Down Expand Up @@ -1647,6 +1656,13 @@ class GeneratorPlayer : FullScreenPlayer() {
)
}
}
if(nextEp){
when (val meta = currentMeta) {
is ResultEpisode -> {
setVideoWatchState(meta.id, 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.

What issue is this supposed to solve? setVideoWatchState is supposed to be for manual progress manipulation to override "DurPos". But if it is not set then DurPos should be used. Make 95% the same as "watched" if you want the ic_baseline_check_24 behavior instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is a good question, and yes that would make sense with our current model. So no auto set, but auto remove is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I will set check above 95 and auto remove watched .

}
}
}
}

var isOpVisible = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ class EpisodeAdapter(
if (card.videoWatchState == VideoWatchState.Watched) {
// This cannot be done in getDisplayPosition() as when you have not watched something
// the duration and position is 0
episodeProgress.max = 1
episodeProgress.progress = 1
episodeProgress.isVisible = true
// episodeProgress.max = 1
// episodeProgress.progress = 1
episodePlayIcon.setImageResource(R.drawable.ic_baseline_check_24)
episodeProgress.isVisible = false
} else {
episodePlayIcon.setImageResource(R.drawable.netflix_play)
val displayPos = card.getDisplayPosition()
episodeProgress.max = (card.duration / 1000).toInt()
episodeProgress.progress = (displayPos / 1000).toInt()
Expand Down