Skip to content

Commit

Permalink
Opengraph show detail (#352)
Browse files Browse the repository at this point in the history
* Add tqdm to backfill command

* Add opengraph metadata to show detail page
  • Loading branch information
Apreche authored Sep 24, 2023
1 parent 612fc57 commit d081e39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit d081e39

Please sign in to comment.