From 14ff4a39a6441f4c0e272aa3fbcf07089a7480fe Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 17 Dec 2021 15:30:25 +0100 Subject: [PATCH] Use flac instead of opus as source file format Using opus was a workaround when I still used drone for deployments. Since it now is deployed from my local machine, having FLACs in the repository is not that problematic. --- .gitattributes | 2 +- common.py | 7 ++----- config.toml | 4 ++-- content/sch001-aller-anfang-ist-schwer.opus | 3 --- content/sch002-noch-mehr-boilerplate.opus | 3 --- encode.py | 2 +- metadata.py | 2 +- 7 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 content/sch001-aller-anfang-ist-schwer.opus delete mode 100644 content/sch002-noch-mehr-boilerplate.opus diff --git a/.gitattributes b/.gitattributes index 893b582..6233f2d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ *.jpg filter=lfs diff=lfs merge=lfs -text -content/*.opus filter=lfs diff=lfs merge=lfs -text +content/*.flac filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text content/imprint-email.svg filter=lfs diff=lfs merge=lfs -text static/favicon.ico filter=lfs diff=lfs merge=lfs -text diff --git a/common.py b/common.py index 62706d9..c0ecffc 100644 --- a/common.py +++ b/common.py @@ -1,6 +1,6 @@ -from subprocess import run import json import time +from subprocess import run ACRONYM = "sch" @@ -22,14 +22,11 @@ FORMATS = { def path_to_episode(name, format): - if format in ["original", "txt", "md"]: + if format in ["flac", "md"]: base = "content" else: base = "static/episodes" - if format == "original": - format = "opus" - return f"{base}/{name}.{format}" diff --git a/config.toml b/config.toml index bee5a35..0078381 100644 --- a/config.toml +++ b/config.toml @@ -2,8 +2,8 @@ base_url = "https://schulischer-schabernack.de" compile_sass = true default_language = "de" feed_filename = "rss.xml" -# source opus files are not published -ignored_content = ["sch???-*.opus", "sch???-*.txt"] +# source files are not published +ignored_content = ["sch???-*.flac"] title = "Schulischer Schabernack" description = ''' diff --git a/content/sch001-aller-anfang-ist-schwer.opus b/content/sch001-aller-anfang-ist-schwer.opus deleted file mode 100644 index d1368e0..0000000 --- a/content/sch001-aller-anfang-ist-schwer.opus +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce2c169dca6a2f05f86e2fc985c936995bd512fadd5cc311fe8e3e98b9cc5ec4 -size 28838954 diff --git a/content/sch002-noch-mehr-boilerplate.opus b/content/sch002-noch-mehr-boilerplate.opus deleted file mode 100644 index e01336e..0000000 --- a/content/sch002-noch-mehr-boilerplate.opus +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:441d488044d98882756c340c010236427b2ece8c478379752026308feb106b8f -size 13379005 diff --git a/encode.py b/encode.py index 7255560..57aabcd 100755 --- a/encode.py +++ b/encode.py @@ -18,7 +18,7 @@ import common def encode_episode(podcast, episode, format): format, options = format - infile = common.path_to_episode(episode["file_base"], "original") + infile = common.path_to_episode(episode["file_base"], "flac") outfile = common.path_to_episode(episode["file_base"], format) content_file = common.path_to_episode(episode["file_base"], "md") diff --git a/metadata.py b/metadata.py index 4b1c7d7..a46ab8e 100755 --- a/metadata.py +++ b/metadata.py @@ -40,7 +40,7 @@ for file in sorted(glob(f"content/{common.ACRONYM}*.md")): metadata[episode] = {} metadata[episode]["duration"] = common.sexagesimal( - float(common.get_episode_info(episode, "original")["duration"]) + float(common.get_episode_info(episode, "flac")["duration"]) ) metadata[episode]["formats"] = {}