From 097ab16c50a20caed941a8b8871264d71b6be978 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 30 Jan 2026 00:01:45 -0500 Subject: [PATCH] more UI polish and schedule safe guards and optimization --- .claude/settings.local.json | 3 +- backend/app/services/gallery_dl.py | 11 ++-- backend/app/tasks/downloads.py | 5 +- frontend/src/views/Dashboard.vue | 38 ++++++++++++- frontend/src/views/Subscriptions.vue | 17 ++++-- summary.md | 84 ++++++++++++++++++++++++---- 6 files changed, 133 insertions(+), 25 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index edca24f..8278838 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -13,7 +13,8 @@ "Bash(where:*)", "Bash(where npm:*)", "Bash(powershell -Command \"Copy-Item ''c:\\\\Users\\\\bvandeusen\\\\Nextcloud\\\\Projects\\\\GallerySubscriber\\\\extension\\\\web-ext-artifacts\\\\be3706e9e89640a5b70b-1.0.0.xpi'' ''c:\\\\Users\\\\bvandeusen\\\\Nextcloud\\\\Projects\\\\GallerySubscriber\\\\gallerysubscriber-signed.xpi'' -Force; Get-Item ''c:\\\\Users\\\\bvandeusen\\\\Nextcloud\\\\Projects\\\\GallerySubscriber\\\\gallerysubscriber-signed.xpi'' | Select-Object Name, Length\")", - "WebFetch(domain:github.com)" + "WebFetch(domain:github.com)", + "WebFetch(domain:raw.githubusercontent.com)" ] } } diff --git a/backend/app/services/gallery_dl.py b/backend/app/services/gallery_dl.py index 0171a71..06a2619 100644 --- a/backend/app/services/gallery_dl.py +++ b/backend/app/services/gallery_dl.py @@ -154,10 +154,10 @@ class GalleryDLService: # Automatic infinite scroll pagination is built-in }, "hentaifoundry": { - "content_types": ["pictures"], + "content_types": ["all"], # Download all content types "directory": [], # Flat structure within platform folder "filename": "{category}_{index:>03}_{title[:50]}.{extension}", - "include": "all", # Include all content types (pictures, scraps, stories) + "include": "all", # Include pictures, scraps, stories - complete content # Automatic pagination through all pages (25 items/page) }, "discord": { @@ -206,7 +206,8 @@ class GalleryDLService: "archive": str(Path(self.settings.config_path) / "archive.sqlite3"), "skip": True, "sleep": self._rate_limit, - "sleep-request": max(1.0, self._rate_limit / 2), + # Faster request rate for pagination/checking (1/4 of rate_limit, min 0.5s) + "sleep-request": max(0.5, self._rate_limit / 4), "retries": 3, "timeout": 30.0, "verify": True, @@ -624,7 +625,7 @@ class GalleryDLService: if platform == "patreon": return ["images", "image_large", "attachments", "postfile", "content"] elif platform == "hentaifoundry": - return ["pictures", "stories"] + return ["all", "pictures", "scraps", "stories"] elif platform == "subscribestar": return ["all"] # No granular control elif platform == "discord": @@ -643,5 +644,5 @@ class GalleryDLService: "directory_pattern": defaults.get("directory"), "filename_pattern": defaults.get("filename"), "sleep": self._rate_limit, - "sleep_request": max(1.0, self._rate_limit / 2), + "sleep_request": max(0.5, self._rate_limit / 4), } diff --git a/backend/app/tasks/downloads.py b/backend/app/tasks/downloads.py index 280ed9e..43a121d 100644 --- a/backend/app/tasks/downloads.py +++ b/backend/app/tasks/downloads.py @@ -287,9 +287,10 @@ async def _download_source_async(source_id: int, download_id: int = None) -> dic # Update download record with results download.completed_at = utcnow() download.file_count = dl_result.files_downloaded + # Store full logs - cleanup task will age out old records download.metadata_ = { - "stdout": dl_result.stdout[:10000] if dl_result.stdout else None, - "stderr": dl_result.stderr[:5000] if dl_result.stderr else None, + "stdout": dl_result.stdout if dl_result.stdout else None, + "stderr": dl_result.stderr if dl_result.stderr else None, "duration_seconds": dl_result.duration_seconds, } diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index 1bea648..536b3cf 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -95,6 +95,23 @@ Reset Stuck ({{ stuckRunningCount }}) + +
+ mdi-key + Auth: + + {{ getPlatformIcon(platform) }} + {{ platform }} + +
+
mdi-harddisk Storage: {{ storageStats?.total_size_formatted || 'Calculating...' }} @@ -267,9 +284,10 @@ - Edit + View + View in Subscriptions @@ -290,13 +308,18 @@ import { ref, computed, onMounted, onUnmounted } from 'vue' import { useSourcesStore } from '../stores/sources' import { useDownloadsStore } from '../stores/downloads' +import { useCredentialsStore } from '../stores/credentials' import { useNotificationStore } from '../stores/notifications' import { settingsApi, downloadsApi } from '../services/api' const sourcesStore = useSourcesStore() const downloadsStore = useDownloadsStore() +const credentialsStore = useCredentialsStore() const notifications = useNotificationStore() +// Supported platforms for credential status +const supportedPlatforms = ['patreon', 'subscribestar', 'hentaifoundry', 'discord'] + // State const checkingAll = ref(false) const retryingAll = ref(false) @@ -337,6 +360,7 @@ function loadDashboardData() { // Fire off all requests in parallel, don't block UI // Each section handles its own loading state sourcesStore.fetchSources().catch(e => console.error('Failed to fetch sources:', e)) + credentialsStore.fetchCredentials().catch(e => console.error('Failed to fetch credentials:', e)) downloadsStore.fetchStats() .catch(e => console.error('Failed to fetch stats:', e)) @@ -490,6 +514,16 @@ function getStatusIcon(status) { return icons[status] || 'mdi-help-circle' } +function getPlatformIcon(platform) { + const icons = { + patreon: 'mdi-patreon', + subscribestar: 'mdi-star', + hentaifoundry: 'mdi-palette', + discord: 'mdi-discord', + } + return icons[platform] || 'mdi-web' +} + function getStatusColor(status) { const colors = { completed: 'success', diff --git a/frontend/src/views/Subscriptions.vue b/frontend/src/views/Subscriptions.vue index 9bc64b8..bdf456b 100644 --- a/frontend/src/views/Subscriptions.vue +++ b/frontend/src/views/Subscriptions.vue @@ -197,7 +197,7 @@
{{ formatDate(source.last_check) }}
-
+
Next: {{ formatNextCheck(source) }}
@@ -323,15 +323,22 @@