fix: remove inflated confidence for unsynced results (impacts: sp, mxm-sp, local, lrclib, manual)

This commit is contained in:
2026-04-05 11:48:19 +02:00
parent 0d56cde927
commit 65327eb431
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -10,6 +10,8 @@ from enum import Enum
from typing import Optional, TYPE_CHECKING
from dataclasses import dataclass
from lrx_cli.config import SCORE_W_SYNCED
if TYPE_CHECKING:
from .lrc import LRCData
@@ -67,3 +69,6 @@ class LyricResult:
def __post_init__(self) -> None:
if self.status in (CacheStatus.NOT_FOUND, CacheStatus.NETWORK_ERROR):
self.confidence = 0.0
if self.status is CacheStatus.SUCCESS_UNSYNCED and self.confidence == 100.0:
# Fix: remove inflated confidence for unsynced results
self.confidence = 100 - SCORE_W_SYNCED
+1 -1
View File
@@ -314,7 +314,7 @@ def test_update_confidence_targets_specific_source(cache_db: CacheEngine) -> Non
assert updated == 1
rows = {r["source"]: r for r in cache_db.query_track(track)}
assert rows["s1"]["confidence"] == 75.0
assert rows["s2"]["confidence"] == 100.0 # unchanged
assert rows["s2"]["confidence"] == 90.0 # unchanged (unsynced default)
def test_update_confidence_returns_zero_for_missing_source(
Generated
+1 -1
View File
@@ -153,7 +153,7 @@ wheels = [
[[package]]
name = "lrx-cli"
version = "0.5.1"
version = "0.5.2"
source = { editable = "." }
dependencies = [
{ name = "cyclopts" },