mirror of
https://github.com/xhongc/music-tag-web.git
synced 2026-04-25 11:11:27 +08:00
feature:支持编辑专辑艺术家
This commit is contained in:
@@ -14,6 +14,7 @@ class MusicId3Serializer(serializers.Serializer):
|
||||
title = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
artist = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
album = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
albumartist = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
genre = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
year = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
lyrics = serializers.CharField(required=True, allow_null=True, allow_blank=True)
|
||||
|
||||
@@ -28,6 +28,7 @@ def save_music(f, each, is_raw_thumbnail):
|
||||
var_dict = {
|
||||
"title": f["title"].value,
|
||||
"artist": f["artist"].value,
|
||||
"albumartist": f["albumartist"].value,
|
||||
"album": f["album"].value,
|
||||
"filename": base_filename
|
||||
}
|
||||
@@ -46,6 +47,11 @@ def save_music(f, each, is_raw_thumbnail):
|
||||
f["album"] = ConstantTemplate(each["album"]).resolve_data(var_dict)
|
||||
else:
|
||||
f["album"] = each["album"]
|
||||
if each.get("albumartist", None):
|
||||
if "${" in each["albumartist"]:
|
||||
f["albumartist"] = ConstantTemplate(each["albumartist"]).resolve_data(var_dict)
|
||||
else:
|
||||
f["albumartist"] = each["albumartist"]
|
||||
if each.get("genre", None):
|
||||
f["genre"] = each["genre"]
|
||||
if each.get("year", None):
|
||||
|
||||
@@ -245,7 +245,7 @@ def batch_auto_tag_task(batch, source_list, select_mode):
|
||||
folder_list = TaskRecord.objects.filter(batch=batch, icon="icon-folder").all()
|
||||
for folder in folder_list:
|
||||
data = os.scandir(folder.full_path)
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "mp4", "m4a", "ogg", "mpc",
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "m4a", "ogg", "mpc",
|
||||
"opus", "wma", "dsf", "dff"]
|
||||
bulk_set = []
|
||||
for entry in data:
|
||||
|
||||
@@ -46,7 +46,7 @@ class TaskViewSets(GenericViewSet):
|
||||
except FileNotFoundError:
|
||||
return self.failure_response(msg="文件夹不存在")
|
||||
children_data = []
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "mp4", "m4a", "ogg", "mpc",
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "m4a", "ogg", "mpc",
|
||||
"opus", "wma", "dsf", "dff"]
|
||||
frc_map = {}
|
||||
file_data = []
|
||||
@@ -124,6 +124,7 @@ class TaskViewSets(GenericViewSet):
|
||||
"title": f["title"].value or file_title,
|
||||
"artist": f["artist"].value,
|
||||
"album": f["album"].value,
|
||||
"albumartist": f["albumartist"].value,
|
||||
"genre": f["genre"].value,
|
||||
"year": f["year"].value,
|
||||
"lyrics": f["lyrics"].value,
|
||||
@@ -153,7 +154,7 @@ class TaskViewSets(GenericViewSet):
|
||||
if data.get('icon') == 'icon-folder':
|
||||
file_full_path = f"{full_path}/{data.get('name')}"
|
||||
data = os.scandir(file_full_path)
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "mp4", "m4a", "ogg", "mpc",
|
||||
allow_type = ["flac", "mp3", "ape", "wav", "aiff", "wv", "tta", "m4a", "ogg", "mpc",
|
||||
"opus", "wma", "dsf", "dff"]
|
||||
for index, entry in enumerate(data, 1):
|
||||
each = entry.name
|
||||
|
||||
@@ -82,6 +82,12 @@
|
||||
<bk-input :clearable="true" v-model="musicInfo.album"></bk-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<div class="label1">专辑艺术家:</div>
|
||||
<div style="width: 70%;">
|
||||
<bk-input :clearable="true" v-model="musicInfo.albumartist"></bk-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<div class="label1">风格:</div>
|
||||
<div style="width: 70%;">
|
||||
@@ -116,7 +122,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-top: 10px;">
|
||||
<div class="label1">保存歌词lrc:</div>
|
||||
<div class="label1">保存歌词文件:</div>
|
||||
<bk-switcher v-model="musicInfo.is_save_lyrics_file"></bk-switcher>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,6 +186,12 @@
|
||||
<bk-input :clearable="true" v-model="musicInfoManual.album"></bk-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<div class="label1">专辑艺术家:</div>
|
||||
<div style="width: 70%;">
|
||||
<bk-input :clearable="true" v-model="musicInfoManual.albumartist"></bk-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-bottom: 10px;align-items: center;">
|
||||
<div class="label1">风格:</div>
|
||||
<div style="width: 70%;">
|
||||
@@ -214,7 +226,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;margin-top: 10px;">
|
||||
<div class="label1">保存歌词lrc:</div>
|
||||
<div class="label1">保存歌词文件:</div>
|
||||
<bk-switcher v-model="musicInfoManual.is_save_lyrics_file"></bk-switcher>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user