diff --git a/templates/index.html b/templates/index.html index e40f1c1..da2043e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -837,6 +837,7 @@ let currentAnimeUrl = ''; let searchResultsCache = {}; let allDownloads = []; // Store all downloads for filtering + let collapsedGroups = new Set(); // Store which groups are collapsed // Extract series name from filename (for grouping) function extractSeriesName(filename) { @@ -894,6 +895,9 @@ const groupBy = document.getElementById('groupBy').value; const searchTerm = document.getElementById('searchDownloads').value.toLowerCase(); + // Clear collapsed groups when filters change (optional) + // collapsedGroups.clear(); + // Filter by status and search let filtered = allDownloads.filter(dl => { const matchesStatus = statusFilter === 'all' || dl.status === statusFilter; @@ -1547,13 +1551,17 @@ groupNames.forEach((groupName, index) => { const groupDownloads = groups[groupName]; const groupId = `group-${index}`; + const isCollapsed = collapsedGroups.has(groupId); + const collapsedClass = isCollapsed ? 'collapsed' : ''; + const displayStyle = isCollapsed ? 'display: none;' : ''; + html += `