Remove per-episode poster feature
We won’t use it.
This commit is contained in:
parent
e7abbea3bc
commit
ce403a97a3
BIN
content/sch001-aller-anfang-ist-schwer.jpg
(Stored with Git LFS)
BIN
content/sch001-aller-anfang-ist-schwer.jpg
(Stored with Git LFS)
Binary file not shown.
|
@ -10,7 +10,6 @@ contributors = [
|
|||
"Cartaphilus",
|
||||
"Autoren des Artikels",
|
||||
]
|
||||
poster = true
|
||||
|
||||
[taxonomies]
|
||||
formats = ["opus", "m4a", "oga", "mp3"]
|
||||
|
|
12
encode.py
12
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 = []
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
data-colors="{{ config.extra.theme.main | default(value="#2B8AC6") }}"
|
||||
></script>
|
||||
{% 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 -%}
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="{{ page.title }}">
|
||||
<meta name="twitter:description" content="{{ page.description }}">
|
||||
<meta name="twitter:image" content="{{ macros::poster(page=page) }}">
|
||||
<meta name="twitter:image" content="{{ get_url(path="assets/poster.jpg") | safe }}">
|
||||
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="{{ config.title }}">
|
||||
<meta property="og:title" content="{{ page.title }}">
|
||||
<meta property="og:url" content="{{ page.permalink }}">
|
||||
<meta property="og:description" content="{{ page.description }}">
|
||||
<meta property="og:image" content="{{ macros::poster(page=page) }}">
|
||||
<meta property="og:image" content="{{ get_url(path="assets/poster.jpg") | safe }}">
|
||||
{%- for format in config.extra.formats %}
|
||||
<meta property="og:audio" content="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | safe }}">
|
||||
<meta property="og:audio:type" content="{{ format.mime_type }}">
|
||||
|
|
|
@ -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 }},
|
||||
|
||||
|
|
Loading…
Reference in a new issue