fix: current channel deletion in restream mode

This commit is contained in:
antebrl
2025-01-10 01:30:27 +00:00
parent 68060097c5
commit 8fbbf73ff7

View File

@@ -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);
}