Merge branch 'main' of https://github.com/antebrl/IPTV-StreamHub
This commit is contained in:
@@ -41,11 +41,16 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const proxyBaseUrl = '/proxy/';
|
||||
const rewrittenBody = ProxyHelperService.rewriteUrls(body, proxyBaseUrl, headers, targetUrl).join('\n');
|
||||
res.send(rewrittenBody);
|
||||
} catch (e) {
|
||||
console.error('Failed to rewrite URLs:', e);
|
||||
res.status(500).json({ error: 'Failed to parse m3uo file. Not a valid HLS stream.' });
|
||||
}
|
||||
|
||||
//res.set('Content-Type', 'application/vnd.apple.mpegurl');
|
||||
res.send(rewrittenBody);
|
||||
}).on('error', (err) => {
|
||||
console.error('Unhandled error:', err);
|
||||
if (!res.headersSent) {
|
||||
|
||||
@@ -100,14 +100,7 @@ class ChannelService {
|
||||
const [deletedChannel] = this.channels.splice(channelIndex, 1);
|
||||
|
||||
if (this.currentChannel.id === id) {
|
||||
if (deletedChannel.restream()) {
|
||||
streamController.stop(deletedChannel);
|
||||
}
|
||||
|
||||
this.currentChannel = this.channels.length > 0 ? this.channels[0] : null;
|
||||
if (this.currentChannel?.restream()) {
|
||||
await streamController.start(this.currentChannel);
|
||||
}
|
||||
await this.setCurrentChannel(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ function ChannelModal({ onClose, channel }: ChannelModalProps) {
|
||||
setPlaylistUrl(channel.playlist);
|
||||
setIsEditMode(true);
|
||||
setType('channel'); // Default to "channel" if a channel object exists
|
||||
console.log("NOT");
|
||||
} else {
|
||||
setName('');
|
||||
setUrl('');
|
||||
@@ -47,7 +46,6 @@ function ChannelModal({ onClose, channel }: ChannelModalProps) {
|
||||
setPlaylistName('');
|
||||
setPlaylistUrl('');
|
||||
setIsEditMode(false);
|
||||
console.log("CLEAR");
|
||||
setType('channel'); // Default to "channel" if a channel object exists
|
||||
}
|
||||
}, [channel]);
|
||||
|
||||
Reference in New Issue
Block a user