feat(playlist): 歌单数据层 + 加入歌单入口
数据层: - PlaylistSummary(歌单名/歌曲数/封面),DB 用一条 SQL 取摘要, 封面取歌单内第一首有封面的歌 - PlaylistRepository.getSummaries() / addSongs()(批量加入并去重) - 修复 AudioService.playPlaylist:之前把文件路径直接当 URL, 歌单播放必然失败;现在用 WebDAVService.getFileUrl 构造 入口(视觉为临时实现,等设计稿替换): - 文件列表长按 -> "加入歌单" 底部弹层 - 可在弹层里新建歌单并直接加入 真机验证:长按歌曲 -> 新建 "TL" -> 数据库 playlists/playlist_songs 均有记录。 测试:新增 playlist_summary 4 个用例,累计 29 个全绿。
This commit is contained in:
@@ -7,6 +7,7 @@ import '../controllers/playback_controller.dart';
|
||||
import '../database/song_database.dart';
|
||||
import '../services/audio_service.dart';
|
||||
import '../widgets/song_artwork.dart';
|
||||
import '../widgets/add_to_playlist_sheet.dart';
|
||||
|
||||
class WebDAVFileListPage extends StatefulWidget {
|
||||
final String currentPath;
|
||||
@@ -435,6 +436,7 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
|
||||
onPressed: () => _toggleFavorite(item.path),
|
||||
),
|
||||
onTap: () => _playSong(item),
|
||||
onLongPress: () => showAddToPlaylistSheet(context, songPath: item.path),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user