Commit Graph

164 Commits

Author SHA1 Message Date
Andreas b668364afb Split security preferences from PrefrencesHelper (#8030) 2022-09-18 13:07:48 -04:00
Andreas 0086743a53 Use 1.x preference abstraction (#8020)
* Use 1.x preference abstraction

- Uses SharedPreferences compared to 1.x impl which uses DataStore but it breaks all settings screens currently
- Move PreferencesHelper to new PreferenceStore
  - PreferencesHelper should be split into smaller preference stores and be in core or domain
- Remove flow preferences as new PreferenceStore handles changes for us

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>

* Fix PreferenceMutableState not updating

* Fix changes not emitting on first subscription

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>
2022-09-17 11:48:24 -04:00
arkon 829aadd0bd Always attempt automatic backup creation
- Defaults to every 12 hours
- Minimum number of backups is now 2, just to offer some level of redundancy in case something happens
- If it's missing storage permissions, it'll fail but that's the user's loss if they somehow haven't granted that permission yet
2022-09-15 22:53:46 -04:00
Andreas 86fe850794 Extract source api from app module (#8014)
* Extract source api from app module

* Extract source online api from app module
2022-09-15 18:12:27 -04:00
arkon cd3cb72b65 Bump dependencies + linting 2022-09-10 23:57:03 -04:00
nzoba 07d1b9f3ba Fix download ahead missing out 1 chapter (#7927)
* Fix download ahead missing out 1 chapter

* Move toLong() function

* Add check whether the next chapter is queued
2022-09-09 22:29:24 -04:00
Andreas 09abfc7843 Lint changes (#7802)
- Fixes current lint issues
- Changes lint task to lintKotlin on PRs
2022-08-18 14:06:32 -04:00
arkon d6f1534ee8 Address misc. build warnings 2022-08-10 23:26:34 -04:00
arkon 9f0052eceb More backup/restore code cleanup 2022-08-06 15:40:50 -04:00
arkon a2bb81b7db Start cleaning up backup/restore code
The abstraction was useful for handling 2 systems, but it's no longer needed. Cleaning it up will make migrating to domain models easier down the line.
2022-08-05 23:11:06 -04:00
Andreas 914831d51f Move default category into database (#7676) 2022-08-05 09:32:10 -04:00
nzoba 3d4e56948d Save read duration to backup (#7672)
* Save read duration to backup

* Add default value

Co-authored-by: Andreas <andreas.everos@gmail.com>

Co-authored-by: Andreas <andreas.everos@gmail.com>
2022-08-03 17:40:13 -04:00
Andreas 069bd90c0f Cleanup data layer (#7450) 2022-07-03 15:48:13 -04:00
arkon 68697e59d7 More domain model usage 2022-07-03 13:46:09 -04:00
arkon 21771e62aa More SQLDelight migrations 2022-07-02 15:19:52 -04:00
arkon 7e4c45858f Bump dependencies 2022-06-29 22:45:22 -04:00
arkon 65264e3ef5 Migrate more track DB calls to SQLDelight 2022-06-26 19:46:41 -04:00
Taco c2520bff12 Utilize more KTX extensions (#7348) 2022-06-20 22:54:42 -04:00
arkon 254f021903 Minor cleanup 2022-06-20 22:51:04 -04:00
Andreas c5d84b4f24 Fix History not being added when restoring backup (#7324) 2022-06-17 17:29:07 -04:00
AntsyLich 9d5b7de1d8 Maintain source info in the database. (#6389)
* Maintain Source Info in database

* Review changes and cleanups

* Review changes 2

* Review Changes 3
2022-06-14 09:10:40 -04:00
Andreas fd5da2de3a Use SQLDelight in Backup/Restore (#7295)
* Use SQLDelight in Backup/Restore

* Use CoroutineWorker
2022-06-12 14:33:48 -04:00
AntsyLich 120943a8b3 Make syncChaptersWithSource use sqldelight (#7263)
* Make `syncChaptersWithSource` use sqldelight

Will break chapter list live update on current ui

Co-Authored-By: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>

* Review Changes

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
2022-06-11 11:38:39 -04:00
arkon 7fdbf40cd2 Minor cleanups
Pulling out some of the smaller changes that aren't related to the manga controller changes in #7244
2022-06-04 16:01:49 -04:00
arkon d1be221d7a Remove logic for restoring legacy JSON backups
- Protobuf backups have been around for 1.5 years now
- The ability to restore online-dependant data from JSON backups gets harder as time goes on and sources drift
- If users really need a way to restore them, they can use an older version of the app, or a separate tool for translating between the formats could be created
2022-05-29 12:24:39 -04:00
arkon 87661eb85a Minor cleanup 2022-05-24 18:16:07 -04:00
Andreas 0c631a4990 Add MangaUpdates as a tracker (#7170)
* Add MangaUpdates as a tracker

- jobobby04 co-authored for suggestion in BackupTracking.kt

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>

* Changes from code review

Co-authored-by: arkon <arkon@users.noreply.github.com>

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
Co-authored-by: arkon <arkon@users.noreply.github.com>
2022-05-24 18:00:33 -04:00
nicki 11c01235ac Don't save categories in backup if not selected (#7101)
Currently, manually created backups contain list of categories even if
Categories option is not selected during Backup Prompt. This leads to
empty categories being created when restoring such backup files

This commit adds a check before saving categories list info to the
backup file. The check is the same check which is used while backing up
category info of manga in library

Tested and worked successfully on app installed on Android 12
2022-05-09 11:03:40 -04:00
arkon dee7830793 Update navigation bar padding in Compose screens 2022-04-30 11:59:39 -04:00
arkon 2b79295240 Revert "Revert history Compose/SQLDelight changes"
This reverts commit 96c894ce5b.
2022-04-22 17:35:18 -04:00
arkon 96c894ce5b Revert history Compose/SQLDelight changes 2022-04-22 17:27:58 -04:00
arkon 189f92d7e8 Show better error message when empty backup creation is attempted (closes #6941) 2022-04-17 11:51:24 -04:00
Andreas c475acd1ea Migrate History screen to Compose (#6922)
* Migrate History screen to Compose

- Migrate screen
- Strip logic from presenter into use cases and repository
- Setup for other screen being able to migrate to Compose with Theme

* Changes from review comments
2022-04-17 10:36:22 -04:00
arkon 5afff31f72 Formatting 2022-04-08 16:44:23 -04:00
arkon f0eb42e72d Update linter 2022-04-08 15:30:39 -04:00
arkon 45da036789 Avoid potentially deleting the entire backups folder 2022-03-09 18:04:52 -05:00
Andreas 86016de6cb Recreate Backup worker with IS_AUTO_BACKUP_KEY flag (#6742)
* Recreate Backup worker with IS_AUTO_BACKUP_KEY flag

* Extra safety net to not delete backup folder
2022-03-06 08:36:47 -05:00
arkon d06984e3a3 Use same name for manual backup job tag and work name 2022-03-05 09:49:21 -05:00
Ivan Iskandar d53bb4c337 Use existing worker for manual backup creation (#6718)
* Use existing worker for manual backup creation

This will show the "creating backup" notification when auto backup is
running. Complete or error notification will continue to be shown only on
manual job.

* Make sure disabling auto backup don't cancel running manual backup job
2022-03-03 22:15:49 -05:00
啊o额iu鱼 6f5328f663 Fix corrupted backup file, fix #6424 (#6691)
Reappear stably on the api30 Android Studio Emulator,
first save a large backup file,
then save a small backup file, overwriting the previous larger backup file,
so you get a backup file with a larger size but only the first part is meaningful,
2022-02-23 09:12:24 -05:00
arkon b459234ddc Try to show more relevant exception messages when failing to restore a backup 2022-01-26 22:43:27 -05:00
arkon 76d2c676fd Discard backup file if it fails to be created properly (e.g. fails validation) 2022-01-26 22:32:06 -05:00
arkon d5015d37e1 Show error toast if empty URI is passed when trying to create/restore a backup 2022-01-26 22:31:28 -05:00
arkon 1b71e4cee7 Write job failure exceptions to error log 2022-01-26 22:21:01 -05:00
arkon 4f56071786 Validate backup during creation 2021-10-28 22:40:53 -04:00
arkon 9352e249ee Make tapping library update and backup restore error notifications open log 2021-10-18 09:58:35 -04:00
Ivan Iskandar 2e127dff1f Replace Timber with Square Logcat and make logging configurable (#6062)
* Replace Timber with Square Logcat

* Configurable logger
2021-10-07 22:12:55 -04:00
Jace 9a7a03e327 Change ProtoNumber of Backup Models for History and Source to a non-zero digit (#5849)
* Change ProtoNumber of Backup Models for History and Source to non-zero

Changed BackupHistory url and BackupSource name properties

* Provide backwards compatibility to current proto backups

- Added data class for zero-based protoNumber
- Restore both 'new' proto and old ones by mapping old to 'new' proto format
- Thanks to @jobobby04  for providing the initial solution.

* Fix on createBackup missing parameter for brokenSource

* Fix issues on build

* Fix missing import on FullBackupRestore
2021-09-11 18:10:10 -04:00
arkon e942b8a402 Read from streams for local source manga details and legacy backups 2021-09-06 11:54:00 -04:00
Gauthier 2cd8733212 change Track.last_chapter_read to Float (#5802)
each TrackService can convert it to Int if decimal chapters are not supported
2021-08-28 10:37:45 -04:00