- 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.
Experimental for now, but works fine so far, I don't know about google api limit but I think it's pretty generous.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
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>