diff options
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/tag_index.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/service/pixelated/adapter/tag_index.py b/service/pixelated/adapter/tag_index.py index 25108643..ea69be1a 100644 --- a/service/pixelated/adapter/tag_index.py +++ b/service/pixelated/adapter/tag_index.py @@ -34,6 +34,10 @@ class TagIndex: self.close_db() # force flush self.db = dbm.open(self.db_path, 'c') + def add(self, tag): + if tag.name not in self.db: + self.set(tag) + def get(self, tag_name): if tag_name in self.db: return Tag.from_json_string(self.db.get(tag_name)) |