diff --git a/src/main/kotlin/bandcampcollectiondownloader/BandcampCollectionDownloader.kt b/src/main/kotlin/bandcampcollectiondownloader/BandcampCollectionDownloader.kt index eeec17b..76d0240 100644 --- a/src/main/kotlin/bandcampcollectiondownloader/BandcampCollectionDownloader.kt +++ b/src/main/kotlin/bandcampcollectiondownloader/BandcampCollectionDownloader.kt @@ -20,7 +20,8 @@ data class ParsedBandcampData( data class DigitalItem( val downloads: Map>, - val package_release_date: String, + val package_release_date: String?, + val release_date: String, val title: String, val artist: String, val download_type: String, @@ -80,7 +81,7 @@ fun downloadAll(cookiesFile: Path?, bandcampUser: String, downloadFormat: String val digitalItem = downloadPageJsonParsed.digital_items[0] var albumtitle = digitalItem.title var artist = digitalItem.artist - val releaseDate = digitalItem.package_release_date + val releaseDate = digitalItem.package_release_date ?: digitalItem.release_date val releaseYear = releaseDate.subSequence(7, 11) val isSingleTrack: Boolean = digitalItem.download_type == "t" val url = digitalItem.downloads[downloadFormat]?.get("url").orEmpty() @@ -207,4 +208,4 @@ fun prepareDownload(albumtitle: String, url: String, cookies: Map