Skip to content

Commit 2d95fc5

Browse files
committed
Fix JSON override if liq_cue_file is true
1 parent 3c268e3 commit 2d95fc5

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# autocue changelog
22

3+
### 2024-08-05 - v4.1.1
4+
5+
- Fix situation where supplied JSON data could still overwrite `cue_file` results even if a file’s `liq_cue_file` tag was set to `true`, meaning the `cue_file` results should be preferred in any case.
6+
- For freshly generated/downloaded news or time announcements, this could lead to erroneous cut-offs or loudness jumps in case AzuraCast’s media checker hadn’t yet picked up the new data. It would then overwrite the actual file data with stored values from the database.
7+
38
### 2024-07-05 – v4.1.0
49

510
#### New features

autocue.cue_file.liq

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
# - not set = default (metadata can override cue_file)
5050
# - false = don’t autocue (still use metadata if present)
5151
# - true = cue_file results override metadata
52+
# 2024-08-05 - Moonbase59 - v4.1.1 Sync with cue_file version
5253

5354
# Lots of debugging output for AzuraCast in this, will be removed eventually.
5455

@@ -62,7 +63,7 @@ let settings.autocue.cue_file.version =
6263
settings.make(
6364
description=
6465
"Software version of autocue.cue_file. Should coincide with `cue_file`.",
65-
"4.1.0"
66+
"4.1.1"
6667
)
6768

6869
# Internal only! Not a user setting.

cue_file

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@
6868
# 2024-07-05 Moonbase59 - v4.1.0 Add `liq_cue_file` to known tags, so we can
6969
# forbid external processes to call us again and
7070
# possibly deliver outdated metadata to us.
71+
# 2024-08-05 Moonbase59 - v4.1.1 Fix JSON overriding if `liq_cue_file` is true
7172
#
7273
# Originally based on an idea and some code by John Warburton (@Warblefly):
7374
# https://github.com/Warblefly/TrackBoundaries
7475
# Some collaborative work with RM-FM (@RM-FM): Sustained ending analysis.
7576

7677
__author__ = 'Matthias C. Hormann'
77-
__version__ = '4.1.0'
78+
__version__ = '4.1.1'
7879

7980
import os
8081
import sys
@@ -304,9 +305,12 @@ def override_from_JSON(tags, tags_json={}):
304305
# get tags in JSON override file
305306
tags_in_json = convert_tags(tags_json)
306307

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}
310314

311315
return tags
312316

@@ -1230,7 +1234,7 @@ if args.force or not skip_analysis:
12301234
nice=args.nice,
12311235
noclip=args.noclip
12321236
)
1233-
# allow to override even the analysis results
1237+
# allow to override even the analysis results (not if `liq_cue_file=true`)
12341238
if args.json:
12351239
result = override_from_JSON(result, tags_json)
12361240
# override duration, seems ffprobe can be more exact

0 commit comments

Comments
 (0)