diff --git a/materialious/src/lib/components/player/Player.svelte b/materialious/src/lib/components/player/Player.svelte index ef786363..3d1c802e 100644 --- a/materialious/src/lib/components/player/Player.svelte +++ b/materialious/src/lib/components/player/Player.svelte @@ -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 () => { diff --git a/materialious/src/lib/components/thumbnail/VideoThumbnail.svelte b/materialious/src/lib/components/thumbnail/VideoThumbnail.svelte index cbd4ed6f..9383d251 100644 --- a/materialious/src/lib/components/thumbnail/VideoThumbnail.svelte +++ b/materialious/src/lib/components/thumbnail/VideoThumbnail.svelte @@ -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(); diff --git a/materialious/src/lib/navPages.ts b/materialious/src/lib/navPages.ts index 5a6a2367..61262adc 100644 --- a/materialious/src/lib/navPages.ts +++ b/materialious/src/lib/navPages.ts @@ -29,7 +29,7 @@ export function getPages(): Pages { } ]; - if (isOwnBackend() && get(rawMasterKeyStore)) + if (isOwnBackend()?.internalAuth && get(rawMasterKeyStore)) pages.push({ icon: 'history', href: '/history',