现在这个音乐播放器可以听歌了#3
Open
kino14910 wants to merge 39 commits into
Open
Conversation
Add packageManager metadata to package.json and bump web-audio-api in src-tauri/Cargo.toml. Make play_music an async Tauri command with Result return and async audio decoding + error handling. Svelte updates: minor import formatting in Header, PlayerBar now imports and uses Progress (replacing the Slider volume control), and Progress.svelte was heavily rewritten — modernized reactive logic, improved pointer handling, accessibility attributes, and updated styles.
- 新增lofty依赖用于解析音频文件元数据 - 合并暂停/恢复为切换播放状态的接口 - 新增获取歌曲信息的后端命令 - 完善前端播放器状态管理与UI展示 - 优化进度条组件支持键盘与鼠标操作
- 重构播放器状态管理为类形式,统一控制播放逻辑 - 新增音量调节和静音功能,支持实时生效 - 添加专辑封面展示,使用base64嵌入音频封面图片 - 重命名相关方法和类型,统一代码命名规范 - 新增git提交信息规范文档 - 添加默认封面静态资源
1. 新增依赖:walkdir 用于遍历目录、tauri-plugin-dialog 用于选择文件夹 2. 新增 scan_music_directory 命令,支持扫描指定目录下的音轨文件 3. 重构播放器状态管理,替换 playerState 为 Player 类 4. 更新导航栏按钮,添加从文件夹导入音乐并播放的功能 5. 移除旧的硬编码测试播放逻辑,优化音量控制逻辑 6. 更新权限配置,添加对话框插件权限 7. 更新包管理器与依赖版本
本次提交实现了完整的音乐播放器功能: 1. 新增媒体库管理模块,支持扫描、加载本地音乐文件 2. 新增最近播放功能,记录并展示最近播放的歌曲 3. 新增音乐封面加载和懒加载显示功能 4. 重构播放器逻辑,自动切歌和更新播放状态 5. 新增Library和Recent页面,完善导航栏路由 6. 重构进度条和滑块组件,优化交互体验 7. 新增TrackList组件,支持列表展示歌曲信息和交互 8. 后端新增对应命令,支持封面读取、最近播放数据持久化
add color for Track List Component
- add tracks, artists, and albums library pages - introduce reusable MediaGrid for media card layouts - add LibraryFilters to share search and sort controls - wrap mdui select and text field as reusable base components - add SearchField preset for repeated search inputs - define shared Track, Artist, Album, and Playlist types - reorganize components, features, state, utils, and types directories - refactor PlayerBar, TrackList, and PlaylistGrid structure - clean up redundant files and improve import paths
Add a reusable Heading.svelte and refactor several pages to use it (album, artists, library, recent) to reduce duplicate header markup and unify loading/error states. Parse and store album artist in the Tauri backend: Track gained an album_artist field and parse_single_track now extracts AlbumArtist/AlbumArtists (with debug tag printing). Update frontend types: Track.albumArtist added; removed unused duration fields from Artist and Album and removed Album.artist; adjust album-building logic to group albums by title only and update IDs/search/sort accordingly. MediaGrid markup updated to use mdui-card and cleanup item layout/hover behavior. Misc: app.html link formatting, root page now redirects to /library, and small formatting/signature fixes in commands.rs.
Refactor src/routes/settings/+page.svelte to use these components: sections (外观, 媒体库, 扩展) are replaced with SettingsSection, individual rows use SettingsRow, and list items use SettingsListItem; imports were updated accordingly. Functionality (switches, theme select, library dir add/remove, extension toggles) is preserved while markup is simplified and made more consistent.
… sync - Move `scanOnStartup` logic from frontend layout to Tauri backend `.setup` hook - Read `settings.json` natively in Rust to determine startup scanning behavior - Utilize `spawn_blocking` for disk I/O to prevent blocking Tokio async threads - Implement `library:refreshed` event using domain-based naming convention - Update frontend layout to only load cached data for near-instant zero-lag startup - Register event listener in root layout component to smoothly sync scanned tracks
…ueue - Add unique `id` and Tauri-compatible `url` fields to `Track` schema - Implement core playback queue data structure to manage track order and navigation - Prepare state definitions for upcoming `player:queue-updated` event synchronization
refactor: simplify state architecture and isolate player playlist - Rename `queue` to `playlist` in `Player` state to clarify domain boundaries - Move `library:refreshed` event listener into `MusicLibrary` constructor for better encapsulation - Remove `builtin.ts` and decouple core modules from the extension registry - Streamline main `onMount` initialization to focus solely on cache loading
- Separate player playlist state from the core music library tracks - Implement `replacePlaylistAndPlay` to handle explicit queue overrides - Update playback controls (next, prev) to operate strictly on the active playlist - Add utility methods for appending, inserting, and removing tracks within the queue
Introduce a new SearchBar component and a globalSearch state; integrate search into Appbar and library/album/artist pages. Refactor TrackList to support configurable columns, grid layout, tag rendering, and a cleaner lazyCover action; improve styling and extract tag/column utilities. Move bounce keyframes into PlayingIndicator and apply bar color via inline style. Revamp album and artist pages to be responsive with mobile master-detail views, bind window width, replace previous Filters/MediaGrid UI, and add playAll hooks that use the player state. Add segmented sort controls to the library page and wire sorting/searching to derived track lists.
- Add private derived maps (`#albumsMap`/`#artistsMap`) and public getters to MusicLibrary. - Implement persistent `useAlbumArtistGrouping` state and UI toggle switch. - Refactor album and artist pages to use ID-based selection and updated filtering. - Update related types, settings configurations, and UI layout alignments.
Add resume/pause Tauri commands and expose them to the invoke handler; wire tray menu to include a "settings" item which emits a tray:navigate event to unminimize and focus the main window. Integrate Web Media Session API in the player (action handlers for play/pause/prev/next/seek, metadata, playback and position state), update play/pause/toggle/seek flows to sync media session state and polling, and add a small refactor (onTrackStarted). UI tweaks: make SearchBar accept a placeholder prop, adjust Appbar layout, and listen for the tray:navigate event in +layout.svelte to navigate to the settings route.
- Bump multiple Rust dependencies (src-tauri/Cargo.toml & Cargo.lock) and update lockfile. - Add backend modules for configuration, menu, media controls and shortcuts (src-tauri/src/commands/*, media_controls.rs, shortcuts.rs, models/config.rs) and integrate changes into audio, playback and lib. - Add frontend pieces: ShortcutRecorder and ShortcutSettingsPanel components, config store and types, plus updates to Slider, QueueDrawer, TrackList, player state and routes (library, settings). - These changes introduce persistent config, global shortcut/media control handling and related UI for settings.
feat: introduce full Tauri backend layer and upgrade dependencies - Add database migration script (0001_initial.sql) and database manager - Implement SQLite repositories and services for playback, playlist, recent, settings, track, and migration - Implement playback queue, event handling, data models, and application state - Add new Tauri command modules for playlists and tracks, and refactor existing command files - Remove obsolete configuration and shortcut-related files - Update Cargo.toml and Cargo.lock with Rust workspace metadata changes - Upgrade frontend dependencies in package.json and pnpm-lock.yaml including Tailwind, Tauri API/CLI, Svelte, and Vite
- Split and refactor audio internals: extracted AudioGraph and AudioState into src-tauri/src/audio/{graph,state}.rs and introduced audio::mod with helpers.
- Replaced the previous global AudioState layout with a state that embeds a PlaybackQueue model.
- Added a comprehensive PlaybackQueue type (sync/insert/remove/next/previous/shuffle/history) and moved queue logic into it.
- Updated commands and services to use the new queue API (new playback_queue commands, playback_service refactor, playback_events emit payloads as PlaybackQueue) and adjusted state/locking usage.
- Updated frontend types and components to use player.queue instead of legacy playlist/currentIndex.
- Added rand dependency for shuffle behavior and removed several now-obsolete files.
- Minor UI/formatting tweaks applied.
… core logic - Update all `#[command]` functions to return `Result<_, AppError>` instead of `Result<_, String>` - Refactor internal playback, file operation, and directory scanning utilities to use `AppError` - Simplify error propagation by leveraging the `?` operator with existing `From` trait implementations - Unify the error response structure sent to the frontend for consistent error handling
- Replace legacy AudioGraph with trait-based AudioEngine and boxed engine storage in AudioState. - Introduce central event system (AppPayload, emit_event helpers) replacing playback_events module. - Refactor playback services to interact directly with engine methods (play, pause, seek). - Update command signatures to unit returns and move to event-driven state updates. - Standardize data models: rename PlaybackStateSnapshot to PlaybackStatusSnapshot and PlaybackTrackSnapshot to PlaybackTrackInfo. - Update frontend to consume unified global-app-event channel and streamline player state logic. - Perform widespread cleanup of unused modules and legacy code."
- Introduce an EventBus and typed AppEvent payloads - Remove the old events module and replace direct emit_* calls with EventBus::emit - Refactor playback logic into a PlaybackService (methods for play/resume/pause/next/previous/toggle/seek) - Add a media_control_service to handle system media events - Make playback queue changes (versioning, insert_next behavior) and sanitize queue operations - Convert many repository DB calls to use ? and return Result (fixing awaits and error propagation) - Add tokio dependency and migrate file/dir operations and delete_track_files to async tokio fs - Update lib startup to initialize services, handle async scan on startup, and wire tray/menu events to the new services - Misc: adjust models/playback types, move media control handling, and export/consume PlaybackService across commands
Introduce a plugin architecture: add services/plugin module (context, events, loader, manager, manifest, registry, traits) to discover, validate and manage plugins.
- Backend: Implement path canonicalization and boundary validation for track file deletions - Queue: Trigger emit_queue_changed on next-play insertion to fix frontend stale drawer state - Settings: Apply optimistic UI updates in local state to prevent synchronization desync - Assets: Remove redundant material-symbols fonts and consolidate icon strategy onto mdui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.