po5 / mpv_sponsorblock

mpv script to skip sponsored segments of YouTube videos
GNU General Public License v3.0
550 stars 29 forks source link

Add auto_update_interval #22

Closed Foldex closed 3 years ago

kiwec commented 4 years ago

@Foldex on first run of mpv_sponsorblock, without having the database downloaded, an error is thrown:

[sponsorblock] 
[sponsorblock] stack traceback:
[sponsorblock]  /home/kiwec/.config/mpv/scripts/sponsorblock.lua:436: in function 'handler'
[sponsorblock]  mp.defaults:486: in function 'call_event_handlers'
[sponsorblock]  mp.defaults:520: in function 'dispatch_events'
[sponsorblock]  mp.defaults:479: in function <mp.defaults:478>
[sponsorblock]  [C]: in ?
[sponsorblock]  [C]: in ?
[sponsorblock] Lua error: /home/kiwec/.config/mpv/scripts/sponsorblock.lua:436: attempt to index local 'db_info' (a nil value)

The update interval logic should be ignored if the database has not been downloaded.

Foldex commented 4 years ago

Grrr, editor tab formatting wasn't behaving. Should be fixed.

po5 commented 3 years ago

Thanks for the PR, this had become increasingly more important as the sponsorblock database grew in size. The next step is implementing partial db downloads, either through sponsorblock-dbdiff or waiting for Ajay to do it on his end.