Files
AudioManager/src/main/kotlin/win/taptap/musicmanager/source/MusicSource.kt
T
TapTap 141698282d
CI / chart (push) Successful in 3s
CI / test (push) Successful in 2m23s
CI / chart-push (push) Successful in 5s
CI / image (push) Successful in 3m50s
feat: add Deezer as the default download source
- V9 adds source/external_id to songs, moods, recommendations and jobs
- Deezer public catalog for search, related album covers and metadata
- streamrip downloader configured with DEEZER_ARL, 128/320 MP3
- per-mood source selector; switching clears and refills recommendations
- keep YouTube Music as a full second catalog and downloader
- media layout <source>-<externalId>, legacy YouTube folders still read
- Docker/streamrip install, chart ARL secret, docs and dual-source smoke test
2026-11-17 07:32:34 +00:00

19 lines
560 B
Kotlin

package win.taptap.musicmanager.source
/**
* The two supported download sources. `externalId` is namespaced by the source:
* a YouTube video id or a Deezer track id.
*/
object MusicSource {
const val YOUTUBE = "youtube"
const val DEEZER = "deezer"
val ALL = setOf(YOUTUBE, DEEZER)
/** Returns the normalized source, or null when it is not supported. */
fun normalizeOrNull(value: String?): String? =
value?.trim()?.lowercase()?.takeIf { it in ALL }
fun isKnown(value: String?): Boolean = normalizeOrNull(value) != null
}