feat: band NC folder config, fix watcher event filter, add light/dark theme
- Add PATCH /bands/{id} endpoint for admins to update nc_folder_path
- Add band NC scan folder UI panel with inline edit
- Fix watcher: use activity type field (not human-readable subject) for upload detection
- Reorder watcher filters: audio extension check first, then band path, then type
- Add dark/light theme toggle using GitHub Primer-inspired CSS custom properties
- All inline styles migrated to CSS variables for theme-awareness
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -109,27 +109,25 @@ async def poll_once(nc_client: NextcloudWatcherClient, settings: WatcherSettings
|
||||
|
||||
for activity in activities:
|
||||
activity_id = int(activity.get("activity_id", 0))
|
||||
subject = activity.get("subject", "")
|
||||
activity_type = activity.get("type", "")
|
||||
subject = activity.get("subject", "") # human-readable, for logging only
|
||||
raw_path = extract_nc_file_path(activity)
|
||||
|
||||
log.debug(
|
||||
"Activity id=%d subject=%r path=%r",
|
||||
activity_id, subject, raw_path,
|
||||
"Activity id=%d type=%r subject=%r path=%r",
|
||||
activity_id, activity_type, subject, raw_path,
|
||||
)
|
||||
|
||||
# Advance the cursor regardless of whether we act on this event
|
||||
_last_activity_id = max(_last_activity_id, activity_id)
|
||||
|
||||
if subject not in _UPLOAD_SUBJECTS:
|
||||
log.debug("Skipping activity %d: subject %r not a file upload event", activity_id, subject)
|
||||
continue
|
||||
|
||||
if raw_path is None:
|
||||
log.debug("Skipping activity %d: no file path in payload", activity_id)
|
||||
continue
|
||||
|
||||
nc_path = normalize_nc_path(raw_path, nc_client.username)
|
||||
|
||||
# Only care about audio files — skip everything else immediately
|
||||
if not is_audio_file(nc_path, settings.audio_extensions):
|
||||
log.debug(
|
||||
"Skipping activity %d: '%s' is not an audio file (ext: %s)",
|
||||
@@ -144,6 +142,10 @@ async def poll_once(nc_client: NextcloudWatcherClient, settings: WatcherSettings
|
||||
)
|
||||
continue
|
||||
|
||||
if activity_type not in _UPLOAD_SUBJECTS:
|
||||
log.debug("Skipping activity %d: type %r not a file upload event", activity_id, activity_type)
|
||||
continue
|
||||
|
||||
log.info("Detected audio upload: %s (activity %d)", nc_path, activity_id)
|
||||
etag = await nc_client.get_file_etag(nc_path)
|
||||
success = await register_version_with_api(nc_path, etag, settings.api_url)
|
||||
|
||||
Reference in New Issue
Block a user