From 97d7dfc129af4e5d74be8537b7ce6ed3f14a9b66 Mon Sep 17 00:00:00 2001 From: Daniel THIRION Date: Sun, 21 Jun 2020 20:10:51 +0200 Subject: [PATCH] fix(downloader): fix .wav downloads and remove obsolete mp3 qualities. (#121) * fix(downloader): accept binary/octet-stream for .wav downloads * fix(downloader-tab): remove obsolete MP3 qualities --- src/main/xerus/monstercat/downloader/Download.kt | 2 +- src/main/xerus/monstercat/downloader/TabDownloader.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/xerus/monstercat/downloader/Download.kt b/src/main/xerus/monstercat/downloader/Download.kt index 210070e..35fb750 100644 --- a/src/main/xerus/monstercat/downloader/Download.kt +++ b/src/main/xerus/monstercat/downloader/Download.kt @@ -86,7 +86,7 @@ class ReleaseDownload(private val release: Release, private var tracks: Collecti val contentLength = entity.contentLength if(contentLength == 0L) throw EmptyResponseException(connection.uri.toString()) - if(!entity.contentType.value.let { it.startsWith("audio/") || it == "application/octet-stream" }) + if(!entity.contentType.value.let { it.startsWith("audio/") || it == "binary/octet-stream" }) throw WrongResponseTypeException(connection.uri.toString(), entity.contentType.value) if(httpResponse.statusLine.statusCode != 200) throw WrongResponseCodeException(connection.uri.toString(), httpResponse.statusLine.toString()) diff --git a/src/main/xerus/monstercat/downloader/TabDownloader.kt b/src/main/xerus/monstercat/downloader/TabDownloader.kt index 8ffee54..e3865d6 100644 --- a/src/main/xerus/monstercat/downloader/TabDownloader.kt +++ b/src/main/xerus/monstercat/downloader/TabDownloader.kt @@ -53,7 +53,7 @@ import java.util.concurrent.TimeUnit import kotlin.math.absoluteValue import xerus.ktutil.javafx.ui.controls.Type as SearchType -private val qualities = arrayOf("mp3_128", "mp3_v2", "mp3_v0", "mp3_320", "flac", "wav") +private val qualities = arrayOf("mp3_320", "flac", "wav") val trackPatterns = ImmutableObservableList( "%artistsTitle% - %title%", "%artists|enumerate% - %title%",