android: your own Soulseek interests, and who the server says is like you
Community's fourth tab is Taste: the likes and hates this client publishes to the Soulseek server (slsk_interests_mine, slsk_interest_set), added and taken back as chips, and the people the server ranks as close to them (slsk_similar_users) — a row each into the peer sheet the app already has. Every declaration asks the server again and the chips stay quiet until it has answered, the way the desktop does, because the ranking only moves when its input does. The lists live in taste.svelte.js, read once per account when the tab is opened; the mock walk declares a like, watches the match grow, declares a hate and takes the like back.
This commit is contained in:
1 parent
7eae0ee945
commit
e693dfb868
6 files changed
+195
-6
No files matched your search
@@ -160,6 +160,9 @@ const PROBE = `(function () {
|
||||
hwant: (function () { try { var n = __ss.nav; return (n.sheet ? 1 : 0) + (n.half ? 1 : 0) + (n.stacks[n.tab].length - 1) + (n.tab !== 'home' ? 1 : 0); } catch (e) { return -1; } })(),
|
||||
cardImgs: document.querySelectorAll('.rail .acard img').length,
|
||||
cardPhs: document.querySelectorAll('.rail .acard svg').length,
|
||||
likes: [].map.call(document.querySelectorAll('.tastechips.likes .tchip'), function (c) { return c.textContent.trim(); }).join('|'),
|
||||
hates: [].map.call(document.querySelectorAll('.tastechips.hates .tchip'), function (c) { return c.textContent.trim(); }).join('|'),
|
||||
similar: document.querySelectorAll('.screen .row.similar').length,
|
||||
budNames: [].map.call(document.querySelectorAll('.screen .row.bud .t'), function (t) { return t.textContent.trim(); }).join('|'),
|
||||
budSubs: [].map.call(document.querySelectorAll('.screen .row.bud .m'), function (t) { return t.textContent.trim(); }).join('|'),
|
||||
halfSub: ((document.querySelector('.halfsheet .sheet-head .m') || {}).textContent || '').trim(),
|
||||
@@ -239,6 +242,19 @@ const MOCK_STEPS = [
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = 'dusty_crates'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 300 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Open')`, name: "user-lookup", wait: 700 },
|
||||
{ do: `document.querySelector('.scrim').click()`, wait: 500 },
|
||||
/* your own interests: what is declared, a like added and the server's
|
||||
match re-asked, a hate added, the like taken back, a match's sheet */
|
||||
{ do: `(function () { var t = document.querySelector('.toast:not(.notice)'); if (t) t.click(); return true; })()`, wait: 200 },
|
||||
{ do: `__click('.segtabs button', 'Taste')`, name: "taste", wait: 1000 },
|
||||
{ do: `__click('.tastechips.likes .tadd', null)`, wait: 500 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = 'Boards of Canada'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 300 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Declare')`, name: "taste-declared", wait: 1100 },
|
||||
{ do: `__click('.tastechips.hates .tadd', null)`, wait: 500 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = 'loudness war 2'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 300 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Declare')`, name: "taste-hated", wait: 1100 },
|
||||
{ do: `__click('.tastechips.likes .tchip', 'Boards of Canada')`, name: "taste-dropped", wait: 1100 },
|
||||
{ do: `__click('.screen .row.similar', null)`, name: "taste-peer", wait: 700 },
|
||||
{ do: `document.querySelector('.scrim').click()`, wait: 500 },
|
||||
{ do: `__click('.segtabs button', 'Rooms')`, wait: 500 },
|
||||
/* the room list: filtered by name, the rest on demand */
|
||||
{ do: `(function () { var i = document.querySelector('.roomfilter input'); i.value = 'vin'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, name: "rooms-filtered", wait: 500 },
|
||||
@@ -463,6 +479,11 @@ const MOCK_EXPECT = {
|
||||
"buddy-petname": (i) => i.budNames === "Zola from Vinyl Rips|cy" && /ada/.test(i.budSubs) && !i.toast,
|
||||
"room-users": (i) => i.half.includes("up") && /Zola from Vinyl Rips/.test(i.halfText) && /ada/.test(i.halfText) && /bo/.test(i.halfText),
|
||||
"contact-cleared": (i) => !i.half.includes("up") && i.budNames === "ada|cy" && !i.toast,
|
||||
taste: (i) => i.likes === "Daft Punk|french house|Warp Records" && i.hates === "loudness war" && i.similar === 4,
|
||||
"taste-declared": (i) => /Boards of Canada/.test(i.likes) && i.similar === 5,
|
||||
"taste-hated": (i) => i.hates === "loudness war|loudness war 2",
|
||||
"taste-dropped": (i) => !/Boards of Canada/.test(i.likes) && i.similar === 4 && !i.toast,
|
||||
"taste-peer": (i) => i.half.includes("up") && /hifi_hank/.test(i.halfText),
|
||||
"home-more": (i) => i.half.includes("up"),
|
||||
you: (i) => i.title.startsWith("You") && i.norm === "on" && i.folderRow && i.srcMax === "No limit",
|
||||
"you-norm-off": (i) => i.norm === "off",
|
||||
|
||||
Reference in new issue
Block a user