android: a playlist file, picked

The storage plugin grew `pick_file` beside `pick_folder` and `pick_image`:
the document sheet with the caller's own filter, answered with a path Rust
can open. A document already on this phone hands its path over as it lies —
the document sibling of the same volume:relative id the folder picker
resolves, plus the Downloads provider's raw: — so a 300 MB pick copies
nothing; one that has no path is copied into cacheDir/picked under its own
name, and only as far as the caller allows, because a playlist is kilobytes
and a DJ set is not. Those copies are swept at the start of every pick,
which pick_image's never were.

The import sheet has its fifth door, on round 24's screen, wait card and
review, and the note that apologised for its absence says the one true thing
about it instead. `playlist_import_probe` took a path and a name the way
`playlist_import_folder` took a path, and the name is the load-bearing half:
the parser picks its format off the extension and titles the draft from the
stem, so a cache copy under an invented name would have read every playlist
as plain text. The mock walk drives the door and both of the picker's
refusals through round 31's fail door; the phone walk opens the real sheet
and dismisses it with BACK, reading nothing and writing nothing.

The brief asked for a second consumer — sending a file in a chat — and there
is nothing behind it: `community_pick_file` is the persona layer's three
native dialogs, `soulseek-client` has `say_room` and `message_user` and
nothing that sends a file, and both frontends' thread composers are text
only. Nothing was invented for it. The plugin command is general enough — a
caller's own filter, a zero-copy path, a bounded copy — that the one reader
still waiting, the local set listener the phone puts off by design, needs no
further plugin change. Playlist export is not on that list and never was:
writing a document out is the share plugin's errand, not a picker's. The
Kotlin is unbuilt — nothing on this machine compiles it.
This commit is contained in:
KeelrLeek committed 2026-09-14 02:55:56 -05:00
1 parent 04c87e0db1
commit defd8c5e6d
16 files changed
+559 -57

No files matched your search

+15 -2
View File
@@ -279,9 +279,14 @@ export const playlistCover = (id, maxEdge = null) =>
export const playlistCoverPick = (id) => invoke("playlist_cover_pick", { id });
export const playlistCoverClear = (id) => invoke("playlist_cover_clear", { id });
export const playlistCoverSet = (id, path) => invoke("playlist_cover_set", { id, path });
// Import: probe opens a file dialog and stages a reviewed draft; text stages
// Import: probe stages a reviewed draft from a playlist file; text stages
// a pasted tracklist; commit writes the accepted draft in one transaction.
export const playlistImportProbe = () => invoke("playlist_import_probe");
// The desktop passes neither argument and opens its own dialog; the phone
// picks with the storage plugin and hands the path in — with the picked
// document's own name, which is what chooses the parser and titles the
// draft (a copied file is not always named what the document was).
export const playlistImportProbe = (path = null, name = null) =>
invoke("playlist_import_probe", { path, name });
// The desktop opens its own folder dialog (no path); the phone picks with
// the storage plugin and hands the resolved path in.
export const playlistImportFolder = (path = null) => invoke("playlist_import_folder", { path });
@@ -519,6 +524,14 @@ export const transferNotice = (state) => invoke("plugin:transfer-notice|update",
export const clearTransferNotice = () => invoke("plugin:transfer-notice|clear");
// A photo from the phone (the storage plugin): { path } in the app's cache.
export const pickImage = () => invoke("plugin:storage|pick_image");
// A FILE from the phone (the storage plugin): { path, name, size, copied }.
// `mimeTypes` is the document sheet's filter, comma-separated; `maxCopyBytes`
// is how big a document may be copied into the app's cache when it has no
// path of its own on this phone — 0 refuses the copy, which is what an
// audio-sized pick wants. The name comes back beside the path because a
// copy is named after the document and only the document's name is it.
export const pickFile = (mimeTypes, maxCopyBytes = 0) =>
invoke("plugin:storage|pick_file", { mimeTypes, maxCopyBytes });
// Download a found album copy into (Cache)\_audition\<rel>\ for the version
// comparison. Called track 1 first, then the rest — `startIndex` keeps the
// second batch's indices continuing, since index 0 means "track 1".