diff --git a/autocue.cue_file.liq b/autocue.cue_file.liq index 7617978..07ab790 100644 --- a/autocue.cue_file.liq +++ b/autocue.cue_file.liq @@ -19,6 +19,9 @@ # 2024-06-05 - Moonbase59 - v2.0.2 Initial display of version, at log level 2. # 2024-06-08 - Moonbase59 - v2.0.3 Sync version number with cue_file # 2024-06-09 - Moonbase59 - v2.1.0 Sync version number with cue_file +# 2024-06-11 - Moonbase59 - v2.2.0 JSON override tags for cue_file in temp file: +# Allows passing annotate/database overrides to +# cue_file, to reduce re-analysis runs even more. # Lots of debugging output for AzuraCast in this, will be removed eventually. @@ -32,7 +35,7 @@ let settings.autocue.cue_file.version = settings.make( description= "Software version of autocue.cue_file. Should coincide with `cue_file`.", - "2.1.0" + "2.2.0" ) let settings.autocue.cue_file.path = @@ -157,6 +160,18 @@ let settings.autocue.cue_file.nice = stdlib_metadata = metadata +# metadata.json.stringify only exports a limited set, use our own +def meta_json_stringify( + ~compact=false, + ~json5=false, + m +) = + m = metadata.cover.remove(m) + data = json() + list.iter(fun (v) -> data.add(fst(v), snd(v)), m) + json.stringify(json5=json5, compact=compact, data) +end + # Compute cue_file data # @flag extra def cue_file(~request_metadata, ~file_metadata, filename) = @@ -287,6 +302,17 @@ def cue_file(~request_metadata, ~file_metadata, filename) = if force_analysis then args := list.add('-f', args()) end if nice then args := list.add('-n', args()) end + # write metadata to temp file for cue_file to pick up + tempfile = file.temp("cue_file", ".json") + json_meta = meta_json_stringify(compact=true, meta) + log(level=4, label=label, "#{tempfile}: #{json_meta}") + file.write( + data=json_meta, + append=true, + tempfile + ) + args := ['-j', tempfile, ...args()] + res = ref("") try res := @@ -305,6 +331,7 @@ def cue_file(~request_metadata, ~file_metadata, filename) = ) res := "" end + file.remove(tempfile) if res() != "" diff --git a/cue_file b/cue_file index c42368f..417b786 100755 --- a/cue_file +++ b/cue_file @@ -38,12 +38,13 @@ # - Make variable checking more robust (bool & unit suffixes) # - Add `liq_fade_in` & `liq_fade_out` tags for reading/writing, # in case a preprocessor needs to set fade durations. +# 2024-06-11 Moonbase59 - v2.2.0 Sync version numver with autocue.cue_file # # Originally based on an idea and some code by John Warburton (@Warblefly): # https://github.com/Warblefly/TrackBoundaries __author__ = 'Matthias C. Hormann' -__version__ = '2.1.0' +__version__ = '2.2.0' import os import tempfile