fix: update playlist item based on id #90.
This commit is contained in:
12
util.py
12
util.py
@ -74,8 +74,18 @@ def get_music_path(music):
|
||||
|
||||
return uri
|
||||
|
||||
def attach_item_id(item):
|
||||
if item['type'] == 'url':
|
||||
item['id'] = hashlib.md5(item['url'].encode()).hexdigest()
|
||||
elif item['type'] == 'file':
|
||||
item['id'] = hashlib.md5(item['path'].encode()).hexdigest()
|
||||
elif item['type'] == 'radio':
|
||||
item['id'] = hashlib.md5(item['url'].encode()).hexdigest()
|
||||
return item
|
||||
|
||||
def attach_music_tag_info(music):
|
||||
music = attach_item_id(music)
|
||||
|
||||
def get_music_tag_info(music):
|
||||
if "path" in music:
|
||||
uri = get_music_path(music)
|
||||
|
||||
|
Reference in New Issue
Block a user