|
68 | 68 | # 2024-07-05 Moonbase59 - v4.1.0 Add `liq_cue_file` to known tags, so we can |
69 | 69 | # forbid external processes to call us again and |
70 | 70 | # possibly deliver outdated metadata to us. |
| 71 | +# 2024-08-05 Moonbase59 - v4.1.1 Fix JSON overriding if `liq_cue_file` is true |
71 | 72 | # |
72 | 73 | # Originally based on an idea and some code by John Warburton (@Warblefly): |
73 | 74 | # https://github.com/Warblefly/TrackBoundaries |
74 | 75 | # Some collaborative work with RM-FM (@RM-FM): Sustained ending analysis. |
75 | 76 |
|
76 | 77 | __author__ = 'Matthias C. Hormann' |
77 | | -__version__ = '4.1.0' |
| 78 | +__version__ = '4.1.1' |
78 | 79 |
|
79 | 80 | import os |
80 | 81 | import sys |
@@ -304,9 +305,12 @@ def override_from_JSON(tags, tags_json={}): |
304 | 305 | # get tags in JSON override file |
305 | 306 | tags_in_json = convert_tags(tags_json) |
306 | 307 |
|
307 | | - # unify, right overwrites left if key in both |
308 | | - # tags_found = tags_in_stream | tags_in_format | tags_in_json |
309 | | - tags = {**tags, **tags_in_json} |
| 308 | + # do NOT overwrite from JSON if `liq_cue_file` is true |
| 309 | + if "liq_cue_file" in tags and tags["liq_cue_file"] == True: |
| 310 | + pass |
| 311 | + else: |
| 312 | + # unify, right overwrites left if key in both |
| 313 | + tags = {**tags, **tags_in_json} |
310 | 314 |
|
311 | 315 | return tags |
312 | 316 |
|
@@ -1230,7 +1234,7 @@ if args.force or not skip_analysis: |
1230 | 1234 | nice=args.nice, |
1231 | 1235 | noclip=args.noclip |
1232 | 1236 | ) |
1233 | | - # allow to override even the analysis results |
| 1237 | + # allow to override even the analysis results (not if `liq_cue_file=true`) |
1234 | 1238 | if args.json: |
1235 | 1239 | result = override_from_JSON(result, tags_json) |
1236 | 1240 | # override duration, seems ffprobe can be more exact |
|
0 commit comments