Support for comma separated tags

This commit is contained in:
Leigh Morresi
2021-01-30 11:22:59 +01:00
parent e589b441db
commit 3eaccfe5da
3 changed files with 14 additions and 5 deletions

View File

@@ -85,9 +85,13 @@ def main_page():
sorted_watches = []
for uuid, watch in datastore.data['watching'].items():
if limit_tag != None:
if watch['tag'] == limit_tag:
watch['uuid'] = uuid
sorted_watches.append(watch)
# Support for comma separated list of tags.
for tag_in_watch in watch['tag'].split(','):
tag_in_watch = tag_in_watch.strip()
if tag_in_watch == limit_tag:
watch['uuid'] = uuid
sorted_watches.append(watch)
else:
watch['uuid'] = uuid
sorted_watches.append(watch)