mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 15:41:52 +01:00
Some cleanup in the downloads cache and disk util
This commit is contained in:
parent
cb025624eb
commit
4e4f9b339f
@ -126,7 +126,7 @@ class DownloadCache(
|
||||
|
||||
val sourceDirs = getDirectoryFromPreference().listFiles().orEmpty()
|
||||
.associate { it.name to SourceDirectory(it) }.mapNotNullKeys { entry ->
|
||||
onlineSources.find { provider.getSourceDirName(it).toLowerCase() == entry.key?.toLowerCase() }?.id
|
||||
onlineSources.find { provider.getSourceDirName(it).equals(entry.key, ignoreCase = true) }?.id
|
||||
}
|
||||
|
||||
val db: DatabaseHelper by injectLazy()
|
||||
@ -159,7 +159,7 @@ class DownloadCache(
|
||||
*/
|
||||
private fun findManga(mangaList: List<Manga>, mangaKey: String, sourceKey: Long): Manga? {
|
||||
return mangaList.find {
|
||||
DiskUtil.buildValidFilename(it.originalTitle).toLowerCase() == mangaKey.toLowerCase() && it.source == sourceKey
|
||||
DiskUtil.buildValidFilename(it.originalTitle).equals(mangaKey, ignoreCase = true) && it.source == sourceKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ object DiskUtil {
|
||||
*/
|
||||
fun buildValidFilename(origName: String): String {
|
||||
val name = origName.trim('.', ' ')
|
||||
if (name.isNullOrEmpty()) {
|
||||
if (name.isEmpty()) {
|
||||
return "(invalid)"
|
||||
}
|
||||
val sb = StringBuilder(name.length)
|
||||
|
Loading…
Reference in New Issue
Block a user