Make some methods non-nullable

This commit is contained in:
tzugen 2022-07-05 23:15:05 +02:00
parent 6b0a9b788a
commit 4f79ae8e9e
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
2 changed files with 5 additions and 7 deletions

View File

@ -44,7 +44,7 @@ class BitmapUtils {
): Bitmap? {
val albumArtFile = FileUtil.getAlbumArtFile(filename)
val bitmap: Bitmap? = null
if (albumArtFile != null && File(albumArtFile).exists()) {
if (File(albumArtFile).exists()) {
return getBitmapFromDisk(albumArtFile, size, bitmap)
}
return null

View File

@ -114,7 +114,7 @@ object FileUtil {
* @param entry The album entry
* @return File object. Not guaranteed that it exists
*/
fun getAlbumArtFile(entry: MusicDirectory.Child): String? {
fun getAlbumArtFile(entry: MusicDirectory.Child): String {
val albumDir = getAlbumDirectory(entry)
return getAlbumArtFileForAlbumDir(albumDir)
}
@ -169,7 +169,7 @@ object FileUtil {
* @return File object. Not guaranteed that it exists
*/
@JvmStatic
fun getAlbumArtFileForAlbumDir(albumDir: String): String? {
fun getAlbumArtFileForAlbumDir(albumDir: String): String {
val key = getAlbumArtKey(albumDir, true)
return getAlbumArtFile(key)
}
@ -180,11 +180,9 @@ object FileUtil {
* @return File object. Not guaranteed that it exists
*/
@JvmStatic
fun getAlbumArtFile(cacheKey: String?): String? {
fun getAlbumArtFile(cacheKey: String): String {
val albumArtDir = albumArtDirectory.absolutePath
return if (cacheKey == null) {
null
} else "$albumArtDir/$cacheKey"
return "$albumArtDir/$cacheKey"
}
val albumArtDirectory: File