From 6cf475793b6b11c095596c3d8f15bcb100f1be6e Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Sun, 10 Nov 2024 20:43:39 -0800 Subject: [PATCH] Fixes in response to PR comments --- thrimshim/thrimshim/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index 0316d88..c2c3c56 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -277,7 +277,7 @@ def get_row(ident): and response["video_title"].startswith(title_header) ): response["video_title"] = response["video_title"][len(title_header):] - description_playlist_re = re.compile(r"\n\n({}\n(- .* \[https://youtube.com/playlist\?list=[A-Za-z0-9_-]+\]\n)+\n)?{}\n{}$".format( + description_playlist_re = re.compile(r"\n\n({}\n(- .* \[https://youtube.com/playlist\?list=[A-Za-z0-9_-]+\]\n)+\n)?({}[^\n]+\n)?{}$".format( re.escape(DESCRIPTION_PLAYLISTS_HEADER), re.escape(DESCRIPTION_THUMBNAIL_HEADER), re.escape(app.description_footer), @@ -387,6 +387,7 @@ def update_row(ident, editor=None): template = database.query(conn, """ SELECT description FROM templates WHERE name = %s """, new_row['thumbnail_template']) + template = results.fetchone() if template.description: description_lines += [DESCRIPTION_THUMBNAIL_HEADER + template.description] description_lines.append(app.description_footer)