android: the hub's filters on the network results, pasted lyrics
The raw results take the Soulseek hub's filters — a free slot only, FLAC or MP3 320+ — as chips above the folders. The lyrics sheet has the desktop's paste door: plain text, or LRC with timestamps, kept for the track.
This commit is contained in:
1 parent
59be9f6c3e
commit
3c8989dfa6
6 files changed
+58
-3
No files matched your search
@@ -263,6 +263,15 @@
|
||||
netSearch(query).catch(() => {});
|
||||
inputEl?.blur();
|
||||
}
|
||||
/* the hub's filters over the raw results: a free slot only, a format */
|
||||
let netFree = $state(false);
|
||||
let netFmt = $state("any");
|
||||
const shownGroups = $derived(net.groups.filter((g) => {
|
||||
if (netFree && !g.slot) return false;
|
||||
if (netFmt === "flac") return g.topExt === "flac";
|
||||
if (netFmt === "mp3320") return g.topExt !== "flac" && (g.maxBitrate ?? 0) >= 320;
|
||||
return true;
|
||||
}));
|
||||
function playPeer(g, i) {
|
||||
const es = groupEntries(g, i);
|
||||
if (es.length) playEntries(es, 0, g.folderName).catch((e) => { player.error = String(e); });
|
||||
@@ -421,10 +430,19 @@
|
||||
{#if !net.searching}<button class="all net-ask" onclick={askNetwork}>Again<Icon name="refresh" size={14} /></button>{/if}
|
||||
</div>
|
||||
{#if net.error}<div class="sec-note">{net.error}</div>{/if}
|
||||
{#if net.groups.length}
|
||||
<div class="chips netfilters" style="padding-bottom: 10px">
|
||||
<button class="chip" class:on={netFree} class:quiet={!netFree} onclick={() => (netFree = !netFree)}>Free slot</button>
|
||||
{#each [["any", "Any format"], ["flac", "FLAC"], ["mp3320", "MP3 320+"]] as [v, l] (v)}
|
||||
<button class="chip" class:on={netFmt === v} class:quiet={netFmt !== v} onclick={() => (netFmt = v)}>{l}</button>
|
||||
{/each}
|
||||
</div>
|
||||
{#if shownGroups.length !== net.groups.length}<div class="sec-note">{shownGroups.length} of {net.groups.length} folders</div>{/if}
|
||||
{/if}
|
||||
{#if net.searching && !net.groups.length}
|
||||
<div class="sec-note">Asking the network as {slsk.username}…</div>
|
||||
{/if}
|
||||
{#each net.groups.slice(0, 40) as g (g.key)}
|
||||
{#each shownGroups.slice(0, 40) as g (g.key)}
|
||||
<div class="peer">
|
||||
<div class="peer-head" oncontextmenu={(e) => { e.preventDefault(); openHalf("peer", { username: g.username, group: g }); }} role="presentation">
|
||||
<span class="peer-who">
|
||||
|
||||
Reference in new issue
Block a user