From 46a270f4f4218f42e28281cd661540ec7b4820f5 Mon Sep 17 00:00:00 2001 From: helloplhm-qwq Date: Tue, 6 Feb 2024 11:52:38 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20fix:=20=E4=BF=AE=E5=A4=8DMP3=E5=86=85?= =?UTF-8?q?=E5=B5=8C=E6=AD=8C=E8=AF=8D=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/localMusic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/localMusic.py b/common/localMusic.py index 6748ccb..f0a6f4a 100644 --- a/common/localMusic.py +++ b/common/localMusic.py @@ -167,7 +167,7 @@ def getAudioMeta(filepath): if (album): album = album.text if (lyric): - lyric = lyric.text + lyric = [lyric.text] if (not lyric): if (os.path.isfile(os.path.splitext(filepath)[0] + '.lrc')): with open(os.path.splitext(filepath)[0] + '.lrc', 'r', encoding='utf-8') as f: @@ -286,7 +286,14 @@ def getAudioCover(filepath): audio = mutagen.File(filepath) if not audio: return None - return convertCover(audio.get('APIC:').data) + if (filepath.lower().endswith('mp3')): + return audio.get('APIC:').data + else: + if (readFileCheckCover(filepath)): + return getAudioCoverFromFFMpeg(filepath) + else: + return None + except: logger.error(f"get audio cover error: {filepath}") logger.error(traceback.format_exc())