android: a streamed file copied into a folder, the listening port, the dev build's diagnostics

The now-playing sheet's streamed track can be copied into a folder picked
on the phone, as the file it is — the cache written out, nothing downloaded
again, no library row (copy_stream_to_folder, which the desktop has had a
command for and no UI). You → Sharing carries the listening port, what
peers dial when they download from you: unset is the client's own 50300,
the app asks the router to forward it over UPnP and falls back to the
server relaying, and a change applies on the next connect. The dev flavour
gets the desktop's debug overlay as a screen under This phone — CPU,
memory, the network, the stream and its loudness, what the pre-buffer is
fetching, the size of the play history — behind devBuild in util.js, which
is Vite's own DEV flag, so the embedded build the phone keeps has no row
to tap.
This commit is contained in:
KeelrLeek committed 2026-09-13 23:59:47 -05:00
1 parent 1737c5e1b6
commit aff29aba5c
8 files changed
+272 -2

No files matched your search

+29
View File
@@ -597,6 +597,34 @@ function mockCatalog(cmd, args) {
}
if (cmd === "preload_cached_stream") return Promise.resolve(cacheReady.has(args?.path));
if (cmd === "excluded_search_phrases") return Promise.resolve([]);
if (cmd === "copy_stream_to_folder") {
/* the real command copies only what the stream cache already holds */
let saved = 0, missing = 0;
for (const f of args?.files || []) { if (cacheReady.has(f.path)) saved++; else missing++; }
return Promise.resolve([saved, missing]);
}
if (cmd === "play_row_count") return Promise.resolve(4210);
if (cmd === "debug_stats") {
/* the overlay's shape, camelCase as serde renames it; the numbers
wander a little so the screen is seen to be live */
const t = Date.now() / 1000;
return Promise.resolve({
cpuProcess: 7.5 + Math.sin(t), cpuSystem: 22 + Math.cos(t) * 3,
gpuPercent: null, gpuAppPercent: null,
memWorkingSet: 431_000_000, memPrivate: 0,
memSystemUsed: 5_400_000_000, memSystemTotal: 7_900_000_000,
netRxBps: 1_250_000, netTxBps: 96_000,
processCount: 3, uptimeSecs: 742,
dlReceived: xfer ? Math.round(xfer.received) : null,
dlTotal: xfer ? xfer.total : null,
dlDone: xfer ? xfer.received >= xfer.total : null,
normalizationEnabled: mockSettings.volume_normalization !== false, targetLufs: -14,
loudness: { lufs: -9.8, peak: 0.98, gainDb: -4.2, cached: true, analyzing: false, source: "cache", headStartDb: 0, prefixGainDb: null },
mainFadeGain: 1, normNowDb: -4.2, normTargetDb: -4.2,
previewVolume: null, previewNormDb: null,
preloadDl: [{ username: "dusty_crates", path: "Music\\Daft Punk\\Discovery\\02 Aerodynamic.flac", state: "transferring", place: null, received: 5_000_000, total: 12_000_000, speedBps: 850_000 }],
});
}
if (cmd === "get_settings") return Promise.resolve({ ...mockSettings, stream_source_prefs: { ...mockSettings.stream_source_prefs }, download_source_prefs: { ...mockSettings.download_source_prefs } });
if (cmd === "set_settings") {
/* the command's arguments are camelCase; the config's fields are snake_case */
@@ -624,6 +652,7 @@ const mockSettings = {
library_layout: "{artist}\\{album}",
shared_folders: [],
upload_slots: 2,
listen_port: null,
share_files: 1234,
word_timing: false,
replace_embedded_art: true,