// Round twelve: the desktop's whole-library thumbnail warm, on the phone — // a moment after boot, at the edge the cards paint (360), one decode at a // time behind the tiles' own gate, so a scroll through the library finds // every cover already cut. const fs = require('fs'); const root = 'F:/Coding/SoulStream/'; let p, s; const load = (file) => { p = file; s = fs.readFileSync(root + p, 'utf8'); }; const save = () => fs.writeFileSync(root + p, s); const once = (a) => { const i = s.indexOf(a); if (i < 0) throw new Error('missing in ' + p + ': ' + a.slice(0, 90)); if (s.indexOf(a, i + 1) >= 0) throw new Error('ambiguous in ' + p + ': ' + a.slice(0, 90)); return i; }; const rep = (a, b) => { once(a); s = s.replace(a, () => b); }; load('src/mobile/Mobile.svelte'); rep(` bindImporter(); bindShare();`, ` bindImporter(); bindShare(); /* the desktop's library art prewarm: every cover cut to the cards' edge, one decode at a time behind the tiles' gate, a moment after boot so the first screen and a restored track come first */ setTimeout(() => { api.libraryArtPrewarm([360]).catch(() => {}); }, 8000);`); save(); load('src/lib/mockLibrary.js'); rep(` if (cmd === "rescan_library") return Promise.resolve();`, ` if (cmd === "rescan_library") return Promise.resolve(); if (cmd === "library_art_prewarm") return Promise.resolve();`); save(); load('ANDROID.md'); rep(`The Library's cards wear the desktop's file stats`, `A moment after boot the phone warms the library's thumbnails the desktop's way (\`library_art_prewarm\` at the cards' edge, one decode at a time behind the tiles' gate). The Library's cards wear the desktop's file stats`); save(); console.log('round twelve wired');