From 29aba9c6f89e5e00e9783d6f89304855e874b8bd Mon Sep 17 00:00:00 2001 From: veclav talica Date: Thu, 25 May 2023 11:14:13 +0500 Subject: [PATCH] gzipped base64 tracks --- cook_tracks.sh | 9 ++++++++ tools/track_listing_generator.py | 36 ++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100755 cook_tracks.sh diff --git a/cook_tracks.sh b/cook_tracks.sh new file mode 100755 index 0000000..cb60463 --- /dev/null +++ b/cook_tracks.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +set +e +shopt -s extglob + +for f in $1/!(*AutoSave*).xm +do + gzip -c $f | base64 --wrap=0 - | tr -d '\n' > $2/$(basename -- $f).txt +done diff --git a/tools/track_listing_generator.py b/tools/track_listing_generator.py index 4f086fb..d9087f5 100755 --- a/tools/track_listing_generator.py +++ b/tools/track_listing_generator.py @@ -17,26 +17,43 @@ page = """ @@ -64,7 +81,8 @@ page = """ for _, _, files in walk(argv[1]): files.sort() for f in files: - if not f.endswith('.xm'): + # note: Base64 gzip encoded data is expected. + if not f.endswith('.xm.txt'): continue page += ( f"""

{f}

\n"""