feat: autoplay next episode support #779
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add new feature to autoplay next episode.
Testing and working for MPRIS and lsof. I couldn't get inotify based tracker to work at all, so i couldnt test that.
Inspiration
I've always wanted to use trackma to be my only anime watching app (as I download almost all of my anime using ani-cli, but also have an ani-cli hook in trackma, so I never really have a reason to not use it). But my only pain point is that it does not autoplay next episode, which is not helpful for "binging".
Of course I can use autoload.lua script for mpv, but I wanted a feature in trackma itself.
Working
I added a new signal called "finish". It is triggered whenever a player is closed after successfully watching an episode, i.e. when the player is open for atleast "tracker_update_wait_s" seconds.
Then I've added a new option called "autoplay_next" (defaults to false), which can be toggled at runtime.
The engine reacts to this signal, and plays the episode + 1 after checking runtime autoplay_next
Also added hook support for this finish signal.
TODO
The autoplay toggle is not yet ready for qt, gtk and curses interfaces. It is currently only available for the cli interface.
I prefer to have something like a switch in the interfaces below the play button (in the home page) to toggle autoplay on and off.
I do not know how to do this in the interfaces, I will need to look that up. In the meantime, if anyone is willing to help, it would be great.
Please let me know if i need to change anything in the code, or if you have any suggestions.