feat: add disable save watch history setting

This commit is contained in:
Kentai Radiquum 2025-04-11 21:15:49 +05:00
parent fd7638121c
commit 59419d4ad4
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
2 changed files with 22 additions and 1 deletions

View file

@ -41,6 +41,7 @@ import HlsVideo from "hls-video-element/react";
import VideoJS from "videojs-video-element/react";
import { ENDPOINTS } from "#/api/config";
import { saveAnonEpisodeWatched } from "./ReleasePlayer";
import { usePreferencesStore } from "#/store/preferences";
export const ReleasePlayerCustom = (props: {
id: number;
@ -72,6 +73,8 @@ export const ReleasePlayerCustom = (props: {
const [playbackRate, setPlaybackRate] = useState(1);
const [isErrorDetailsOpen, setIsErrorDetailsOpen] = useState(false);
const preferenceStore = usePreferencesStore()
useEffect(() => {
const __getInfo = async () => {
if (source.selected.name == "Kodik") {
@ -142,7 +145,7 @@ export const ReleasePlayerCustom = (props: {
}, []);
function saveEpisodeToHistory() {
if (episode.selected && !episode.selected.is_watched) {
if (preferenceStore.flags.saveWatchHistory && episode.selected && !episode.selected.is_watched) {
const objectToReplace = episode.available.find(
(arrayItem: Episode) => arrayItem.position === episode.selected.position
);