resolve merge conflicts in tv page (merge password + quality/subtitle features)
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user