mirror of
https://github.com/TeamPiped/Piped
synced 2025-09-06 13:31:23 +02:00

This commit introduces a new member to VideoPlayer, initialSeekComplete. The boolean is set to true after the timestamp has been set on videoEl from the query or IDB. If there's no existing timestamp its set to true immediately. Change updateProgressDatabase() to update watch_history when initialSeekComplete is true. This fixes a race condition where updateProgressDatabase() would run before the saved time could be loaded. Since the initial timestamp on the video element was 0 the saved time would be forgotten.