Skip to content

Implement SyncYomi#1813

Open
Bartuzen wants to merge 42 commits intoSuwayomi:masterfrom
Bartuzen:syncyomi
Open

Implement SyncYomi#1813
Bartuzen wants to merge 42 commits intoSuwayomi:masterfrom
Bartuzen:syncyomi

Conversation

@Bartuzen
Copy link

@Bartuzen Bartuzen commented Dec 10, 2025

Closes #1102

This PR adds SyncYomi support to Suwayomi. Most of the code is taken directly from TachiyomiSY, and modified to work with Suwayomi.

I only tested syncing between a Suwayomi instance and TachiyomiSY. Syncing multiple Suwayomi instances should work, but I didn't test it.

TODO

  • Return a proper result from sync endpoint
  • Add PostgreSQL support
  • Add periodic sync
  • Add sync triggers
  • Add ability to select what to sync
  • Don’t allow two syncs at the same time
  • Sync before library update

@Caio99BR
Copy link

Any update?

@Syer10
Copy link
Collaborator

Syer10 commented Dec 19, 2025

If you check the commits tab you will see there have been many updates. This is progressing at a good pace, hopefully it will be ready soon.

@Bartuzen
Copy link
Author

I don't use sync triggers and I'm too lazy to implement them so I'm marking the PR as ready.

@Bartuzen Bartuzen marked this pull request as ready for review December 19, 2025 17:52
- Move entire sync operation into a single transaction
- Stop loading all manga to memory
@Bartuzen Bartuzen requested a review from Syer10 December 20, 2025 20:26
@Bartuzen Bartuzen requested a review from Syer10 December 21, 2025 17:20
@Bartuzen Bartuzen requested a review from Syer10 December 26, 2025 19:57
@Bartuzen Bartuzen marked this pull request as draft January 4, 2026 00:03
@Bartuzen Bartuzen marked this pull request as ready for review January 6, 2026 20:37
@RalkeyOfficial
Copy link

RalkeyOfficial commented Jan 8, 2026

Curious 3rd party here, how does Suwayomi handle a 'loop' where a synced manga has a source which points back to itself through the Suwayomi extension?

As far as I know this was never a possible issue to consider with SyncYomi's / TachiyomiSY's original implementation (since most code is copied from TachiyomiSY according to Bartuzen).

privacySafe = false,
)

val syncDataManga: MutableStateFlow<Boolean> by BooleanSetting(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it intentional that the rest of the new settings do not have the syncYomi prefix?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, because other sync services may be implemented in the future. For example, TachiyomiSY also supports syncing to Google Drive.
syncYomi prefixed options apply only to SyncYomi, while sync prefixed options would apply regardless of the sync service.

}

private fun updateNonFavorites(nonFavorites: List<BackupManga>) {
nonFavorites.forEach { nonFavorite ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't a single query and a batch update be better here?

Copy link
Author

Choose a reason for hiding this comment

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

Same as other one. See this discussion.

)

@RequireAuth
fun startSync(input: StartSyncInput): StartSyncPayload {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be possible to stop the sync?

Copy link
Author

Choose a reason for hiding this comment

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

I was planning to implement that, but backup and restore aren't stoppable, and those are the tasks that actually take a long time. So I decided not to implement it.

) {
saveLastUpdateTimestamp()
scope.launch {
SyncManager.ensureSync()
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the benefit of starting a sync before an update?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not exactly sure. That's how it's implemented in TachiyomiSY, so I copied it.

Choose a reason for hiding this comment

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

What is the benefit of starting a sync before an update?

At the time I implemented that because it's better to sync changes first that way everything is "up to date" before triggering an update, so there is no mismatch etc but I think it's not really needed? I haven't really tested it without it but at the time there must have been some bug that made me implement it that way.

@Caio99BR

This comment was marked as off-topic.

@Breezyslasher
Copy link

Any updates on when this will be merged into the app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] SyncYomi implementation

7 participants

Comments