1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2026-03-25 09:49:46 +08:00

feat: 添加正在播放页面 (#386)

* 引入tailwindcss, 更新默认主题ui

* 引入tailwindcss, 添加新的主题ui

* 引入tailwindcss, 添加新的主题ui

* 更新tailwind主题

* fix merge error

* fix merge error

* feat: Enhance song metadata display and API fetching

- Add more detailed song metadata in frontend (title, artist, album, year, genre, lyrics)
- Update API call to include music tags
- Replace default music icon with song cover image
- Improve type hinting in httpserver.py

* feat: Add keyboard shortcuts for music playback control

- Implement keyboard shortcuts for play/pause (Space), previous/next track (Left/Right arrows)
- Add volume control via Up/Down arrow keys
- Prevent default browser actions for shortcut keys
- Add event listener for keydown and remove on component unmount
- Enhance user interaction with music player

* feat: Improve song metadata handling and error resilience

- Enhance current song information retrieval with more robust error handling
- Add fallback values for song metadata when API calls fail
- Update current song state with additional properties like cover image
- Optimize song loading process with better error management
- Ensure consistent song information display even with incomplete data
This commit is contained in:
jhcj.z
2025-02-05 22:08:24 +08:00
committed by GitHub
parent e25fad9cc6
commit d122ba9545
6 changed files with 748 additions and 26 deletions

View File

@@ -8,7 +8,10 @@ import tempfile
import urllib.parse
from contextlib import asynccontextmanager
from dataclasses import asdict
from typing import Annotated
from typing import Annotated, TYPE_CHECKING
if TYPE_CHECKING:
from xiaomusic.xiaomusic import XiaoMusic
import aiofiles
from fastapi import (
@@ -49,7 +52,7 @@ from xiaomusic.utils import (
update_version,
)
xiaomusic = None
xiaomusic: "XiaoMusic" = None
config = None
log = None