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",
|
"Cartaphilus",
|
||||||
"Autoren des Artikels",
|
"Autoren des Artikels",
|
||||||
]
|
]
|
||||||
poster = true
|
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
formats = ["opus", "m4a", "oga", "mp3"]
|
formats = ["opus", "m4a", "oga", "mp3"]
|
||||||
|
|
12
encode.py
12
encode.py
|
@ -24,7 +24,7 @@ def encode_episode(podcast, episode, format):
|
||||||
try:
|
try:
|
||||||
changed = any(
|
changed = any(
|
||||||
os.path.getmtime(file) > os.path.getmtime(outfile)
|
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:
|
except FileNotFoundError:
|
||||||
changed = True
|
changed = True
|
||||||
|
@ -44,7 +44,7 @@ def encode_episode(podcast, episode, format):
|
||||||
command = ["ffmpeg", "-y", "-loglevel", "error"]
|
command = ["ffmpeg", "-y", "-loglevel", "error"]
|
||||||
command.extend(["-i", infile])
|
command.extend(["-i", infile])
|
||||||
if format not in ["oga", "opus"]:
|
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
|
# For AAC, the default codec choice (ffmpeg native) is not the best choice
|
||||||
if format == "m4a":
|
if format == "m4a":
|
||||||
command.extend(["-c:a", "libfdk_aac"])
|
command.extend(["-c:a", "libfdk_aac"])
|
||||||
|
@ -63,7 +63,7 @@ def encode_episode(podcast, episode, format):
|
||||||
|
|
||||||
# poster
|
# poster
|
||||||
picture = Picture()
|
picture = Picture()
|
||||||
with open(episode["poster"], "rb") as f:
|
with open(podcast["poster"], "rb") as f:
|
||||||
picture.data = f.read()
|
picture.data = f.read()
|
||||||
picture.type = 17
|
picture.type = 17
|
||||||
picture.desc = ""
|
picture.desc = ""
|
||||||
|
@ -114,12 +114,6 @@ for item in channel.findall("item"):
|
||||||
)[0],
|
)[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)
|
print(episode["file_base"], end="", flush=True)
|
||||||
|
|
||||||
threads = []
|
threads = []
|
||||||
|
|
|
@ -13,9 +13,6 @@
|
||||||
data-colors="{{ config.extra.theme.main | default(value="#2B8AC6") }}"
|
data-colors="{{ config.extra.theme.main | default(value="#2B8AC6") }}"
|
||||||
></script>
|
></script>
|
||||||
{% endmacro podlove_subscribe_button %}
|
{% 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) -%}
|
{% macro title(page) -%}
|
||||||
{#- tera lacks zero padding and also log operator -#}
|
{#- tera lacks zero padding and also log operator -#}
|
||||||
{%- if page.extra.episode -%}
|
{%- if page.extra.episode -%}
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
<meta name="twitter:card" content="summary">
|
<meta name="twitter:card" content="summary">
|
||||||
<meta name="twitter:title" content="{{ page.title }}">
|
<meta name="twitter:title" content="{{ page.title }}">
|
||||||
<meta name="twitter:description" content="{{ page.description }}">
|
<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:type" content="website">
|
||||||
<meta property="og:site_name" content="{{ config.title }}">
|
<meta property="og:site_name" content="{{ config.title }}">
|
||||||
<meta property="og:title" content="{{ page.title }}">
|
<meta property="og:title" content="{{ page.title }}">
|
||||||
<meta property="og:url" content="{{ page.permalink }}">
|
<meta property="og:url" content="{{ page.permalink }}">
|
||||||
<meta property="og:description" content="{{ page.description }}">
|
<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 %}
|
{%- for format in config.extra.formats %}
|
||||||
<meta property="og:audio" content="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | safe }}">
|
<meta property="og:audio" content="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | safe }}">
|
||||||
<meta property="og:audio:type" content="{{ format.mime_type }}">
|
<meta property="og:audio:type" content="{{ format.mime_type }}">
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"subtitle": {{ page.extra.subtitle | default(value="") | json_encode | safe }},
|
"subtitle": {{ page.extra.subtitle | default(value="") | json_encode | safe }},
|
||||||
"summary": {{ page.description | json_encode | safe }},
|
"summary": {{ page.description | json_encode | safe }},
|
||||||
"publicationDate": {{ page.date | date(format="%+") | 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 }},
|
"duration": {{ episodes[page.slug].duration | json_encode | safe }},
|
||||||
"link": {{ page.permalink | json_encode | safe }},
|
"link": {{ page.permalink | json_encode | safe }},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue