Fixed hidden groups consuming batch slots

This commit is contained in:
Trevor Mears
2025-12-28 17:52:40 -08:00
parent 2ebe52685f
commit 15098ad6ed
3 changed files with 40 additions and 3 deletions
+11
View File
@@ -309,6 +309,17 @@
directly.</span>
</div>
</div>
<div class="setting-item">
<div class="setting-info" style="flex: 1;">
<span class="setting-label">Stream Output Format</span>
<span class="setting-hint">Container format for Xtream streams. Try TS if you experience buffering
issues.</span>
</div>
<select id="setting-stream-format" class="source-select" style="width: auto; min-width: 200px;">
<option value="m3u8">HLS (m3u8) - Recommended</option>
<option value="ts">MPEG-TS (ts) - Better buffer</option>
</select>
</div>
</div>
<div class="settings-section">
+16 -3
View File
@@ -216,13 +216,25 @@ class ChannelList {
groupedChannels['Favorites'] = favoritedChannels;
}
// 4. Sort Groups
this.sortedGroups = Object.keys(groupedChannels).sort((a, b) => {
// 4. Sort Groups and filter to only those with visible channels
const allGroups = Object.keys(groupedChannels).sort((a, b) => {
if (a === 'Favorites') return -1;
if (b === 'Favorites') return 1;
return a.localeCompare(b);
});
// Pre-filter to only include groups with visible channels (so hidden groups don't consume batch slots)
this.sortedGroups = allGroups.filter(groupName => {
if (groupName === 'Favorites') return true;
const channels = groupedChannels[groupName];
// Check if any channel in this group is visible
return channels.some(channel => {
const rawChannelId = channel.streamId || channel.id;
const isHidden = this.isHidden('channel', channel.sourceId, rawChannelId);
return !isHidden || showHidden;
});
});
this.groupedChannels = groupedChannels;
this.showHidden = showHidden;
@@ -819,7 +831,8 @@ class ChannelList {
// Get stream URL
let streamUrl;
if (channel.sourceType === 'xtream') {
const result = await API.proxy.xtream.getStreamUrl(channel.sourceId, channel.streamId, 'live');
const streamFormat = localStorage.getItem('nodecast_tv_stream_format') || 'm3u8';
const result = await API.proxy.xtream.getStreamUrl(channel.sourceId, channel.streamId, 'live', streamFormat);
streamUrl = result.url;
} else {
streamUrl = channel.url;
+13
View File
@@ -97,6 +97,19 @@ class SettingsPage {
localStorage.setItem('nodecast_tv_epg_refresh_interval', epgRefreshSelect.value);
});
}
// Stream output format
const streamFormatSelect = document.getElementById('setting-stream-format');
if (streamFormatSelect) {
// Load saved value
const savedFormat = localStorage.getItem('nodecast_tv_stream_format') || 'm3u8';
streamFormatSelect.value = savedFormat;
// Save on change
streamFormatSelect.addEventListener('change', () => {
localStorage.setItem('nodecast_tv_stream_format', streamFormatSelect.value);
});
}
}
switchTab(tabName) {