When my video mpv stops unexpectedly (for example because of Windows Update or when mpv is killed by another program), open videos are left without an up to date history.
I tried to implement this with mp.add_periodic_timer(1, ..., but it broke resuming via hotkey, because read_log_table() is called and the newly written time is used instead of the time that was in the file when the script was loaded.
To make this work, I need to remove list_contents = read_log_table() from history_resume(), and I had to write the log file directly instead of calling history_save(). But if we cache the log file, I suspect other functionality will break.