android: a folder of audio files, and a paste of track links

The paste door now reads itself the way the desktop's does: one track link
in the paste and every line is looked up on its own public page
(playlist_import_track_links), which is the way past Spotify's 100-track
public ceiling — the wait screen counts them as they arrive. A fourth door
imports a folder of audio files off this phone, picked with the storage
plugin's own document-tree picker; playlist_import_folder grew a path
argument for it, because on Android it had no dialog to open and always
answered nothing. A YouTube playlist link needed no door at all — the link
one already dispatches it.
This commit is contained in:
KeelrLeek committed 2026-09-13 23:32:00 -05:00
1 parent 24c6857847
commit c737809325
9 files changed
+215 -47

No files matched your search

+24 -13
View File
@@ -721,20 +721,31 @@ pub async fn playlist_import_probe(
pub async fn playlist_import_folder(
app: tauri::AppHandle,
lib: State<'_, LibraryState>,
path: Option<String>,
) -> Result<Option<ImportDraft>, String> {
let (tx, rx) = tokio::sync::oneshot::channel::<Option<String>>();
#[cfg(desktop)]
{
use tauri_plugin_dialog::DialogExt;
app.dialog().file().pick_folder(move |path| {
let _ = tx.send(path.map(|p| p.to_string()));
});
}
#[cfg(mobile)]
{
let _ = tx.send(None);
}
let Some(root) = rx.await.unwrap_or(None) else {
// The phone has no dialog here, so it picks the folder itself (the
// storage plugin's document-tree picker) and hands the resolved path
// in; the desktop passes nothing and opens its own.
let picked = match path {
Some(p) if !p.trim().is_empty() => Some(p),
_ => {
let (tx, rx) = tokio::sync::oneshot::channel::<Option<String>>();
#[cfg(desktop)]
{
use tauri_plugin_dialog::DialogExt;
app.dialog().file().pick_folder(move |path| {
let _ = tx.send(path.map(|p| p.to_string()));
});
}
#[cfg(mobile)]
{
let _ = &app;
let _ = tx.send(None);
}
rx.await.unwrap_or(None)
}
};
let Some(root) = picked else {
return Ok(None);
};
let root_path = PathBuf::from(&root);