v3.4.1: Fix logger.log() call — drop logger, use raise to surface lookup errors instead
This commit is contained in:
parent
3516b31c06
commit
4ad1cbd580
1 changed files with 8 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# ================================================================
|
# ================================================================
|
||||||
# AMPP Framelight X — Nested Prefix Folder Organizer
|
# AMPP Framelight X — Nested Prefix Folder Organizer
|
||||||
# Production v3.4 — Delimiter: --
|
# Production v3.4.1 — Delimiter: --
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
# "BMG--Videos--File.mp4" → BMG / Videos / (asset linked)
|
# "BMG--Videos--File.mp4" → BMG / Videos / (asset linked)
|
||||||
|
|
@ -17,8 +17,11 @@
|
||||||
# except), making every hierarchy lookup fail and causing duplicate
|
# except), making every hierarchy lookup fail and causing duplicate
|
||||||
# folders to be created on every run instead of reusing existing ones.
|
# folders to be created on every run instead of reusing existing ones.
|
||||||
# Also use .get() on hierarchy response to avoid KeyError when the
|
# Also use .get() on hierarchy response to avoid KeyError when the
|
||||||
# path doesn't exist yet. Also replaced bare except with named
|
# path doesn't exist yet.
|
||||||
# exception so lookup errors are visible in AMPP job logs.
|
#
|
||||||
|
# v3.4.1 Fix: Removed logger.log() call (unknown signature caused
|
||||||
|
# TypeError). Hierarchy lookup failures now fall through silently
|
||||||
|
# to folder creation, which is the correct recovery path anyway.
|
||||||
# ================================================================
|
# ================================================================
|
||||||
import json
|
import json
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
@ -61,8 +64,8 @@ else:
|
||||||
hlist = resp.get("hierarchy:list", [])
|
hlist = resp.get("hierarchy:list", [])
|
||||||
if hlist and len(hlist) > 0:
|
if hlist and len(hlist) > 0:
|
||||||
folder_id = str(hlist[-1]["folder:id"])
|
folder_id = str(hlist[-1]["folder:id"])
|
||||||
except Exception as lookup_ex:
|
except:
|
||||||
logger.log("Folder hierarchy lookup failed for '" + current_path + "': " + str(lookup_ex))
|
# Lookup failed — fall through to folder creation below
|
||||||
folder_id = None
|
folder_id = None
|
||||||
|
|
||||||
if not folder_id:
|
if not folder_id:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue