fix: clear persistent Laya warning and apply language selection immediately (#12)

Two fixes: the ChannelList local-AI warning kept showing after the
runtime became available because status changes were not re-evaluated
on refresh; and selecting a language in the player did not switch the
stream variant immediately. Refresh warning visibility from the
latest laya status and apply the chosen variant/language on
selection, with tests for both behaviors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-02 15:15:06 +02:00
parent cb4939daae
commit 4d662369c9
7 changed files with 63 additions and 8 deletions

View File

@ -145,6 +145,11 @@ class SettingsPage {
this.layaStatus = { runtimeAvailable: false, modelPresent: false, error: err.message };
}
this.renderLayaStatus(this.layaStatus);
const mode = this.app.player?.settings?.languageDetectionMode || 'algo';
if (mode !== 'algo' && this.layaStatus?.modelPresent && this.layaStatus?.runtimeAvailable &&
this.app.channelList?.languageDetectionNotice) {
void this.app.channelList.refreshLayaLanguages(mode);
}
if (this.layaStatus?.downloading) this.startLayaStatusPolling();
return this.layaStatus;
}