Added checks to history

This commit is contained in:
WardPearce
2026-02-24 13:36:35 +13:00
parent 77945c36a7
commit 3cb59499fb
3 changed files with 16 additions and 5 deletions
@@ -30,6 +30,7 @@
playerState,
playertheatreModeIsActive,
playerYouTubeJsFallback,
rawMasterKeyStore,
sponsorBlockCategoriesStore,
sponsorBlockDisplayToastStore,
sponsorBlockStore,
@@ -751,8 +752,10 @@
// Continue regardless of error
}
const watchHistory = await getVideoWatchHistory(data.video.videoId);
if (watchHistory && watchHistory.progress > toSetTime) toSetTime = watchHistory.progress;
if (isOwnBackend()?.internalAuth && get(rawMasterKeyStore)) {
const watchHistory = await getVideoWatchHistory(data.video.videoId);
if (watchHistory && watchHistory.progress > toSetTime) toSetTime = watchHistory.progress;
}
return toSetTime;
}
@@ -774,7 +777,9 @@
}
}
updateWatchHistory(data.video.videoId, playerElement.currentTime);
if (isOwnBackend()?.internalAuth && get(rawMasterKeyStore)) {
updateWatchHistory(data.video.videoId, playerElement.currentTime);
}
}
onDestroy(async () => {
@@ -22,12 +22,14 @@
isAndroidTvStore,
playerSavePlaybackPositionStore,
playerState,
rawMasterKeyStore,
syncPartyConnectionsStore,
syncPartyPeerStore
} from '$lib/store';
import { relativeTimestamp } from '$lib/time';
import { queueGetWatchHistory } from '$lib/api/backend/historyPool';
import { page } from '$app/state';
import { isOwnBackend } from '$lib/shared';
interface Props {
video: VideoBase | Video | Notification | PlaylistPageVideo | VideoWatchHistory;
@@ -88,7 +90,11 @@
checkIfWatched();
if (!page.url.pathname.endsWith('/history'))
if (
!page.url.pathname.endsWith('/history') &&
isOwnBackend()?.internalAuth &&
get(rawMasterKeyStore)
)
queueGetWatchHistory(video.videoId).then((watchHistory) => {
if (watchHistory) {
progress = watchHistory.progress.toString();
+1 -1
View File
@@ -29,7 +29,7 @@ export function getPages(): Pages {
}
];
if (isOwnBackend() && get(rawMasterKeyStore))
if (isOwnBackend()?.internalAuth && get(rawMasterKeyStore))
pages.push({
icon: 'history',
href: '/history',