Small fixes
This commit is contained in:
parent
594e94eea7
commit
d08a38ea1c
|
@ -20,6 +20,10 @@ import timber.log.Timber
|
|||
/**
|
||||
* This class is responsible for maintaining the playlist and downloading
|
||||
* its items from the network to the filesystem.
|
||||
*
|
||||
* TODO: Implement LiveData
|
||||
* TODO: Move away from managing the queue with scheduled checks, instead use callbacks when
|
||||
* Downloads are finished
|
||||
*/
|
||||
class Downloader(
|
||||
private val shufflePlayBuffer: ShufflePlayBuffer,
|
||||
|
|
|
@ -204,7 +204,6 @@ class DownloadFile(
|
|||
return String.format("DownloadFile (%s)", song)
|
||||
}
|
||||
|
||||
@Suppress("TooGenericExceptionCaught")
|
||||
private inner class DownloadTask : CancellableTask() {
|
||||
override fun execute() {
|
||||
var inputStream: InputStream? = null
|
||||
|
@ -292,7 +291,7 @@ class DownloadFile(
|
|||
Util.renameFile(partialFile, completeFile)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (all: Exception) {
|
||||
Util.close(outputStream)
|
||||
Util.delete(completeFile)
|
||||
Util.delete(saveFile)
|
||||
|
@ -301,7 +300,7 @@ class DownloadFile(
|
|||
if (retryCount > 0) {
|
||||
--retryCount
|
||||
}
|
||||
Timber.w(e, "Failed to download '%s'.", song)
|
||||
Timber.w(all, "Failed to download '%s'.", song)
|
||||
}
|
||||
} finally {
|
||||
Util.close(inputStream)
|
||||
|
@ -339,8 +338,8 @@ class DownloadFile(
|
|||
// Download the largest size that we can display in the UI
|
||||
imageLoaderProvider.getImageLoader().cacheCoverArt(song)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Failed to get cover art.")
|
||||
} catch (all: Exception) {
|
||||
Timber.e(all, "Failed to get cover art.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue