feat: successfully synced lyrics should never expire

This commit is contained in:
2026-03-25 10:24:56 +01:00
parent 55978723a9
commit 7067e33c20
5 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ from lrcfetch.mpris import get_current_track
from lrcfetch.core import LrcManager
app = typer.Typer(
help="LRCFetch — Fetch lyrics for tracks.",
help="LRCFetch — Fetch line-synced lyrics for your music player.",
add_completion=False,
)
+1 -1
View File
@@ -20,7 +20,7 @@ load_dotenv() # .env in cwd (does NOT override existing vars)
HTTP_TIMEOUT = 10.0
# ─── Cache TTLs (seconds) ───────────────────────────────────────────
TTL_SYNCED = 86400 * 30 # 30 days
TTL_SYNCED = None # never expires
TTL_UNSYNCED = 86400 # 1 day
TTL_NOT_FOUND = 86400 * 3 # 3 days
TTL_NETWORK_ERROR = 3600 # 1 hour
+1 -1
View File
@@ -47,7 +47,7 @@ def _normalize_unsynced(lyrics: str) -> str:
# Maps CacheStatus to the default TTL used when storing results
_STATUS_TTL: dict[CacheStatus, int] = {
_STATUS_TTL: dict[CacheStatus, Optional[int]] = {
CacheStatus.SUCCESS_SYNCED: TTL_SYNCED,
CacheStatus.SUCCESS_UNSYNCED: TTL_UNSYNCED,
CacheStatus.NOT_FOUND: TTL_NOT_FOUND,