resolve merge conflicts in tv page (merge password + quality/subtitle features)

This commit is contained in:
2026-07-12 03:41:20 +02:00
parent 8051ab58c0
commit f2f56b7143
2 changed files with 4 additions and 5 deletions

View File

@@ -89,7 +89,6 @@ function TvPageContent() {
error: broadcastError, error: broadcastError,
} = useCurrentBroadcast(channel?.id ?? "", passwords.channelPassword); } = useCurrentBroadcast(channel?.id ?? "", passwords.channelPassword);
// blockPassword derived from broadcast.slot.id after broadcast loads
const blockPassword = passwords.getBlockPassword(broadcast?.slot.id); const blockPassword = passwords.getBlockPassword(broadcast?.slot.id);
const { data: epgSlots } = useEpg( const { data: epgSlots } = useEpg(

View File

@@ -132,10 +132,10 @@ export function useStreamUrl(
slotId: string | undefined, slotId: string | undefined,
channelPassword?: string, channelPassword?: string,
blockPassword?: string, blockPassword?: string,
quality?: string, bitrateBps?: number,
) { ) {
return useQuery({ return useQuery({
queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword, quality], queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword, bitrateBps],
queryFn: async (): Promise<string | null> => { queryFn: async (): Promise<string | null> => {
const params = new URLSearchParams(); const params = new URLSearchParams();
if (token) params.set("token", token); if (token) params.set("token", token);
@@ -151,8 +151,8 @@ export function useStreamUrl(
const msg = body?.error ?? `Stream resolve failed: ${res.status}`; const msg = body?.error ?? `Stream resolve failed: ${res.status}`;
throw new Error(msg); throw new Error(msg);
} }
const { url } = await res.json(); const { url } = (await res.json()) as { url: string };
return url as string; return bitrateBps ? `${url}&VideoBitRate=${bitrateBps}` : url;
}, },
enabled: !!channelId && !!slotId, enabled: !!channelId && !!slotId,
staleTime: Infinity, staleTime: Infinity,