mirror of
https://github.com/mihonapp/mihon.git
synced 2025-07-01 13:37:50 +02:00
Fix multi-select operations crashing when selection is too large
This commit is contained in:
@ -24,8 +24,12 @@ interface MangaCategoryQueries : DbProvider {
|
|||||||
|
|
||||||
fun setMangaCategories(mangasCategories: List<MangaCategory>, mangas: List<Manga>) {
|
fun setMangaCategories(mangasCategories: List<MangaCategory>, mangas: List<Manga>) {
|
||||||
db.inTransaction {
|
db.inTransaction {
|
||||||
deleteOldMangasCategories(mangas).executeAsBlocking()
|
mangas.chunked(100) { chunk ->
|
||||||
insertMangasCategories(mangasCategories).executeAsBlocking()
|
deleteOldMangasCategories(chunk).executeAsBlocking()
|
||||||
|
}
|
||||||
|
mangasCategories.chunked(100) { chunk ->
|
||||||
|
insertMangasCategories(chunk).executeAsBlocking()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,9 @@ interface SearchTagQueries : DbProvider {
|
|||||||
fun setSearchTagsForManga(mangaId: Long, tags: List<SearchTag>) {
|
fun setSearchTagsForManga(mangaId: Long, tags: List<SearchTag>) {
|
||||||
db.inTransaction {
|
db.inTransaction {
|
||||||
deleteSearchTagsForManga(mangaId).executeAsBlocking()
|
deleteSearchTagsForManga(mangaId).executeAsBlocking()
|
||||||
insertSearchTags(tags).executeAsBlocking()
|
tags.chunked(100) { chunk ->
|
||||||
|
insertSearchTags(chunk).executeAsBlocking()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -41,7 +41,9 @@ interface SearchTitleQueries : DbProvider {
|
|||||||
fun setSearchTitlesForManga(mangaId: Long, titles: List<SearchTitle>) {
|
fun setSearchTitlesForManga(mangaId: Long, titles: List<SearchTitle>) {
|
||||||
db.inTransaction {
|
db.inTransaction {
|
||||||
deleteSearchTitlesForManga(mangaId).executeAsBlocking()
|
deleteSearchTitlesForManga(mangaId).executeAsBlocking()
|
||||||
insertSearchTitles(titles).executeAsBlocking()
|
titles.chunked(100) { chunk ->
|
||||||
|
insertSearchTitles(chunk).executeAsBlocking()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user