mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-06-19 12:13:32 +00:00
feat(gui): support for soundpad:// uri (#123)
* feat(gui): support for soundpad:// uri * fix: flatpak * do not open gui when downloading file
This commit is contained in:
committed by
GitHub
parent
695c83c9e6
commit
5e47e7d6fb
@@ -9,6 +9,7 @@ use crate::{
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
use std::{
|
||||
path::PathBuf,
|
||||
sync::{Arc, Mutex},
|
||||
time::Instant,
|
||||
};
|
||||
@@ -36,6 +37,17 @@ pub fn make_request_async(request: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn ensure_pwsp_audio_dir() -> PathBuf {
|
||||
let audio_dir = dirs::audio_dir().unwrap_or("~/Music".into());
|
||||
let pwsp_audio_dir = audio_dir.join("PWSP");
|
||||
|
||||
if !pwsp_audio_dir.exists() {
|
||||
std::fs::create_dir_all(&pwsp_audio_dir).ok();
|
||||
}
|
||||
|
||||
pwsp_audio_dir
|
||||
}
|
||||
|
||||
pub fn format_time_pair(position: f32, duration: f32) -> String {
|
||||
fn format_time(seconds: f32) -> String {
|
||||
let total_seconds = seconds.round() as u32;
|
||||
|
||||
Reference in New Issue
Block a user