mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-15 07:26:02 +00:00
fix: restore missing imports and fix type errors in MAL services
This commit is contained in:
parent
6e8b336e54
commit
bb1b267cfa
4 changed files with 15 additions and 6 deletions
|
|
@ -251,7 +251,8 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
currentMalId,
|
||||
currentDayIndex,
|
||||
currentTmdbId,
|
||||
isInPictureInPicture || isPiPTransitionPending
|
||||
isInPictureInPicture || isPiPTransitionPending,
|
||||
metadata?.name
|
||||
);
|
||||
|
||||
const gestureControls = usePlayerGestureControls({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import React, { useEffect, useRef, useState, useCallback, useMemo } from 'react';
|
||||
import { View, StatusBar, StyleSheet, Animated, Dimensions, ActivityIndicator } from 'react-native';
|
||||
import { useNavigation, useRoute } from '@react-navigation/native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
|
@ -271,7 +271,9 @@ const KSPlayerCore: React.FC = () => {
|
|||
releaseDate,
|
||||
currentMalId,
|
||||
currentDayIndex,
|
||||
currentTmdbId
|
||||
currentTmdbId,
|
||||
false, // KSPlayer doesn't support PiP yet
|
||||
metadata?.name
|
||||
);
|
||||
|
||||
// Gestures
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ export const useWatchProgress = (
|
|||
malId?: number,
|
||||
dayIndex?: number,
|
||||
tmdbId?: number,
|
||||
isInPictureInPicture: boolean = false
|
||||
isInPictureInPicture: boolean = false,
|
||||
title?: string
|
||||
) => {
|
||||
const [resumePosition, setResumePosition] = useState<number | null>(null);
|
||||
const [savedDuration, setSavedDuration] = useState<number | null>(null);
|
||||
|
|
@ -46,6 +47,7 @@ export const useWatchProgress = (
|
|||
const dayIndexRef = useRef(dayIndex);
|
||||
const tmdbIdRef = useRef(tmdbId);
|
||||
const isInPictureInPictureRef = useRef(isInPictureInPicture);
|
||||
const titleRef = useRef(title);
|
||||
|
||||
// Sync refs
|
||||
useEffect(() => {
|
||||
|
|
@ -57,7 +59,8 @@ export const useWatchProgress = (
|
|||
dayIndexRef.current = dayIndex;
|
||||
tmdbIdRef.current = tmdbId;
|
||||
isInPictureInPictureRef.current = isInPictureInPicture;
|
||||
}, [imdbId, season, episode, releaseDate, malId, dayIndex, tmdbId, isInPictureInPicture]);
|
||||
titleRef.current = title;
|
||||
}, [imdbId, season, episode, releaseDate, malId, dayIndex, tmdbId, isInPictureInPicture, title]);
|
||||
|
||||
// Reset scrobble flag when content changes
|
||||
useEffect(() => {
|
||||
|
|
@ -174,6 +177,7 @@ export const useWatchProgress = (
|
|||
const currentMalId = malIdRef.current;
|
||||
const currentDayIndex = dayIndexRef.current;
|
||||
const currentTmdbId = tmdbIdRef.current;
|
||||
const currentTitle = titleRef.current;
|
||||
|
||||
if (type === 'series' && currentImdbId && currentSeason !== undefined && currentEpisode !== undefined) {
|
||||
watchedService.markEpisodeAsWatched(
|
||||
|
|
@ -189,7 +193,7 @@ export const useWatchProgress = (
|
|||
currentTmdbId
|
||||
);
|
||||
} else if (type === 'movie' && currentImdbId) {
|
||||
watchedService.markMovieAsWatched(currentImdbId, new Date(), currentMalId, currentTmdbId, title);
|
||||
watchedService.markMovieAsWatched(currentImdbId, new Date(), currentMalId, currentTmdbId, currentTitle);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { mmkvStorage } from '../mmkvStorage';
|
||||
import { MalApiService } from './MalApi';
|
||||
import { MalAuth } from './MalAuth';
|
||||
import { MalListStatus, MalAnimeNode } from '../../types/mal';
|
||||
import { catalogService } from '../catalogService';
|
||||
import { ArmSyncService } from './ArmSyncService';
|
||||
import { logger } from '../../utils/logger';
|
||||
import axios from 'axios';
|
||||
|
||||
const MAPPING_PREFIX = 'mal_map_';
|
||||
|
|
|
|||
Loading…
Reference in a new issue