Fixed a bug where aborted audio tracks may be added to the filesystem

cache.
This commit is contained in:
casey langen 2020-11-01 00:12:36 -07:00
parent 54cc781235
commit 04e8acc416
2 changed files with 5 additions and 1 deletions

View File

@ -403,7 +403,10 @@ void HttpDataStream::ThreadProc() {
long httpStatusCode = 0;
curl_easy_getinfo(this->curlEasy, CURLINFO_RESPONSE_CODE, &httpStatusCode);
if (httpStatusCode == 200) {
this->state = State::Downloaded;
this->state = curlCode != CURLE_OK
? State::Aborted
: State::Downloaded;
if (this->reader) {
if (this->written > 0) {
this->reader->Add(this->written);

View File

@ -79,6 +79,7 @@ class HttpDataStream : public IDataStream {
Cached,
Downloading,
Retrying,
Aborted,
Downloaded,
Error,
};