Fix SetMangaViewerFlags (#8719)

Stop clearing old viewer flags when setting a flag

(cherry picked from commit 171db639ffc8e79aac8d8d8e6a354f8d703a387c)
This commit is contained in:
Two-Ai 2022-12-11 16:12:41 -05:00 committed by Jobobby04
parent e5ad53e1d3
commit 40165dd270

View File

@ -10,19 +10,21 @@ class SetMangaViewerFlags(
) { ) {
suspend fun awaitSetMangaReadingMode(id: Long, flag: Long) { suspend fun awaitSetMangaReadingMode(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update( mangaRepository.update(
MangaUpdate( MangaUpdate(
id = id, id = id,
viewerFlags = flag.setFlag(flag, ReadingModeType.MASK.toLong()), viewerFlags = manga.viewerFlags.setFlag(flag, ReadingModeType.MASK.toLong()),
), ),
) )
} }
suspend fun awaitSetOrientationType(id: Long, flag: Long) { suspend fun awaitSetOrientationType(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update( mangaRepository.update(
MangaUpdate( MangaUpdate(
id = id, id = id,
viewerFlags = flag.setFlag(flag, OrientationType.MASK.toLong()), viewerFlags = manga.viewerFlags.setFlag(flag, OrientationType.MASK.toLong()),
), ),
) )
} }