From 68d12372ade856e1aa50d0d01c6fa9d00bab873f Mon Sep 17 00:00:00 2001 From: projectdx Date: Wed, 7 Jan 2026 00:43:58 +0900 Subject: [PATCH] Fix: Preserve expanded state during refresh, format created_time --- info.yaml | 2 +- model.py | 3 +++ templates/gommi_downloader_manager_queue_list.html | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/info.yaml b/info.yaml index 61abc36..8bbffe4 100644 --- a/info.yaml +++ b/info.yaml @@ -1,6 +1,6 @@ title: "GDM" package_name: gommi_downloader_manager -version: '0.2.6' +version: '0.2.7' description: FlaskFarm 범용 다운로더 큐 - YouTube, 애니24, 링크애니, Anilife 지원 developer: projectdx home: https://gitea.yommi.duckdns.org/projectdx/gommi_downloader_manager diff --git a/model.py b/model.py index 57d61d6..877dab5 100644 --- a/model.py +++ b/model.py @@ -57,6 +57,9 @@ class ModelDownloadItem(ModelBase): ret['meta'] = {} else: ret['meta'] = {} + # Format created_time for frontend + if self.created_time: + ret['created_time'] = self.created_time.strftime('%Y-%m-%d %H:%M:%S') return ret @classmethod diff --git a/templates/gommi_downloader_manager_queue_list.html b/templates/gommi_downloader_manager_queue_list.html index 97b78c8..a60b070 100644 --- a/templates/gommi_downloader_manager_queue_list.html +++ b/templates/gommi_downloader_manager_queue_list.html @@ -520,6 +520,12 @@ const container = document.getElementById('download_list'); if (!container) return; + // Save expanded card IDs before re-rendering + const expandedIds = []; + container.querySelectorAll('.dl-card.expanded').forEach(function(card) { + expandedIds.push(card.id); + }); + if (!items || items.length === 0) { container.innerHTML = `
@@ -534,6 +540,12 @@ html += createDownloadCard(item); }); container.innerHTML = html; + + // Restore expanded state + expandedIds.forEach(function(cardId) { + const card = document.getElementById(cardId); + if (card) card.classList.add('expanded'); + }); } function createDownloadCard(item) {