- 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
19 lines
560 B
Kotlin
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
|
|
}
|