Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Commit

Permalink
fix(downloader): fix .wav downloads and remove obsolete mp3 qualities. (
Browse files Browse the repository at this point in the history
#121)

* fix(downloader): accept binary/octet-stream for .wav downloads

* fix(downloader-tab): remove obsolete MP3 qualities
  • Loading branch information
defvs authored Jun 21, 2020
1 parent 2c72a19 commit 97d7dfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/xerus/monstercat/downloader/Download.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/main/xerus/monstercat/downloader/TabDownloader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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%",
Expand Down

0 comments on commit 97d7dfc

Please sign in to comment.