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 .flac download (#125)
Browse files Browse the repository at this point in the history
Content-Type is actually application/octet-stream for FLAC and binary/octet-stream for WAV
  • Loading branch information
defvs authored Jul 13, 2020
1 parent 97d7dfc commit f9c3864
Showing 1 changed file with 1 addition and 1 deletion.
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 == "binary/octet-stream" })
if(!entity.contentType.value.let { it.startsWith("audio/") || it == "binary/octet-stream" || it == "application/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

0 comments on commit f9c3864

Please sign in to comment.