Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 187 additions & 14 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ ts-rs = "12.0.1"
uuid = { version = "1.22.0", features = ["v3", "v4", "fast-rng"] }
walkdir = "2.5.0"

[target.'cfg(target_os = "linux")'.dependencies]
mpris-server = "0.8"

[profile.dev]
incremental = true # Compile your binary in smaller steps.

Expand Down
12 changes: 12 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ fn main() {
.plugin(
"sleepblocker",
tauri_build::InlinedPlugin::new().commands(&["enable", "disable"]),
)
.plugin(
"mpris",
tauri_build::InlinedPlugin::new().commands(&[
"update_playback_status",
"update_track_metadata",
"update_volume",
"update_shuffle",
"update_repeat",
"update_position",
"clear_metadata",
]),
),
)
.expect("Failed to run tauri-build");
Expand Down
9 changes: 8 additions & 1 deletion src-tauri/capabilities/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@
"database:allow-reset",
"default-view:allow-set",
"sleepblocker:allow-enable",
"sleepblocker:allow-disable"
"sleepblocker:allow-disable",
"mpris:allow-update-playback-status",
"mpris:allow-update-track-metadata",
"mpris:allow-update-volume",
"mpris:allow-update-shuffle",
"mpris:allow-update-repeat",
"mpris:allow-update-position",
"mpris:allow-clear-metadata"
],
"platforms": ["linux", "macOS", "windows"]
}
6 changes: 6 additions & 0 deletions src-tauri/src/libs/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ pub enum IPCEvent<'a> {
PlaybackPrevious,
PlaybackNext,
PlaybackStart,
// MPRIS-related playback events
PlaybackSeekTo,
PlaybackSeekBy,
PlaybackSetVolume,
PlaybackSetShuffle,
PlaybackSetRepeat,
// Scan-related events
LibraryScanProgress,
// Menu-related events
Expand Down
Loading
Loading