newsletter implementation

This commit is contained in:
herby2212 2023-01-06 20:57:17 +01:00
commit 77bd6129a8

View file

@ -766,9 +766,17 @@ class RecentlyAdded(Newsletter):
for (index, title), children in groupby(filtered_children,
key=lambda x: (x['parent_media_index'], x['parent_title'])):
episodes = list(children)
#TODO How do we want to display the episode range in the newsletter
num, num00 = format_group_index([helpers.cast_to_int(d['media_index']) for d in episodes])
isDateBased = True
for e in episodes:
if e['media_index']:
isDateBased = False
break
if isDateBased:
num00 = helpers.format_date_based_show(episodes[0]['originally_available_at']) + " - " + helpers.format_date_based_show(episodes[len(episodes)-1]['originally_available_at'])
else:
num, num00 = format_group_index([helpers.cast_to_int(d['media_index']) for d in episodes])
seasons.append({'media_index': index,
'title': title,
@ -786,6 +794,7 @@ class RecentlyAdded(Newsletter):
show_rating_keys.append(show_rating_key)
recently_added = shows_list
logger.info(recently_added)
if media_type == 'artist':
artists_list = []