mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(radio): isolate country coverage from catalog health
This commit is contained in:
1 parent
14d7ddf06b
commit
cbfcaff8df
5 files changed
+145
-95
No files matched your search
@@ -254,11 +254,11 @@ export function createRadioProxyMiddleware({
|
||||
),
|
||||
);
|
||||
return {
|
||||
// Query coverage is based on accepted rows, not merely a payload that
|
||||
// happens to match the upstream schema. Specialist responses must
|
||||
// also contain an accepted station tagged for the requested category.
|
||||
// A valid country response can contain no playable stations. Country
|
||||
// coverage is advisory; only broad/specialist queries gate health.
|
||||
// Specialist responses need an accepted station with matching tags.
|
||||
succeeded: country
|
||||
? rows.length === 0 || stations.length > 0
|
||||
? true
|
||||
: stations.length > 0 && requestedTagCovered,
|
||||
stations,
|
||||
};
|
||||
@@ -312,8 +312,6 @@ export function createRadioProxyMiddleware({
|
||||
const broadQueryHealthy =
|
||||
outcomes[0].succeeded && outcomes[0].stations.length > 0;
|
||||
const healthReasons = [];
|
||||
if (outcomes.slice(baseQueryCount).some((outcome) => !outcome.succeeded))
|
||||
healthReasons.push('priority-country-query-unhealthy');
|
||||
if (!broadQueryHealthy) healthReasons.push('broad-query-unhealthy');
|
||||
if (successfulQueries < RADIO_CATALOG_MIN_SUCCESSFUL_QUERIES)
|
||||
healthReasons.push('query-coverage-below-policy');
|
||||
|
||||
Reference in new issue
Block a user