Return set instead of list from get_parents, get_tags.

master
voussoir 2020-09-14 18:34:14 -07:00
parent dd0ee7a72a
commit 8279a1871b
1 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ class GroupableMixin:
query = f'SELECT parentid FROM {self.group_table} WHERE memberid == ?' query = f'SELECT parentid FROM {self.group_table} WHERE memberid == ?'
parent_rows = self.photodb.sql_select(query, [self.id]) parent_rows = self.photodb.sql_select(query, [self.id])
parent_ids = [row[0] for row in parent_rows] parent_ids = [row[0] for row in parent_rows]
parents = list(self.group_getter_many(parent_ids)) parents = set(self.group_getter_many(parent_ids))
return parents return parents
def has_any_child(self): def has_any_child(self):
@ -847,7 +847,7 @@ class Photo(ObjectBase):
[self.id] [self.id]
) )
tag_ids = [row[0] for row in tag_ids] tag_ids = [row[0] for row in tag_ids]
tags = list(self.photodb.get_tags_by_id(tag_ids)) tags = set(self.photodb.get_tags_by_id(tag_ids))
return tags return tags
def has_tag(self, tag, *, check_children=True): def has_tag(self, tag, *, check_children=True):