Skip to content

Commit

Permalink
v4.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Moonbase59 committed Jul 4, 2024
1 parent 702d683 commit 8ff1ae1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# autocue changelog

### 2024-07-04 – v4.0.6

- Make `duration` non-overridable by existing metadata or annotations.
- The real file duration is not a tag, but determined otherwise.
- If such a tag is found, it is typically unusable, incorrect or in a different format.
- AzuraCast might annotate the duration from an earlier version of the file, because the media scan is only done once in a while. With frequently changing files of the same name, like syndicated news or time announcements, this could be problematic.

### 2024-07-02 – v4.0.5

- Fixed a situation where `cue_file` would read a string duration from ffprobe for audio stream \#0, which led to an error in the AzuraCast log like this:
Expand Down
40 changes: 21 additions & 19 deletions autocue.cue_file.liq
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
# most people seem to want transitions a bit tighter
# 2024-07-01 - Moonbase59 - v4.0.4 - Sync with cue_file version
# 2024-07-02 - Moonbase59 - v4.0.5 - Sync with cue_file version
# 2024-07-04 - Moonbase59 - v4.0.6 - Make duration non-overridable, i.e.,
# it’s ALWAYS taken from the cue_file result.

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

Expand All @@ -52,7 +54,7 @@ let settings.autocue.cue_file.version =
settings.make(
description=
"Software version of autocue.cue_file. Should coincide with `cue_file`.",
"4.0.5"
"4.0.6"
)

# Internal only! Not a user setting.
Expand Down Expand Up @@ -204,6 +206,15 @@ let settings.autocue.cue_file.use_json_metadata =
true
)

let settings.autocue.cue_file.ignored_overrides =
settings.make(
description=
'List of cue_file results that cannot be overridden by existing \
metadata or annotations. One such field is `duration`, as it is not \
a tag, and determined otherwise.',
['duration']
)

stdlib_metadata = metadata

# metadata.json.stringify only exports a limited set, use our own
Expand Down Expand Up @@ -450,21 +461,6 @@ def cue_file(~request_metadata, ~file_metadata, filename) =
end
end

# # Handle annotated `liq_blankskip`, the ultimate switch
# # Pre-v3.0.0 compatibility: Check for true/false (now float)
# if list.assoc.mem("liq_blankskip", meta) then
# b = meta["liq_blankskip"]
# if b == "true" then
# blankskip := blankskip()
# elsif b == "false" then
# blankskip := 0.0
# else
# blankskip := float_of_string(default=0.0, b)
# end
# m := list.assoc.remove("liq_blankskip", m())
# m := list.add(("liq_blankskip", string.float(decimal_places=2, blankskip())), m())
# end

# Handle annotated `liq_blankskip`, the ultimate switch
# Pre-v3.0.0 compatibility: Check for true/false (now float)
if list.assoc.mem("liq_blankskip", meta) then
Expand Down Expand Up @@ -642,13 +638,19 @@ def cue_file(~request_metadata, ~file_metadata, filename) =
)

# only use calculated values if not already annotated in AzuraCast
# so we don't overwrite manually set values in the database
# so we don't overwrite manually set values in the database,
# except for non-overridable values like `duration`, which are
# ALWAYS taken from the cue_file result.
result := list.fold(
fun(res, entry) ->
if list.assoc.mem(fst(entry), res) then
res
if list.mem(fst(entry), settings.autocue.cue_file.ignored_overrides()) then
[...list.assoc.remove(fst(entry), res), entry] # take cue_file result
else
res # take existing metadata
end
else
[...res, entry]
[...res, entry] # append new metadata
end,
m(),
result()
Expand Down
3 changes: 2 additions & 1 deletion cue_file
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@
# - streamline tag conversion code a little
# - only write known tags, not all `liq_*`
# 2024-07-02 Moonbase59 - v4.0.5 Fix minor bugs with file duration
# 2024-07-04 Moonbase59 - v4.0.6 Sync version with autocue.cue_file.liq
#
# Originally based on an idea and some code by John Warburton (@Warblefly):
# https://github.com/Warblefly/TrackBoundaries
# Some collaborative work with RM-FM (@RM-FM): Sustained ending analysis.

__author__ = 'Matthias C. Hormann'
__version__ = '4.0.5'
__version__ = '4.0.6'

import os
import sys
Expand Down

0 comments on commit 8ff1ae1

Please sign in to comment.