Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opengraph show detail #352

Merged
merged 2 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion etl/management/commands/backfill_mp3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import requests
import tqdm
from http import HTTPStatus
from django.core.management.base import BaseCommand
from django.core.files.base import ContentFile
Expand All @@ -17,7 +18,7 @@ def handle(self, *args, **options) -> None:

upload_to = media_models.MP3.file.field.upload_to

for enclosure in enclosures:
for enclosure in tqdm.tqdm(enclosures):
filename = requests.utils.urlparse(
enclosure.url
).path.split("/").pop()
Expand Down
9 changes: 9 additions & 0 deletions shows/templates/shows/show_detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{% extends "base.html" %}
{% block title %}{{ show.title }}{% endblock title %}
{% block opengraphextra %}
<meta property="og:title" content="{{ show.title }}" />
{% if show.description %}
<meta property="og:description" content="{{ show.description }}" />
{% endif %}
{% if show.logo %}
<meta property="og:image" content="{{ show.logo.url }}" />
{% endif %}
{% endblock opengraphextra %}
{% block extrahead %}
{% comment "TODO" %}
<link rel="canonical" href="{% url "show-detail" show.slug %}" />
Expand Down