feat: add Deezer as the default download source
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

- 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
This commit is contained in:
TapTap committed 2026-11-17 07:32:34 +00:00
1 parent 81a47f4cd2
commit 141698282d
43 files changed
+2072 -605

No files matched your search

@@ -46,8 +46,8 @@ class MediaGcService(
if (!SongRepository.delete(song.id)) return false
coverArtService.deleteCover(song.id)
mediaStore.deleteSongDirectory(song.videoId)
log.info("GC removed unreferenced song {} ({})", song.id, song.videoId)
mediaStore.deleteSongDirectory(song.relativePath)
log.info("GC removed unreferenced song {} ({}/{})", song.id, song.source, song.externalId)
return true
}
@@ -93,11 +93,17 @@ class MediaGcService(
*/
private fun collectOrphanDirectories() {
val cutoff = Instant.now().minus(ORPHAN_GRACE_MINUTES, ChronoUnit.MINUTES)
val known = SongRepository.all().map { it.videoId }.toSet()
// Use the actual first path segment: new downloads are
// `<source>-<id>` while older YouTube files are `<videoId>`.
val known = SongRepository.all()
.mapNotNull { song ->
song.relativePath.replace('\\', '/').split('/').firstOrNull()?.takeIf { it.isNotBlank() }
}
.toSet()
mediaStore.songDirectories().forEach { directory ->
val videoId = directory.fileName?.toString() ?: return@forEach
if (videoId in known) return@forEach
val name = directory.fileName?.toString() ?: return@forEach
if (name in known) return@forEach
val modified = runCatching {
Files.getLastModifiedTime(directory)
}.getOrNull() ?: return@forEach