thrimshim: Fix bug where description playlists header was added with zero playlists

We only want it to show at all if there's at least one playlist.
pull/308/head
Mike Lang 2 years ago
parent 8ea985c07a
commit 85c4319f2a

@ -292,13 +292,15 @@ def update_row(ident, editor=None):
# Include headers and footers
new_row['video_title'] = app.title_header + new_row['video_title']
# NOTE: If you change this format, you need to also change the regex that matches this
# on the GET handler.
description_lines = [DESCRIPTION_PLAYLISTS_HEADER]
description_lines += [
"- {} [https://youtube.com/playlist?list={}]".format(playlist.name, playlist.playlist_id)
for playlist in playlists
]
description_lines = []
if playlists:
# NOTE: If you change this format, you need to also change the regex that matches this
# on the GET handler.
description_lines.append(DESCRIPTION_PLAYLISTS_HEADER)
description_lines += [
"- {} [https://youtube.com/playlist?list={}]".format(playlist.name, playlist.playlist_id)
for playlist in playlists
]
description_lines.append(app.description_footer)
new_row['video_description'] += "\n".join(description_lines)

Loading…
Cancel
Save