From 5357a40ea79263adc1e876323cd5765b490f53c8 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 11 Nov 2020 01:03:09 +1100 Subject: [PATCH] playlist_manager: Compare tags case-insensitively To avoid confusion between eg. "Interview" and "interview" --- playlist_manager/playlist_manager/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playlist_manager/playlist_manager/main.py b/playlist_manager/playlist_manager/main.py index 2d8bdcb..008bcfc 100644 --- a/playlist_manager/playlist_manager/main.py +++ b/playlist_manager/playlist_manager/main.py @@ -82,7 +82,7 @@ class PlaylistManager(object): # Filter the video list for videos with matching tags matching = [ video for video in videos.values() - if all(tag in video.tags for tag in tags) + if all(tag in [t.lower() for t in video.tags] for tag in tags) ] logging.debug("Found {} matching videos for playlist {}".format(len(matching), playlist)) # If we have nothing to add, short circuit without doing any API calls to save quota. @@ -244,7 +244,7 @@ class ListQuery(object): def parse_playlist_arg(arg): playlist, tags = arg.split('=', 1) - tags = tags.split(",") if tags else [] + tags = tags.split(",").lower() if tags else [] return playlist, tags