diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/service/Downloader.kt b/ultrasonic/src/main/java/org/moire/ultrasonic/service/Downloader.kt index e5f101f4..56984123 100644 --- a/ultrasonic/src/main/java/org/moire/ultrasonic/service/Downloader.kt +++ b/ultrasonic/src/main/java/org/moire/ultrasonic/service/Downloader.kt @@ -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, diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/DownloadFile.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/DownloadFile.kt index 6b4c03b9..cc82c25d 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/DownloadFile.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/DownloadFile.kt @@ -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.") } }