mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
refactor(backup): Remove unnecessary function
This commit is contained in:
parent
30726d030c
commit
ca7496bda1
1 changed files with 2 additions and 9 deletions
|
@ -35,14 +35,6 @@ class BackupCreator(
|
|||
val parser = ProtoBuf
|
||||
private val backupPreferences: BackupPreferences = Injekt.get()
|
||||
|
||||
private suspend fun getDatabaseManga(includeReadManga: Boolean) =
|
||||
getManga.awaitFavorites() +
|
||||
if (includeReadManga) {
|
||||
getManga.awaitReadNotFavorites()
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
/**
|
||||
* Create backup Json file from database
|
||||
*
|
||||
|
@ -74,7 +66,8 @@ class BackupCreator(
|
|||
throw IllegalStateException("Invalid backup destination")
|
||||
}
|
||||
|
||||
val backupManga = mangaBackupCreator(getDatabaseManga(options.readManga), options)
|
||||
val readNotFavorites = if (options.readManga) getManga.awaitReadNotFavorites() else emptyList()
|
||||
val backupManga = mangaBackupCreator(getManga.awaitFavorites() + readNotFavorites, options)
|
||||
val backup = Backup(
|
||||
backupManga = backupManga,
|
||||
backupCategories = categoriesBackupCreator(options),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue