Browse Source

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.
master
Simon Bruder 10 months ago
parent
commit
14ff4a39a6
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
  1. 2
      .gitattributes
  2. 7
      common.py
  3. 4
      config.toml
  4. BIN
      content/sch001-aller-anfang-ist-schwer.opus
  5. BIN
      content/sch002-noch-mehr-boilerplate.opus
  6. 2
      encode.py
  7. 2
      metadata.py

2
.gitattributes vendored

@ -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

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

4
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 = '''

BIN
content/sch001-aller-anfang-ist-schwer.opus (Stored with Git LFS)

Binary file not shown.

BIN
content/sch002-noch-mehr-boilerplate.opus (Stored with Git LFS)

Binary file not shown.

2
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")

2
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"] = {}

Loading…
Cancel
Save