mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-03-13 01:17:29 +08:00
feat: lower d1 saveCurrentPlayProgress frequency
This commit is contained in:
@@ -1205,7 +1205,10 @@ function PlayPageClient() {
|
|||||||
|
|
||||||
artPlayerRef.current.on('video:timeupdate', () => {
|
artPlayerRef.current.on('video:timeupdate', () => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (now - lastSaveTimeRef.current > 5000) {
|
if (
|
||||||
|
now - lastSaveTimeRef.current >
|
||||||
|
(process.env.NEXT_PUBLIC_STORAGE_TYPE === 'd1' ? 10000 : 5000)
|
||||||
|
) {
|
||||||
saveCurrentPlayProgress();
|
saveCurrentPlayProgress();
|
||||||
lastSaveTimeRef.current = now;
|
lastSaveTimeRef.current = now;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user