deselect a channel on "all <channel-group>"

This commit is contained in:
Simon
2026-06-23 06:46:06 +00:00
parent 3d4b90b0e1
commit bec981a262
2 changed files with 43 additions and 7 deletions

View File

@@ -150,11 +150,22 @@ App.videos = App.videos || {};
const searchInput = document.getElementById('search-input');
const query = searchInput ? searchInput.value : "";
if (!state.groupCursors || state.groupCursors.groupId !== group.id || state.groupCursors.query !== query) {
// Honor the per-group "Channels" multi-select filter so disabled
// channels are skipped. Falls back to the full group when nothing is
// selected (e.g. older sessions without the filter).
const selectedChannels = session.options ? session.options[App.session.GROUP_CHANNELS_OPTION_ID] : null;
const enabledIds = (Array.isArray(selectedChannels) && selectedChannels.length > 0 ?
selectedChannels.map((opt) => opt.id) :
group.channelIds).filter((id) => group.channelIds.includes(id));
const signature = enabledIds.join(',');
if (!state.groupCursors || state.groupCursors.groupId !== group.id ||
state.groupCursors.query !== query || state.groupCursors.signature !== signature) {
state.groupCursors = {
groupId: group.id,
query: query,
channels: group.channelIds.map((id) => ({ id, page: 1, hasNextPage: true }))
signature: signature,
channels: enabledIds.map((id) => ({ id, page: 1, hasNextPage: true }))
};
}