From ac17350a67e6b3cc40468fba0c3284a83c7ce3b0 Mon Sep 17 00:00:00 2001 From: goon-foss Date: Mon, 29 Jun 2026 10:23:29 +0200 Subject: [PATCH] fix(sources): require 25 telemetry attempts before a source can show OFFLINE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit freshporno (5★ fresh+rich, verified working — 206/507MB) was labeled OFFLINE off 10 playback attempts that all failed in one unlucky window (a CDN-node blip; it resolves fine now). 10 was too thin a sample to zero out a known-good source's stars. Raised the telemetry-trust threshold 10→25; below it we fall back to the proxy/heuristic health instead of declaring offline (user-report cb526949). Co-Authored-By: Claude Opus 4.8 (1M context) --- app/scheduler/source_stats.py | 7 ++++++- mobile/src/changelog.ts | 7 +++++++ mobile/src/screens/PlayerScreen.tsx | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/scheduler/source_stats.py b/app/scheduler/source_stats.py index 8951eee..90b21dc 100644 --- a/app/scheduler/source_stats.py +++ b/app/scheduler/source_stats.py @@ -26,7 +26,12 @@ from app.db import session_scope log = logging.getLogger(__name__) _TELEMETRY_WINDOW_DAYS = 7 -_TELEMETRY_MIN_ATTEMPTS = 10 # poniżej tego telemetria niemiarodajna → proxy +# Poniżej tego telemetria niemiarodajna → proxy. Próg podniesiony 10→25 (2026-06-29): +# freshporno (5★ fresh+rich, realnie gra — zweryfikowane 206/507MB) dostało health=0 → +# "OFFLINE" na podstawie 10 prób z jednego pechowego okna (CDN-node blip), user-report +# cb526949. 25 prób to sensowniejszy próg pewności zanim ogłosimy źródło offline; przy +# mniejszej próbce lecimy na proxy/heurystykę (nie zerujemy gwiazdek znanemu-dobremu). +_TELEMETRY_MIN_ATTEMPTS = 25 _EVENT_RETENTION_DAYS = 30 # Richness: wagi składowych (suma=1.0). thumb to minimum higieny, canonical-bogactwo # (desc/studio/tag/perf) waży więcej. dur średnio. diff --git a/mobile/src/changelog.ts b/mobile/src/changelog.ts index 16f4242..e3f707c 100644 --- a/mobile/src/changelog.ts +++ b/mobile/src/changelog.ts @@ -16,6 +16,13 @@ export type ChangelogEntry = { }; export const CHANGELOG: ChangelogEntry[] = [ + { + id: '2026-06-29', + date: 'June 2026', + items: [ + 'No more brief blast of sound when a video page is opening — it stays muted until you tap.', + ], + }, { id: '2026-06-26', date: 'June 2026', diff --git a/mobile/src/screens/PlayerScreen.tsx b/mobile/src/screens/PlayerScreen.tsx index a95922b..9d38f98 100644 --- a/mobile/src/screens/PlayerScreen.tsx +++ b/mobile/src/screens/PlayerScreen.tsx @@ -872,6 +872,22 @@ const INJECTED_JS = ` if (window.__goonPatched) return; window.__goonPatched = true; + // -- 0a. Mute autoplay until the FIRST user gesture (kills the brief unmuted-audio + // flash gdy WebView otwiera stronę żeby przechwycić stream — report dccc05e4). + // Override play() PRZED page JS: bez gestu → muted; po tapie usera → dźwięk + // dozwolony (zgodne z "dźwięk dopiero po geście usera"). Element-level mute + // niżej łapał za późno (autoplay z dźwiękiem zdążył ruszyć). + try { + var _goonOrigPlay = HTMLMediaElement.prototype.play; + HTMLMediaElement.prototype.play = function() { + if (!window.__goonUserGestured) { try { this.muted = true; } catch (e) {} } + return _goonOrigPlay.apply(this, arguments); + }; + var _goonAllowSound = function() { window.__goonUserGestured = true; }; + window.addEventListener('touchstart', _goonAllowSound, { once: true, capture: true }); + window.addEventListener('click', _goonAllowSound, { once: true, capture: true }); + } catch (e) {} + // -- 0. Anti-adblock detection bypass -------------------------------------- // Hostery sprawdzają czy ad-script się załadował (np. /js/dnsads.js ustawia // \`window.cRAds\`). Blokujemy te requesty na poziomie AD_HOSTS, więc flag