feat: some tags function

This commit is contained in:
Terry Geng
2020-03-07 16:07:58 +08:00
parent 659fab48b4
commit 749647aad2
7 changed files with 114 additions and 7 deletions

View File

@ -60,6 +60,16 @@ class BaseItem:
def prepare(self):
return True
def add_tag(self, tag):
if tag not in self.tags:
self.tags.append(tag)
self.version += 1
def remove_tag(self, tag):
if tag not in self.tags:
self.tags.remove(tag)
self.version += 1
def format_song_string(self, user):
return self.id