Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cross device sync #40

Closed
wants to merge 208 commits into from

Conversation

kaiserbh
Copy link
Contributor

ref: GitHub - Tachiyomi Pull Request #9790

Currently, there are two services available: Syncyomi, which is self-hosted, and Google Drive.

Once merged you will need to create OAuth 2.0 Client IDs in google console then replace the app/src/main/assets/client_secrets.json

image

Once all of that is done just need to set the app to publish instead of testing that way everyone can access it otherwise limited to 100 users we add for testing, we don't need to submit the app for approval since we are not using sensitive scopes. More info here

OAuth Consent Screen

image

Scopes

image

image
image
image
image
image

AriaMoradi and others added 30 commits July 6, 2023 14:08
TODO: refactor them as the code is duplicated for now.
Signed-off-by: KaiserBh <[email protected]>
Signed-off-by: KaiserBh <[email protected]>
As we fixed the issue with removing favorites we don't the extra stuff.

Signed-off-by: KaiserBh <[email protected]>
…m backup.

I fixed this before but I believe it slipped past while refactoring and splitting into smaller PR, This fixes the unread chapter so if a device have unread chapters or user marked it as unread it should restore it properly now.

Signed-off-by: KaiserBh <[email protected]>
@AntsyLich
Copy link
Member

Initially I'll do reviews on small independent sections and ask you to make separate pr for them e.g. the db change you did which you can go ahead and make a pr for

@kaiserbh
Copy link
Contributor Author

Initially I'll do reviews on small independent sections and ask you to make separate pr for them e.g. the db change you did which you can go ahead and make a pr for

#113

Copy link
Member

@AntsyLich AntsyLich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a separate PR for this file and also maybe prefix all of them with __SYNC__?

@kaiserbh
Copy link
Contributor Author

Make a separate PR for this file and also maybe prefix all of them with __SYNC__?

#149 Let me know on that branch if I need to change anything else.

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.
@LightDestory
Copy link

Build fails?

@kaiserbh
Copy link
Contributor Author

kaiserbh commented Feb 5, 2024

Build fails?

Hmm the build is okay it's just detekt errors, which is just too strict at the moment, to name a few:

Class 'SyncPreferences' with '13' functions detected. Defined threshold inside classes is set to '11' [TooManyFunctions]

/home/runner/work/mihon/mihon/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt:371:43: This expression contains a magic number. Consider defining it to a well named constant. [MagicNumber]

/home/runner/work/mihon/mihon/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt:372:44: This expression contains a magic number. Consider defining it to a well named constant. [MagicNumber]

I think we were reaching deadlock or infinite loop causing the sync to go forever.
@kaiserbh kaiserbh requested a review from AntsyLich February 7, 2024 00:28
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.
@kaiserbh kaiserbh closed this Feb 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants