diff --git a/content/sch001-aller-anfang-ist-schwer.jpg b/content/sch001-aller-anfang-ist-schwer.jpg deleted file mode 100644 index 796e4b6..0000000 --- a/content/sch001-aller-anfang-ist-schwer.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e1c6bfddd276b52a18c1950dbc904d9d8aabb88864151ceb0a1b54489281035d -size 28024 diff --git a/content/sch001-aller-anfang-ist-schwer.md b/content/sch001-aller-anfang-ist-schwer.md index 53c22ff..273eefd 100644 --- a/content/sch001-aller-anfang-ist-schwer.md +++ b/content/sch001-aller-anfang-ist-schwer.md @@ -10,7 +10,6 @@ contributors = [ "Cartaphilus", "Autoren des Artikels", ] -poster = true [taxonomies] formats = ["opus", "m4a", "oga", "mp3"] diff --git a/encode.py b/encode.py index 38e1d2b..0ea666e 100755 --- a/encode.py +++ b/encode.py @@ -24,7 +24,7 @@ def encode_episode(podcast, episode, format): try: changed = any( os.path.getmtime(file) > os.path.getmtime(outfile) - for file in [infile, content_file, episode["poster"]] + for file in [infile, content_file, podcast["poster"]] ) except FileNotFoundError: changed = True @@ -44,7 +44,7 @@ def encode_episode(podcast, episode, format): command = ["ffmpeg", "-y", "-loglevel", "error"] command.extend(["-i", infile]) if format not in ["oga", "opus"]: - command.extend(["-i", episode["poster"]]) + command.extend(["-i", podcast["poster"]]) # For AAC, the default codec choice (ffmpeg native) is not the best choice if format == "m4a": command.extend(["-c:a", "libfdk_aac"]) @@ -63,7 +63,7 @@ def encode_episode(podcast, episode, format): # poster picture = Picture() - with open(episode["poster"], "rb") as f: + with open(podcast["poster"], "rb") as f: picture.data = f.read() picture.type = 17 picture.desc = "" @@ -114,12 +114,6 @@ for item in channel.findall("item"): )[0], } - episode_poster = f"content/{episode['file_base']}.jpg" - if os.path.isfile(episode_poster): - episode["poster"] = episode_poster - else: - episode["poster"] = podcast["poster"] - print(episode["file_base"], end="", flush=True) threads = [] diff --git a/templates/macros.html b/templates/macros.html index a24c972..b8cf741 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -13,9 +13,6 @@ data-colors="{{ config.extra.theme.main | default(value="#2B8AC6") }}" > {% endmacro podlove_subscribe_button %} -{% macro poster(page) -%} -{% if page.extra.poster %}{{ get_url(path=page.slug ~ ".jpg") | safe }}{% else %}{{ get_url(path="assets/poster.jpg") | safe }}{% endif %} -{%- endmacro poster %} {% macro title(page) -%} {#- tera lacks zero padding and also log operator -#} {%- if page.extra.episode -%} diff --git a/templates/page.html b/templates/page.html index b942c62..3bf0440 100644 --- a/templates/page.html +++ b/templates/page.html @@ -6,14 +6,14 @@ - + - + {%- for format in config.extra.formats %} diff --git a/templates/podlove-player.html b/templates/podlove-player.html index 758e7f0..24a304a 100644 --- a/templates/podlove-player.html +++ b/templates/podlove-player.html @@ -25,7 +25,7 @@ "subtitle": {{ page.extra.subtitle | default(value="") | json_encode | safe }}, "summary": {{ page.description | json_encode | safe }}, "publicationDate": {{ page.date | date(format="%+") | json_encode | safe }}, - "poster": {{ macros::poster(page=page) | json_encode | safe }}, + "poster": {{ get_url(path="assets/poster.jpg") | safe | json_encode | safe }}, "duration": {{ episodes[page.slug].duration | json_encode | safe }}, "link": {{ page.permalink | json_encode | safe }},