- Introduced `LockFile` data class to manage sync status and ownership.
- Enumerated `SyncStatus` to clearly indicate the stage of synchronization: Pending, Syncing, or Success.
- Implemented a new `beforeSync` method utilizing `OkHttpClient` for secure HTTP calls to manage the lock file.
- Added JSON serialization for lock file management and status updates.
- Implemented exponential backoff strategy to handle concurrent sync attempts and reduce race conditions.
- Added comprehensive logging for debugging and monitoring sync processes.
This update enhances the reliability and concurrency handling of SyncYomi's synchronization process, ensuring users experience seamless and efficient data syncing in a self-hosted environment.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This is sort of a workaround for sources that tend to only give you the first few and
most recent few chapters, which would have been 28 day intervals before due to
the big gap in the middle.
Some behavior changes:
- It prioritizes new entries, then anything more recently updated
- It copies the more recently updated entry's metadata (description, thumbnail, etc.)
- Removed SyncDevice, device name since it's not used anymore by syncyomi server.
- Removed SyncStatus, used internally in the server doesn't need the data to be sent from tachi app.
- This way we just keep the manga data/backup that we can send to many services more generic.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
- Revised several fields to utilize `appStateKey` for enhanced state management.
- Modified notification behavior:
- Removed frequent 'sync completed' notifications to reduce redundancy.
- Notifications now trigger only on sync errors, streamlining user alerts.
- Users should refer to the 'last sync timestamp' to verify successful synchronizations.
- The timestamp updates only when syncs complete successfully, providing a reliable success indicator.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
Closes#1652
Also removes the ability to trigger refreshes for the entire library or
as part of a library update as it should no longer be needed. Opening
the tracking sheet already refreshes the data too, so stale data is
irrelevant there.
Also closes#4775 since it would no longer be relevant.