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

Fix marked played reset position #7168

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

flofriday
Copy link
Contributor

Description

Closes: #7144

Remove duplicated marked as played implementation

There were two implementations, one for single items and one for
multiple items. Now we always use the code for multiple items.

I also made API a lot more simpler and the PodDBAdapter now decides if
a the playback position should be reset. Which it will now do if the
we set it to PLAYED but not for NEW or UNPLAYED.

Checklist

Question for the Reviewer

There is currently a bug in this Implementation. If an episode is currently playing the playback position will be reset but since the player is still running it will reset the position within the next second.
If the playback is currently stopped the playback will be reset but reset to the previous position as soon as the user plays the episode again.

What is the best way to solve that? Cause checking for the currenlty playing item it feels wrong to do in PodDBAdapter and also I get a circular dependency warning if I try to include the Playbackservice.

One of the methods arguments was always true so there is no reason to
keep the parameter there.
There were two implementations, one for single items and one for
multiple items. Now we always use the code for multiple items.

I also made API a lot more simpler and the PodDBAdapter now decides if
a the playback position should be reset. Which it will now do if the
we set it to PLAYED but not for NEW or UNPLAYED. Also it will not reset
an episode that is currently playing.
@ByteHamster
Copy link
Member

Doesn't the implementation here break the "smart mark as played" feature? I would still keep the overall behavior of the caller deciding whether to reset the position or not.

If an episode is currently playing the playback position will be reset but since the player is still running it will reset the position within the next second. What is the best way to solve that?

I would say like in FeedItemMenuHandler. That class should not do any logic (calling the database etc) and just call the corresponding multi-select method with a Collection.singletonList

@flofriday
Copy link
Contributor Author

The smart marked as played code was wrong in my opinion. But reading over the code again maybe it is intended if the episode is autoskiped to not reset the playback position. I will revert on that one, however it didn't break smart skip it was only more agressive in resetting the playback position.

@flofriday
Copy link
Contributor Author

I would say like in FeedItemMenuHandler. That class should not do any logic (calling the database etc) and just call the corresponding multi-select method with a Collection.singletonList

I guess I don't quite get what you mean by that. Do you mean that the caller of the DBWriter methods should find out the playing item and address them differently?

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.

Progress bar not reset when marking episodes as played via multi-select
2 participants