Skip to content

Commit

Permalink
fix(album-update): ♻️ Only include subtitle in sort if not in a series
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Nov 2, 2021
1 parent b89a2e5 commit 2022dbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Contents/Code/__init__.py
Expand Up @@ -471,14 +471,22 @@ def compile_metadata(self, helper):
tagger.add_authors_to_moods()
# Series.
tagger.add_series_to_moods()
# Setup title + subtitle where available.
if helper.subtitle:
album_title = helper.title + ': ' + helper.subtitle
else:
album_title = helper.title
# Title.
if not helper.metadata.title or helper.force:
helper.metadata.title = helper.title
helper.metadata.title = album_title
# Sort Title.
# Add series/volume to sort title where possible.
series_with_volume = ''
if helper.series and helper.volume:
series_with_volume = helper.series + ', ' + helper.volume
# Only include subtitle in sort if not in a series
if not helper.volume:
helper.title = album_title
if not helper.metadata.title_sort or helper.force:
helper.metadata.title_sort = ' - '.join(
filter(
Expand Down
8 changes: 4 additions & 4 deletions Contents/Code/update_tools.py
Expand Up @@ -18,6 +18,7 @@ def __init__(self, force, lang, media, metadata):
self.rating = None
self.series = ''
self.series2 = ''
self.subtitle = ''
self.thumb = ''
self.volume = ''
self.volume2 = ''
Expand Down Expand Up @@ -50,11 +51,10 @@ def parse_api_response(self, response):
self.synopsis = response['summary']
if 'image' in response:
self.thumb = response['image']
if 'subtitle' in response:
self.subtitle = response['subtitle']
if 'title' in response:
if 'subtitle' in response:
self.title = response['title'] + ': ' + response['subtitle']
else:
self.title = response['title']
self.title = response['title']

# Writes metadata information to log.
def writeInfo(self):
Expand Down

0 comments on commit 2022dbd

Please sign in to comment.