feat(covers): клиентское обогащение обложек через iTunes (обход бана сервера)

Серверный IP забанен Apple (iTunes search 429), а Deezer из РФ пуст — обложки
перестали наливаться. Теперь iTunes-поиск делает КЛИЕНТ (его IP не забанен):
для now-playing-треков без обложки ищет арт в iTunes и шлёт ССЫЛКУ на наш
бэкенд (POST /covers/submit), сервер качает её (CDN из РФ доступен) и кладёт
WebP — дальше обложка приходит всем через /now-playing. Дедуп по треку +
троттлинг 1.5с (CoverEnrichmentManager). Сервер: host-whitelist (SSRF),
идемпотентность (first-write-wins).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nk
2026-06-04 16:59:32 +03:00
parent 4612a8f33c
commit 4a33aa6fb5
6 changed files with 145 additions and 1 deletions

View File

@@ -30,6 +30,10 @@ interface RadiolaApi {
@GET("now-playing")
suspend fun getNowPlaying(): List<BackendNowPlayingDto>
// Сабмит обложки, найденной клиентом в iTunes (см. CoverEnrichmentManager).
@POST("covers/submit")
suspend fun submitCover(@Body dto: com.radiola.data.remote.dto.SubmitCoverDto): com.radiola.data.remote.dto.SubmitCoverResponse
// station_id оффлайн-станций — скрываем их в каталоге (мёртвые потоки)
@GET("stations/offline-ids")
suspend fun getOfflineStationIds(): List<Int>