Skip to content

Commit

Permalink
fix edition title display issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and alphatownsman committed Jul 16, 2024
1 parent be72c1d commit fce6759
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion catalog/book/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Edition(Item):
imprint = jsondata.CharField(_("imprint"), null=True, blank=True, max_length=500)

def get_localized_subtitle(self) -> str | None:
return self.localized_title[0]["text"] if self.localized_subtitle else None
return self.localized_subtitle[0]["text"] if self.localized_subtitle else None

@property
def display_subtitle(self) -> str | None:
Expand Down
4 changes: 3 additions & 1 deletion catalog/sites/google_books.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def scrape(self):
pub_house = (
b["volumeInfo"]["publisher"] if "publisher" in b["volumeInfo"] else None
)
language = b["volumeInfo"]["language"] if "language" in b["volumeInfo"] else []
language = (
b["volumeInfo"]["language"].lower() if "language" in b["volumeInfo"] else []
)

pages = b["volumeInfo"]["pageCount"] if "pageCount" in b["volumeInfo"] else None
if "mainCategory" in b["volumeInfo"]:
Expand Down
26 changes: 12 additions & 14 deletions catalog/templates/item_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,18 @@ <h3>
</div>
<div id="item-title-more" class="middle">
<hgroup>
<p>
{% if item.display_subtitle %}{{ item.display_subtitle }}{% endif %}
{% if item.orig_title and item.orig_title != item.display_title %}
<p>
{{ item.orig_title }}
<small>
{% if item.season_number %}Season {{ item.season_number }}{% endif %}
</small>
</p>
{% endif %}
{% if item.parent_item %}
{% trans 'part of' %} {{ item.parent_item.type.label }}: <span><a href="{{ item.parent_item.url }}"></span>{{ item.parent_item.display_title }}</a>
{% endif %}
</p>
{% if item.display_subtitle %}<p>{{ item.display_subtitle }}</p>{% endif %}
{% if item.orig_title and item.orig_title != item.display_title %}
<p>
{{ item.orig_title }}
<small>
{% if item.season_number %}Season {{ item.season_number }}{% endif %}
</small>
</p>
{% endif %}
{% if item.parent_item %}
{% trans 'part of' %} {{ item.parent_item.type.label }}: <span><a href="{{ item.parent_item.url }}"></span>{{ item.parent_item.display_title }}</a>
{% endif %}
{% if item.author or item.translator %}
<p>
<i>
Expand Down
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ services:

neodb-worker:
<<: *neodb-service
command: neodb-manage rqworker-pool --num-workers ${NEODB_RQ_WORKER_NUM:-4} --with-scheduler import export mastodon fetch crawl ap cron
command: neodb-manage rqworker --with-scheduler import export mastodon fetch crawl ap cron
depends_on:
migration:
condition: service_completed_successfully
Expand Down

0 comments on commit fce6759

Please sign in to comment.