[importers] Better webdav info logging
This commit is contained in:
@ -1,9 +1,8 @@
|
|||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
from books.koreader import fetch_file_from_webdav
|
from books.koreader import fetch_file_from_webdav
|
||||||
from profiles.models import UserProfile
|
from profiles.models import UserProfile
|
||||||
from scrobbles.models import KoReaderImport, TrailGPXImport
|
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:
|
for user_id in webdav_enabled_user_ids:
|
||||||
client = get_webdav_client(user_id)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
scale_count += scan_webdav_for_scale(client, user_id)
|
||||||
|
|
||||||
logger.info(
|
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
|
gpx_path = DEFAULT_GPX_PATH # TODO allow this to be configured in user settings
|
||||||
try:
|
try:
|
||||||
webdav_client.info(DEFAULT_GPX_PATH)
|
webdav_client.info(DEFAULT_GPX_PATH)
|
||||||
|
logger.info("var/gpx/ found, listing files")
|
||||||
except:
|
except:
|
||||||
logger.info("No var/gpx/ directory on webdav", extra={"user_id": user_id})
|
logger.info("No var/gpx/ directory on webdav", extra={"user_id": user_id})
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user