mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-11-30 17:51:14 +00:00
fix(playback): playback reporting (#2286)
Due to throttling, status events were being skipped. Fixes #2285 Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
parent
40b3fd2797
commit
9ead421b25
@ -19,7 +19,7 @@ import { getItemsApi } from '@jellyfin/sdk/lib/utils/api/items-api';
|
||||
import { getMediaInfoApi } from '@jellyfin/sdk/lib/utils/api/media-info-api';
|
||||
import { getPlaystateApi } from '@jellyfin/sdk/lib/utils/api/playstate-api';
|
||||
import { getTvShowsApi } from '@jellyfin/sdk/lib/utils/api/tv-shows-api';
|
||||
import { useEventListener, useThrottleFn } from '@vueuse/core';
|
||||
import { useEventListener, watchThrottled } from '@vueuse/core';
|
||||
import { shuffle } from 'lodash-es';
|
||||
import { v4 } from 'uuid';
|
||||
import { watch, watchEffect } from 'vue';
|
||||
@ -471,8 +471,6 @@ class PlaybackManagerStore extends CommonStore<PlaybackManagerState> {
|
||||
}
|
||||
};
|
||||
|
||||
private readonly _reportPlaybackProgressThrottled = useThrottleFn(this._reportPlaybackProgress, this._progressReportInterval);
|
||||
|
||||
/**
|
||||
* Report playback stopped to the server. Used by the "Now playing" statistics in other clients.
|
||||
*/
|
||||
@ -1246,7 +1244,12 @@ class PlaybackManagerStore extends CommonStore<PlaybackManagerState> {
|
||||
}
|
||||
});
|
||||
|
||||
watch(() => this.currentTime, this._reportPlaybackProgressThrottled);
|
||||
watchThrottled(
|
||||
() => this.currentTime,
|
||||
this._reportPlaybackProgress,
|
||||
{ throttle: this._progressReportInterval }
|
||||
);
|
||||
watch(() => this.status, this._reportPlaybackProgress);
|
||||
|
||||
/**
|
||||
* Report playback stop when closing the tab
|
||||
|
Loading…
Reference in New Issue
Block a user