mirror of
https://github.com/Remik1r3n/maimaiDX-Api.git
synced 2025-05-20 04:17:28 +08:00
14 lines
477 B
Python
14 lines
477 B
Python
from MusicDB import musicDB
|
|
from loguru import logger
|
|
|
|
|
|
def getMusicTitle(musicId: int) -> str:
|
|
'''从数据库获取音乐的标题'''
|
|
#logger.debug(f"查询歌名: {musicId}")
|
|
musicInfo = musicDB.get(musicId)
|
|
if not musicInfo:
|
|
logger.warning(f"数据库里未找到此歌曲: {musicId}")
|
|
return "R_ERR_MUSIC_ID_NOT_IN_DATABASE"
|
|
musicName = musicInfo.get("name")
|
|
#logger.debug(f"成功查询到歌名: {musicName}")
|
|
return musicName |