Make some methods non-nullable
This commit is contained in:
parent
6b0a9b788a
commit
4f79ae8e9e
|
@ -44,7 +44,7 @@ class BitmapUtils {
|
||||||
): Bitmap? {
|
): Bitmap? {
|
||||||
val albumArtFile = FileUtil.getAlbumArtFile(filename)
|
val albumArtFile = FileUtil.getAlbumArtFile(filename)
|
||||||
val bitmap: Bitmap? = null
|
val bitmap: Bitmap? = null
|
||||||
if (albumArtFile != null && File(albumArtFile).exists()) {
|
if (File(albumArtFile).exists()) {
|
||||||
return getBitmapFromDisk(albumArtFile, size, bitmap)
|
return getBitmapFromDisk(albumArtFile, size, bitmap)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
|
|
|
@ -114,7 +114,7 @@ object FileUtil {
|
||||||
* @param entry The album entry
|
* @param entry The album entry
|
||||||
* @return File object. Not guaranteed that it exists
|
* @return File object. Not guaranteed that it exists
|
||||||
*/
|
*/
|
||||||
fun getAlbumArtFile(entry: MusicDirectory.Child): String? {
|
fun getAlbumArtFile(entry: MusicDirectory.Child): String {
|
||||||
val albumDir = getAlbumDirectory(entry)
|
val albumDir = getAlbumDirectory(entry)
|
||||||
return getAlbumArtFileForAlbumDir(albumDir)
|
return getAlbumArtFileForAlbumDir(albumDir)
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ object FileUtil {
|
||||||
* @return File object. Not guaranteed that it exists
|
* @return File object. Not guaranteed that it exists
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getAlbumArtFileForAlbumDir(albumDir: String): String? {
|
fun getAlbumArtFileForAlbumDir(albumDir: String): String {
|
||||||
val key = getAlbumArtKey(albumDir, true)
|
val key = getAlbumArtKey(albumDir, true)
|
||||||
return getAlbumArtFile(key)
|
return getAlbumArtFile(key)
|
||||||
}
|
}
|
||||||
|
@ -180,11 +180,9 @@ object FileUtil {
|
||||||
* @return File object. Not guaranteed that it exists
|
* @return File object. Not guaranteed that it exists
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getAlbumArtFile(cacheKey: String?): String? {
|
fun getAlbumArtFile(cacheKey: String): String {
|
||||||
val albumArtDir = albumArtDirectory.absolutePath
|
val albumArtDir = albumArtDirectory.absolutePath
|
||||||
return if (cacheKey == null) {
|
return "$albumArtDir/$cacheKey"
|
||||||
null
|
|
||||||
} else "$albumArtDir/$cacheKey"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val albumArtDirectory: File
|
val albumArtDirectory: File
|
||||||
|
|
Loading…
Reference in New Issue