-
-
Notifications
You must be signed in to change notification settings - Fork 75
Automate more things #141
Description
I started working on this a while ago, but I feel like there might be some traps on the way that I don't want to step in so I thought I'd ask for some input.
Currently the typical workflow has you pause playback, add one or more cards, then press one or more keys to add media to the card(s). There are two things that could make this easier:
- Automatically pause playback when focusing another window
- Automatically add media to the cards created since the last pause
You can do 1 in your mpv.conf already if you want to, but I think it could be handy to have it as an option, especially if 2 is also implemented. I've tried this locally already and it seems to work as expected.
2 feels like it should be straightforward, but maybe I'm missing something. What I'm thinking is that you can just use the same function that pauses to query Anki for new cards added today, and use the function that resumes playback to calculate the difference and add media to the cards that have been created since pause. It should probably also
- be off by default since this is a new workflow with potential to write to the wrong cards if you're unaware you're using it
- have a (by default at least) pretty short window for how old the cards can be
- save the playback position at pause and check that you haven't skipped before resuming
- maybe check for something more advanced like if the the context matches the subtitle (basically Automatically add the correct image and audio even if the subtitles have advanced past while playing #118)
Is there anything else that I'm missing? Any other input?