* Improve error message if restoring from JSON file
* Replace Exception with IOException
* Use more generic error message if protobuf fails
* fix lint
(cherry picked from commit de8ef6dad7c89afb7041ccb489d68539a4849cb5)
* feat: add cross device sync.
* chore: add google api.
* chore: add SY specifics.
* feat: add backupSource, backupPref, and "SY" backupSavedSearches.
I forgot to add the data into the merging logic, So remote always have empty value :(. Better late than never.
* feat(sync): Allow to choose what to sync.
Various improvement and added the option to choose what they want to sync. Added sync library button to LibraryTab as well.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* oops.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* refactor: fix up the sync triggers, and update imports.
* refactor
* chore: review pointers.
* refactor: update imports
* refactor: add more error guard for gdrive.
Also changed it to be app specific, we don't want them to use sync data from SY or other forks as some of the model and backup is different. So if people using other forks they should use the same data and not mismatch.
* fix: conflict and refactor.
* refactor: update imports.
* chore: fix some of detekt error.
* refactor: add breaks and max retries.
I think we were reaching deadlock or infinite loop causing the sync to go forever.
* feat: db changes to accommodate new syncing logic.
Using timestamp to sync is a bit skewed due to system clock etc and therefore there was a lot of issues with it such as removing a manga that shouldn't have been removed. Marking chapters as unread even though it was marked as a read. Hopefully by using versioning system it should eliminate those issues.
* chore: add migrations
* chore: version and is_syncing fields.
* chore: add SY only stuff.
* fix: oops wrong index.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* chore: review pointers.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* chore: remove the option to reset timestamp
We don't need this anymore since we are utilizing versioning system.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* refactor: Forgot to use the new versioning system.
I forgot to cherry pick this from mihon branch.
* chore: remove isSyncing from Chapter/Manga model.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* chore: remove unused import.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* chore: remove isSyncing leftover.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* chore: remove isSyncing.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* refactor: make sure the manga version is bumped.
When there is changes in the chapters table such as reading or updating last read page we should bump the manga version. This way the manga is synced properly as in the History and last_read history is synced properly. This should fix the sorting issue.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
---------
Signed-off-by: KaiserBh <kaiserbh@proton.me>
* feat: db changes to accommodate new syncing logic.
Using timestamp to sync is a bit skewed due to system clock etc and therefore there was a lot of issues with it such as removing a manga that shouldn't have been removed. Marking chapters as unread even though it was marked as a read. Hopefully by using versioning system it should eliminate those issues.
* chore: add new line.
* chore: remove isSyncing from Chapter/Manga model.
* chore: remove isSyncing leftover.
* chore: remove isSyncing.
* refactor: remove isSync guard.
Just use it directly to 1 now since we don't have the isSyncing field in Manga or Chapter.
* Lint and stuff
* Add missing ,
---------
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit 4ae9dbe52487185ef9ee25f58fabe5025bb2278b)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/MangaBackupCreator.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupChapter.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupManga.kt
# data/src/main/java/tachiyomi/data/chapter/ChapterRepositoryImpl.kt
# data/src/main/sqldelight/tachiyomi/migrations/2.sqm
# domain/src/main/java/tachiyomi/domain/manga/model/MangaUpdate.kt
* Add custom thumbnail url. Support backup & restore
- add custom thumbnail url in edit info/custom
- include it in backup n restore
* increase chop char
* edit chop char again to match screenshoot
* tweak truncating middle part
* apply edited cover to history, updates , others
* simplify placeholder logic
---------
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
refactor: use transaction to go brr.
This improve the restore speed on fresh db and non fresh db.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
(cherry picked from commit b1067b942ef5c8d53e5ab838ef078789b9c0627a)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/MangaRestorer.kt
Wasn't working correctly in release build, _probably_ because of R8 despite kotlin-reflect
shipping with Proguard rules and us already keeping all Tachiyomi classes.
(cherry picked from commit 6ab8e1e73dbcc65d693dd2ed2680c950139dadde)
- In case you want a backup of just settings?
- Also disable backup options if dependent option is disabled (and fix being able to toggle disabled items)
- Also fix crash in RestoreBackupScreen due to attempt to parcelize Uri
- Make restore validation message a bit nicer
(cherry picked from commit f0a0ecfd4a5c8ee85fdcf7e92dc9a0079ef40cde)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/RestoreOptions.kt
I didn't realize the package name change would break compatibility with forks
that still have the old package names...
(cherry picked from commit 4b208fc7ce95fb3b3746446da54351bcead0533c)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/MangaBackupCreator.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupFlatMetadata.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupMergedMangaReference.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupSavedSearch.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/metadata/BackupSearchMetadata.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/metadata/BackupSearchTag.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/metadata/BackupSearchTitle.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/MangaRestorer.kt
Related to #3136
(cherry picked from commit 83a67feb48c4e40994a334520c907f71d2fbf75e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt
Some behavior changes:
- It prioritizes new entries, then anything more recently updated
- It copies the more recently updated entry's metadata (description, thumbnail, etc.)
(cherry picked from commit 58daedc89ee18d04e7af5bab12629680dba4096c)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt
# app/src/main/java/eu/kanade/tachiyomi/source/model/SMangaExtensions.kt
We already check in the settings screen where it's triggered, but who knows.
Also addressing some errors for method calls that require SDK 26+ (but don't
fail the build, somehow?).
(cherry picked from commit 1ef01b53f2e740b493e5a94cd4ac011ab25b3ace)
Related to #8327
Deleting doesn't seem to do anything still, but at least doesn't throw an exception.
Also removed behavior of dismissing notification after sharing/deleting pages/backups
in case you want to do something again afterwards. Users can manually dismiss the
notification whenever they want.
(cherry picked from commit 1f259f92986c3e4c86d6068eec257f6bd32f69b4)
The system will crash the app if the worker that calls setForeground() finished
before the service runner be able to call Service.startForeground(). This edge
case is not handled by WorkManager and there is no way to check if the required
calls are done.
So here we suspend the worker by an arbitrary duration assuming the transition
to foreground service is done by then.
(cherry picked from commit 24e1b4034efe24cc042404e2237f01ca1f2cd9b3)
Which has more correct nullability for some methods and case insensitivity for listFiles where possible.
(cherry picked from commit a74a689c9048cc67f4854678fbfefa361631a5e7)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
# source-local/src/androidMain/kotlin/tachiyomi/source/local/image/LocalCoverManager.kt
We just always create up to 4 now to simplify it, given the addition of syncing
is going to make this section pretty busy.
(cherry picked from commit e3b70ca08d1c5a09a448891ff66102fd696d7098)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreator.kt