Register devices and report verified holdings to the server

This commit is contained in:
Claude
2026-09-30 07:38:47 +00:00
parent 76e0d2f72d
commit c629ff5836
13 changed files with 513 additions and 2 deletions

View File

@@ -353,6 +353,8 @@ function toAssetUrl(path) {
// ---------- State ----------
const DEFAULT_SETTINGS = {
quality: 'auto', volume: 1, audioOnly: false, autoPreload: true,
p2pShare: true, // P2P (docs/p2p-architecture.md): share my saved videos with other devices — ON by default
p2pReceive: true, // fetch from other devices when YouTube and the server can't — ON by default
saveBeforePlay: false, // download (server-muxed single file) before playing instead of streaming
repeatMode: 'off', // 'off' | 'all' — repeat the playing list when it ends
loopOne: false, // repeat the single current video
@@ -9874,6 +9876,10 @@ async function boot() {
// Learn what's already cached, then top up any playlist videos that aren't.
await refreshCachedIds();
startCacheResyncWatch();
// Peer-to-peer: report what this device holds (on by default; settings.p2pShare).
if (WEB && window.P2PClient) {
window.P2PClient.start({ getSettings: () => data.settings, getProfile: () => (data.profile && data.profile.name) || '' });
}
data.playlists.forEach(preloadPlaylist);
preloadPinnedPlaylists();
// Not awaited — artwork backfill must never delay first paint.