mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-30 09:32:50 +01:00
fix(subtitles): rebuild VideoContext track callbacks when api.basePath changes
The setTrack callbacks build external-sub URLs from api?.basePath; add it to the track-building effect deps so the list rebuilds once the API is ready (otherwise online externals could resolve with undefined → notFound). Addresses CodeRabbit.
This commit is contained in:
@@ -354,7 +354,16 @@ export const VideoProvider: React.FC<{ children: ReactNode }> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchTracks();
|
fetchTracks();
|
||||||
}, [tracksReady, mediaSource, offline, downloadedItem, itemId]);
|
// api?.basePath: the setTrack callbacks build external-sub URLs from it; rebuild
|
||||||
|
// them once the API is ready so online externals don't resolve with undefined.
|
||||||
|
}, [
|
||||||
|
tracksReady,
|
||||||
|
mediaSource,
|
||||||
|
offline,
|
||||||
|
downloadedItem,
|
||||||
|
itemId,
|
||||||
|
api?.basePath,
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VideoContext.Provider value={{ subtitleTracks, audioTracks }}>
|
<VideoContext.Provider value={{ subtitleTracks, audioTracks }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user