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 # Include headers and footers
new_row['video_title'] = app.title_header + new_row['video_title'] 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 description_lines = []
# on the GET handler. if playlists:
description_lines = [DESCRIPTION_PLAYLISTS_HEADER] # NOTE: If you change this format, you need to also change the regex that matches this
description_lines += [ # on the GET handler.
"- {} [https://youtube.com/playlist?list={}]".format(playlist.name, playlist.playlist_id) description_lines.append(DESCRIPTION_PLAYLISTS_HEADER)
for playlist in playlists description_lines += [
] "- {} [https://youtube.com/playlist?list={}]".format(playlist.name, playlist.playlist_id)
for playlist in playlists
]
description_lines.append(app.description_footer) description_lines.append(app.description_footer)
new_row['video_description'] += "\n".join(description_lines) new_row['video_description'] += "\n".join(description_lines)

Loading…
Cancel
Save