Skip to content

Commit

Permalink
fix: detekt warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cologler committed Apr 7, 2024
1 parent b28fc30 commit 0f7e9be
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ class MangaBackupCreator(
handler.awaitList {
manga_syncQueries.getTracks(backupTrackMapper)
}.groupBy({ x -> x.first }, { x -> x.second })
} else null
} else {
null
}

return mangas.map {
backupManga(it, options, categoriesMap, trackingMap)
}
}

private suspend fun backupManga(manga: Manga, options: BackupOptions,
categoriesMap: Map<Long, List<Category>>?,
trackingMap: Map<Long, List<BackupTracking>>?): BackupManga {
private suspend fun backupManga(
manga: Manga,
options: BackupOptions,
categoriesMap: Map<Long, List<Category>>?,
trackingMap: Map<Long, List<BackupTracking>>?
): BackupManga {
// Entry for this manga
val mangaObject = manga.toBackupManga()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,21 @@ val backupTrackMapper = {
startDate: Long,
finishDate: Long,
->
Pair(mangaId, BackupTracking(
syncId = syncId.toInt(),
mediaId = mediaId,
// forced not null so its compatible with 1.x backup system
libraryId = libraryId ?: 0,
title = title,
lastChapterRead = lastChapterRead.toFloat(),
totalChapters = totalChapters.toInt(),
score = score.toFloat(),
status = status.toInt(),
startedReadingDate = startDate,
finishedReadingDate = finishDate,
trackingUrl = remoteUrl,
))
Pair(
mangaId,
BackupTracking(
syncId = syncId.toInt(),
mediaId = mediaId,
// forced not null so its compatible with 1.x backup system
libraryId = libraryId ?: 0,
title = title,
lastChapterRead = lastChapterRead.toFloat(),
totalChapters = totalChapters.toInt(),
score = score.toFloat(),
status = status.toInt(),
startedReadingDate = startDate,
finishedReadingDate = finishDate,
trackingUrl = remoteUrl,
)
)
}

0 comments on commit 0f7e9be

Please sign in to comment.