Fix favorites backup #621
This commit is contained in:
@@ -55,7 +55,7 @@ class BackupRepository @Inject constructor(
|
|||||||
var offset = 0
|
var offset = 0
|
||||||
val entry = BackupEntry(BackupEntry.Name.FAVOURITES, JSONArray())
|
val entry = BackupEntry(BackupEntry.Name.FAVOURITES, JSONArray())
|
||||||
while (true) {
|
while (true) {
|
||||||
val favourites = db.getFavouritesDao().findAll(offset, PAGE_SIZE)
|
val favourites = db.getFavouritesDao().findAllRaw(offset, PAGE_SIZE)
|
||||||
if (favourites.isEmpty()) {
|
if (favourites.isEmpty()) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ abstract class FavouritesDao {
|
|||||||
)
|
)
|
||||||
abstract suspend fun findAll(offset: Int, limit: Int): List<FavouriteManga>
|
abstract suspend fun findAll(offset: Int, limit: Int): List<FavouriteManga>
|
||||||
|
|
||||||
|
@Transaction
|
||||||
|
@Query("SELECT * FROM favourites WHERE deleted_at = 0 ORDER BY created_at DESC LIMIT :limit OFFSET :offset")
|
||||||
|
abstract suspend fun findAllRaw(offset: Int, limit: Int): List<FavouriteManga>
|
||||||
|
|
||||||
@Transaction
|
@Transaction
|
||||||
@Query(
|
@Query(
|
||||||
"SELECT * FROM favourites WHERE category_id = :categoryId AND deleted_at = 0 " +
|
"SELECT * FROM favourites WHERE category_id = :categoryId AND deleted_at = 0 " +
|
||||||
|
|||||||
Reference in New Issue
Block a user