mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
fix: Refactor getChannelURL and handleWatchStream for proper URL copying
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Has been cancelled
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Has been cancelled
This commit is contained in:
parent
336aa7f3cb
commit
705fb6bd66
1 changed files with 11 additions and 8 deletions
|
|
@ -684,29 +684,32 @@ const ChannelsTable = ({ onReady }) => {
|
|||
|
||||
const getChannelURL = useCallback(
|
||||
(channel) => {
|
||||
// Make sure we're using the channel UUID consistently
|
||||
if (!channel || !channel.uuid) {
|
||||
console.error('Invalid channel object or missing UUID:', channel);
|
||||
return '';
|
||||
}
|
||||
|
||||
const uri = buildLiveStreamUrl(`/proxy/ts/stream/${channel.uuid}`);
|
||||
let channelUrl = `${window.location.protocol}//${window.location.host}${uri}`;
|
||||
const path = `/proxy/ts/stream/${channel.uuid}`;
|
||||
if (env_mode == 'dev') {
|
||||
channelUrl = `${window.location.protocol}//${window.location.hostname}:5656${uri}`;
|
||||
return `${window.location.protocol}//${window.location.hostname}:5656${path}`;
|
||||
}
|
||||
|
||||
return channelUrl;
|
||||
return `${window.location.protocol}//${window.location.host}${path}`;
|
||||
},
|
||||
[env_mode]
|
||||
);
|
||||
|
||||
const handleWatchStream = useCallback(
|
||||
(channel) => {
|
||||
const url = getChannelURL(channel);
|
||||
if (!channel || !channel.uuid) return;
|
||||
const path = `/proxy/ts/stream/${channel.uuid}`;
|
||||
const uri = buildLiveStreamUrl(path);
|
||||
let url = `${window.location.protocol}//${window.location.host}${uri}`;
|
||||
if (env_mode == 'dev') {
|
||||
url = `${window.location.protocol}//${window.location.hostname}:5656${uri}`;
|
||||
}
|
||||
showVideo(url, 'live', { name: channel.name, channelId: channel.id });
|
||||
},
|
||||
[getChannelURL, showVideo]
|
||||
[env_mode, showVideo]
|
||||
);
|
||||
|
||||
const onRowSelectionChange = (newSelection) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue