mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-08-20 03:25:55 +00:00
fix Restoring Backup deletes all manga library entries #848
This commit is contained in:
parent
93c422ec9f
commit
b08ebcd86c
1 changed files with 22 additions and 12 deletions
|
|
@ -40,9 +40,9 @@ Future<void> doBackUp(
|
|||
datas.addAll({"version": "2"});
|
||||
if (list.contains(0)) {
|
||||
final res = isar.mangas
|
||||
.where()
|
||||
.favoriteEqualToItemTypeGreaterThan(true, ItemType.manga)
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.favoriteEqualTo(true)
|
||||
.isLocalArchiveEqualTo(false)
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
|
|
@ -51,7 +51,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(1)) {
|
||||
final res = isar.categorys
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -59,13 +60,15 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(2)) {
|
||||
final res = isar.chapters
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
datas.addAll({"chapters": res});
|
||||
final res_ = isar.downloads
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -73,7 +76,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(3)) {
|
||||
final res = isar.tracks
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -81,7 +85,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(4)) {
|
||||
final res = isar.historys
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -89,7 +94,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(5)) {
|
||||
final res = isar.updates
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -97,7 +103,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(6)) {
|
||||
final res = isar.settings
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -110,7 +117,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(7)) {
|
||||
final res = isar.sourcePreferences
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -118,7 +126,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(8)) {
|
||||
final res_ = isar.trackPreferences
|
||||
.where()
|
||||
.filter()
|
||||
.syncIdIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
@ -126,7 +135,8 @@ Future<void> doBackUp(
|
|||
}
|
||||
if (list.contains(9)) {
|
||||
final res = isar.sources
|
||||
.where()
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
|
|
|
|||
Loading…
Reference in a new issue