diff --git a/catalog/music/models.py b/catalog/music/models.py index f456d065..2fe917e3 100644 --- a/catalog/music/models.py +++ b/catalog/music/models.py @@ -64,8 +64,9 @@ class Album(Item): duration = jsondata.IntegerField( _("length"), null=True, blank=True, help_text=_("milliseconds") ) - artist = jsondata.JSONField( + artist = jsondata.ArrayField( verbose_name=_("artist"), + base_field=models.CharField(blank=True, default="", max_length=100), null=False, blank=False, default=list, diff --git a/catalog/podcast/models.py b/catalog/podcast/models.py index 5ead99c8..cb5b426c 100644 --- a/catalog/podcast/models.py +++ b/catalog/podcast/models.py @@ -3,7 +3,6 @@ from django.db import models from django.utils.translation import gettext_lazy as _ from ninja import Field -from typing_extensions import deprecated from catalog.common import ( BaseSchema, @@ -52,8 +51,9 @@ class Podcast(Item): language = LanguageListField() - host = jsondata.JSONField( + host = jsondata.ArrayField( verbose_name=_("host"), + base_field=models.CharField(blank=True, default="", max_length=200), null=False, blank=False, default=list, diff --git a/catalog/search/typesense.py b/catalog/search/typesense.py index a1252b86..60034655 100644 --- a/catalog/search/typesense.py +++ b/catalog/search/typesense.py @@ -297,6 +297,8 @@ def obj_to_dict(cls, obj): for field in obj.__class__.indexable_fields_dict: if field.startswith("localized_"): item[field] = [t["text"] for t in getattr(obj, field, [])] + elif field in ["actor", "crew"]: + item[field] = [t["name"] for t in getattr(obj, field, [])] item["id"] = obj.uuid item["category"] = obj.category.value diff --git a/catalog/templates/_item_card_metadata_edition.html b/catalog/templates/_item_card_metadata_edition.html index e7124e0a..fc83db40 100644 --- a/catalog/templates/_item_card_metadata_edition.html +++ b/catalog/templates/_item_card_metadata_edition.html @@ -8,10 +8,6 @@ {% endif %} {% include '_people.html' with people=item.author role='author' max=2 %} {% include '_people.html' with people=item.translator role='translator' max=2 %} - {% include '_people.html' with people=item.director role='director' max=2 %} - {% include '_people.html' with people=item.hosts role='' max=2 %} - {% include '_people.html' with people=item.artist role='' max=2 %} - {% include '_people.html' with people=item.developer role='' max=2 %} {% if item.pub_house %}{{ item.pub_house }}{% endif %} {% if item.pub_year %} diff --git a/catalog/templates/_item_card_metadata_podcast.html b/catalog/templates/_item_card_metadata_podcast.html index e3d925e5..9fcc2644 100644 --- a/catalog/templates/_item_card_metadata_podcast.html +++ b/catalog/templates/_item_card_metadata_podcast.html @@ -6,7 +6,7 @@ {% if item.rating %} {{ item.rating | floatformat:1 }} ({{ item.rating_count }} {% trans "ratings" %}) {% endif %} - {% include '_people.html' with people=item.hosts role='host' max=5 %} + {% include '_people.html' with people=item.host role='host' max=5 %} {% endblock brief %} {% block full %} diff --git a/catalog/templates/_item_comments.html b/catalog/templates/_item_comments.html index bf9be3db..60a0f198 100644 --- a/catalog/templates/_item_comments.html +++ b/catalog/templates/_item_comments.html @@ -39,7 +39,7 @@ data-position="{{ comment.metadata.position|default:0 }}" data-cover="{{ comment.item.cover_url|default:item.cover.url }}" class="episode" - data-hosts="{{ item.hosts|join:' / ' }}" + data-hosts="{{ item.host|join:' / ' }}" data-title="{{ comment.item.display_title }}" data-album="{{ item.display_title }}" {% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' comment.item.uuid %}" {% endif %} diff --git a/catalog/templates/embed_podcast.html b/catalog/templates/embed_podcast.html index 9c2fc460..ef78abe1 100644 --- a/catalog/templates/embed_podcast.html +++ b/catalog/templates/embed_podcast.html @@ -36,7 +36,7 @@ cover: "{{ focus_item.cover_url | default:item.cover.url | escapejs }}", src: "{{ focus_item.media_url | escapejs }}", album: "{{ item.display_title|escapejs }}", - artist: "{{ item.hosts|join:' / '|escapejs }}" + artist: "{{ item.host|join:' / '|escapejs }}" } }); if (position) window.player._initSeek = position; diff --git a/catalog/templates/podcast.html b/catalog/templates/podcast.html index 1ccc6a96..c22a1233 100644 --- a/catalog/templates/podcast.html +++ b/catalog/templates/podcast.html @@ -14,7 +14,7 @@ {% endblock %} {% block details %}
{% include '_people.html' with people=item.genre role='genre' max=5 %}
-
{% include '_people.html' with people=item.hosts role='podcast host' max=5 %}
+
{% include '_people.html' with people=item.host role='podcast host' max=5 %}
{% if item.official_site %} {% trans 'website' %}: {{ item.official_site|urlizetrunc:24 }} @@ -51,7 +51,7 @@
{% trans 'recent episodes' %}
cover: "{{ focus_item.cover_url | default:item.cover.url | escapejs }}", src: "{{ focus_item.media_url | escapejs }}", album: "{{ item.display_title|escapejs }}", - artist: "{{ item.hosts|join:' / '|escapejs }}" + artist: "{{ item.host|join:' / '|escapejs }}" }) if (position) window.player._initSeek = position; {% if request.user.is_authenticated %} diff --git a/catalog/templates/podcast_episode_data.html b/catalog/templates/podcast_episode_data.html index 854aed9c..002f6779 100644 --- a/catalog/templates/podcast_episode_data.html +++ b/catalog/templates/podcast_episode_data.html @@ -12,7 +12,7 @@
data-uuid="{{ ep.uuid }}" data-title="{{ ep.display_title }}" data-album="{{ item.display_title }}" - data-hosts="{{ item.hosts|join:' / ' }}" + data-hosts="{{ item.host|join:' / ' }}" {% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' ep.uuid %}" {% endif %} style="top:4px; margin-right: 8px"> diff --git a/catalog/tv/models.py b/catalog/tv/models.py index ffada0e1..2b632fc1 100644 --- a/catalog/tv/models.py +++ b/catalog/tv/models.py @@ -372,9 +372,9 @@ class TVSeason(Item): blank=True, default=list, ) - language = jsondata.JSONField( + language = jsondata.ArrayField( verbose_name=_("language"), - # base_field=models.CharField(blank=True, default="", max_length=100, choices=LANGUAGE_CHOICES ), + base_field=models.CharField(blank=True, default="", max_length=100), null=True, blank=True, default=list, diff --git a/common/templates/_sidebar.html b/common/templates/_sidebar.html index b82929d7..f26b1019 100644 --- a/common/templates/_sidebar.html +++ b/common/templates/_sidebar.html @@ -108,7 +108,7 @@
{{ identity.display_name }}
data-cover="{{ item.cover_url|default:item.program.cover.url }}" data-title="{{ item.display_title }}" data-album="{{ item.program.display_title }}" - data-hosts="{{ item.program.hosts|join:' / ' }}" + data-hosts="{{ item.program.host|join:' / ' }}" {% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' item.uuid %}" {% endif %} data-position="0" href="{{ item.url }}" diff --git a/compose.yml b/compose.yml index f97ab9ff..0c93c376 100644 --- a/compose.yml +++ b/compose.yml @@ -122,7 +122,7 @@ services: - ${NEODB_DATA:-../data}/redis:/data typesense: - image: typesense/typesense:0.25.2 + image: typesense/typesense:${TYPESENSE_VERSION:-0.25.2} restart: "on-failure" # healthcheck: # test: ['CMD', 'curl', '-vf', 'http://127.0.0.1:8108/health'] @@ -132,12 +132,12 @@ services: GLOG_minloglevel: 2 volumes: - ${NEODB_DATA:-../data}/typesense:/data - command: '--data-dir /data --api-key=eggplant' + command: "--data-dir /data --api-key=eggplant" neodb-db: - image: postgres:14-alpine + image: postgres:${POSTGRES_VERSION:-14-alpine} healthcheck: - test: ['CMD', 'pg_isready', '-U', 'neodb'] + test: ["CMD", "pg_isready", "-U", "neodb"] volumes: - ${NEODB_DATA:-../data}/neodb-db:/var/lib/postgresql/data environment: @@ -146,9 +146,9 @@ services: - POSTGRES_PASSWORD=aubergine takahe-db: - image: postgres:14-alpine + image: postgres:${POSTGRES_VERSION:-14-alpine} healthcheck: - test: ['CMD', 'pg_isready', '-U', 'takahe'] + test: ["CMD", "pg_isready", "-U", "takahe"] volumes: - ${NEODB_DATA:-../data}/takahe-db:/var/lib/postgresql/data environment: @@ -174,7 +174,15 @@ services: <<: *neodb-service command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 --timeout 60 -b 0.0.0.0:8000 healthcheck: - test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/'] + test: + [ + "CMD", + "wget", + "-qO/tmp/test", + "--header", + "X-Forwarded-Proto: https", + "http://127.0.0.1:8000/nodeinfo/2.0/", + ] depends_on: migration: condition: service_completed_successfully @@ -183,7 +191,15 @@ services: <<: *neodb-service command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 --timeout 30 -b 0.0.0.0:8000 healthcheck: - test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/'] + test: + [ + "CMD", + "wget", + "-qO/tmp/test", + "--header", + "X-Forwarded-Proto: https", + "http://127.0.0.1:8000/nodeinfo/2.0/", + ] depends_on: migration: condition: service_completed_successfully @@ -206,7 +222,15 @@ services: <<: *neodb-service command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --timeout 60 --preload -b 0.0.0.0:8000 healthcheck: - test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/api/v1/instance'] + test: + [ + "CMD", + "wget", + "-qO/tmp/test", + "--header", + "X-Forwarded-Proto: https", + "http://127.0.0.1:8000/api/v1/instance", + ] depends_on: migration: condition: service_completed_successfully diff --git a/social/templates/feed_events.html b/social/templates/feed_events.html index b446a7be..0f202598 100644 --- a/social/templates/feed_events.html +++ b/social/templates/feed_events.html @@ -45,7 +45,7 @@ data-cover="{{ item.cover_url|default:item.parent_item.cover.url }}" data-title="{{ item.display_title }}" data-album="{{ item.parent_item.display_title }}" - data-hosts="{{ item.parent_item.hosts|join:' / ' }}" + data-hosts="{{ item.parent_item.host|join:' / ' }}" {% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' item.uuid %}" {% endif %} data-position="{{ piece.metadata.position | default:0 }}"> {% else %}