mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
cleanup directory names (#251)
This commit is contained in:
@@ -164,7 +164,7 @@ object Manga {
|
||||
|
||||
private val applicationDirs by DI.global.instance<ApplicationDirs>()
|
||||
suspend fun getMangaThumbnail(mangaId: Int, useCache: Boolean): Pair<InputStream, String> {
|
||||
val saveDir = applicationDirs.mangaThumbnailsRoot
|
||||
val saveDir = applicationDirs.thumbnailsRoot
|
||||
val fileName = mangaId.toString()
|
||||
|
||||
val mangaEntry = transaction { MangaTable.select { MangaTable.id eq mangaId }.first() }
|
||||
@@ -204,7 +204,7 @@ object Manga {
|
||||
}
|
||||
|
||||
private fun clearMangaThumbnail(mangaId: Int) {
|
||||
val saveDir = applicationDirs.mangaThumbnailsRoot
|
||||
val saveDir = applicationDirs.thumbnailsRoot
|
||||
val fileName = mangaId.toString()
|
||||
|
||||
clearCachedImage(saveDir, fileName)
|
||||
|
||||
@@ -28,7 +28,7 @@ fun getMangaDir(mangaId: Int): String {
|
||||
val sourceDir = source.toString()
|
||||
val mangaDir = SafePath.buildValidFilename(mangaEntry[MangaTable.title])
|
||||
|
||||
return "${applicationDirs.mangaRoot}/$sourceDir/$mangaDir"
|
||||
return "${applicationDirs.mangaDownloadsRoot}/$sourceDir/$mangaDir"
|
||||
}
|
||||
|
||||
fun getChapterDir(mangaId: Int, chapterId: Int): String {
|
||||
@@ -54,8 +54,8 @@ fun updateMangaDownloadDir(mangaId: Int, newTitle: String): Boolean {
|
||||
|
||||
val newMangaDir = SafePath.buildValidFilename(newTitle)
|
||||
|
||||
val oldDir = "${applicationDirs.mangaRoot}/$sourceDir/$mangaDir"
|
||||
val newDir = "${applicationDirs.mangaRoot}/$sourceDir/$newMangaDir"
|
||||
val oldDir = "${applicationDirs.mangaDownloadsRoot}/$sourceDir/$mangaDir"
|
||||
val newDir = "${applicationDirs.mangaDownloadsRoot}/$sourceDir/$newMangaDir"
|
||||
|
||||
val oldDirFile = File(oldDir)
|
||||
val newDirFile = File(newDir)
|
||||
|
||||
Reference in New Issue
Block a user