[importers] Better webdav info logging
All checks were successful
build & deploy / test (push) Successful in 1m54s
build & deploy / build-and-deploy (push) Successful in 30s

This commit is contained in:
2026-05-25 00:17:38 -04:00
parent b622b151d4
commit 1cbb84c29f

View File

@ -1,9 +1,8 @@
import json
import logging
import os
import tempfile
import json
from books.koreader import fetch_file_from_webdav
from profiles.models import UserProfile
from scrobbles.models import KoReaderImport, TrailGPXImport
@ -40,11 +39,19 @@ def import_from_webdav_for_all_users(restart=False):
for user_id in webdav_enabled_user_ids:
client = get_webdav_client(user_id)
logger.info("Scanning WebDAV for user %s", user_id)
logger.info("Scanning WebDAV koreader for user %s", user_id)
ko_count += scan_webdav_for_koreader(client, user_id, restart)
logger.info("Scanning WebDAV gpx for user %s", user_id)
gpx_count += scan_webdav_for_gpx(client, user_id)
logger.info("Scanning WebDAV retroarch for user %s", user_id)
retro_count += scan_webdav_for_retroarch(client, user_id)
logger.info("Scanning WebDAV bgstats for user %s", user_id)
bgstats_count += scan_webdav_for_bgstats(client, user_id)
logger.info("Scanning WebDAV ebird for user %s", user_id)
ebird_count += scan_webdav_for_ebird(client, user_id)
logger.info("Scanning WebDAV scale for user %s", user_id)
scale_count += scan_webdav_for_scale(client, user_id)
logger.info(
@ -125,6 +132,7 @@ def scan_webdav_for_gpx(webdav_client, user_id):
gpx_path = DEFAULT_GPX_PATH # TODO allow this to be configured in user settings
try:
webdav_client.info(DEFAULT_GPX_PATH)
logger.info("var/gpx/ found, listing files")
except:
logger.info("No var/gpx/ directory on webdav", extra={"user_id": user_id})
return 0