fix(plex): S6 — thread lang into the player's item_detail query
Found by the HU-overlay E2E: PlexPlayer fetched qk.plexItem(id) WITHOUT lang, so the in-player title/summary/rich detail stayed English even in HU mode while the grid showed Hungarian (e.g. the player header read "127 Hours" over a grid of "127 óra"). The S6 FE pass threaded lang through the grid, facets, info-page and show queries but missed the player's own detail fetch. Now keyed by plexLang() like the rest, so the player matches the active language. FE gate: tsc / knip / lint clean; queryKeys tests pass. Verified live — the player header now reads "127 óra" in HU mode.
This commit is contained in:
@@ -2,6 +2,7 @@ import { Fragment, lazy, Suspense, useCallback, useEffect, useRef, useState } fr
|
||||
import { qk } from "../lib/queryKeys";
|
||||
import { createPortal } from "react-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { plexLang } from "../i18n";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import Hls from "hls.js";
|
||||
import {
|
||||
@@ -77,7 +78,12 @@ export default function PlexPlayer({ itemId, onClose, queue }: Props) {
|
||||
tRef.current = t;
|
||||
const qc = useQueryClient();
|
||||
const [id, setId] = useState(itemId);
|
||||
const detailQ = useQuery({ queryKey: qk.plexItem(id), queryFn: () => api.plexItem(id) });
|
||||
// Serve the player's title/summary/rich detail in the active language (E5 S6), matching the grid.
|
||||
const lang = plexLang();
|
||||
const detailQ = useQuery({
|
||||
queryKey: qk.plexItem(id, lang),
|
||||
queryFn: () => api.plexItem(id, lang),
|
||||
});
|
||||
const detail = detailQ.data;
|
||||
const duration = detail?.duration_seconds ?? 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user