Conversation
Created a new signal called "finish" which is called whenever a player is closed (tested with mpris) whenever an update is due. This means if an episode is just completed and it is needed to be updated, this signal is called when that player is closed. Intended to be used as a "episode completed" indicator for various uses like autoplaying next episode
|
bump :( |
|
Sorry I could just review just this now. I like the idea as I also like watching several episodes on a row. But wouldn't it better to use the playlist feature of the player for this? Like, feeding an episode list to the player? mpv would, in my experience, load them to a playlist and others I assume would do the same. |
|
For the playlist approach, we have #484 already that goes into that direction. However, I believe OP specifically wants to use ani-cli, from which I assume they want the next episode to be startedy dynamically because it does not exist on the file system. |
| if self.last_state == utils.Tracker.PLAYING and not self.last_updated: | ||
| self.msg.info('Player was closed before update.') | ||
| # Video was playing and timer reached zero but player just closed | ||
| elif self.last_state == utils.Tracker.PLAYING and self.last_updated and self.last_show_tuple: |
There was a problem hiding this comment.
Wouldn't this also trigger when the player was simply paused after the timer has already reached zero (e.g. with the mpris tracker).
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.