fix for lyrics
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import mutagen
|
||||
from mutagen.id3 import ID3, Frame, APIC
|
||||
from mutagen.id3 import ID3, Frame, APIC, USLT
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
import logging
|
||||
@@ -7,6 +7,7 @@ from PIL import Image
|
||||
|
||||
from ..utils.config import logging_settings, main_settings
|
||||
from ..objects import Song, Target, Metadata
|
||||
from ..objects.metadata import Mapping
|
||||
from ..connection import Connection
|
||||
|
||||
LOGGER = logging_settings["tagging_logger"]
|
||||
@@ -105,6 +106,11 @@ def write_metadata_to_target(metadata: Metadata, target: Target, song: Song):
|
||||
data=converted_target.read_bytes(),
|
||||
)
|
||||
)
|
||||
id3_object.frames.delall("USLT")
|
||||
uslt_val = metadata.get_id3_value(Mapping.UNSYNCED_LYRICS)
|
||||
id3_object.frames.add(
|
||||
USLT(encoding=3, lang=u'eng', desc=u'desc', text=uslt_val)
|
||||
)
|
||||
|
||||
mutagen_file = mutagen.File(target.file_path)
|
||||
|
||||
|
Reference in New Issue
Block a user