oxtyped / gpodder2go

gpodder2go is a simple self-hosted, golang, drop-in replacement for gpodder/mygpo server to handle podcast subscriptions management for gpodder clients
GNU Affero General Public License v3.0
102 stars 13 forks source link

Synchronization Api missing #16

Closed peterpepo closed 7 months ago

peterpepo commented 1 year ago

Is synchronization api implemented? I spinned up a docker image of gpodder2go (https://github.com/owenvoke/gpodder2go-docker), set up two devices under one account, now I would like to sync those two devices.

When I run http://192.168.2.40:8081/api/2/sync-devices/gp2goadmin.json -> I get 404 page not found

How are you supposed to sync two clients (Antennapod on Android installations) without sync api?

If I understand it correctly, you set up and list synchronizations using this: https://gpoddernet.readthedocs.io/en/latest/api/reference/sync.html

My understanding of devices under one account is coming from here: https://antennapod.org/documentation/general/synchronization

oxtyped commented 11 months ago

Thanks for this! There isn't synchronization yet but it shouldn't be too hard to implement it.

Let me try and work on this, this week! In the meantime, leaving this open to make sure we don't lose track of this issue!

oxtyped commented 11 months ago

@peterpepo

Just to understand this a little better, synchronization appears to be a one-time effort where once synchronized, new subscriptions or deletions on one device will always affect the other device?

Does this expect episode actions (eg. playing till a certain timestamp) on one device to also be synced?

oxtyped commented 11 months ago

Just for my own reference, gpodder/mygpo seem to treat the first value of the device in the synchronize request body as the main device to have other devices synchronize to.

https://github.com/gpodder/mygpo/blob/master/mygpo/api/advanced/sync.py#L75-L81

And it would appear that sync does not handle deletion, instead it propagate all new podcast subscriptions on any of the devices to the other devices in its sync group

https://github.com/gpodder/mygpo/blob/80c41dc0c9a58dc0e85f6ef56662cdfd0d6e3b16/mygpo/users/models.py#L188-L212

peterpepo commented 10 months ago

@peterpepo

Just to understand this a little better, synchronization appears to be a one-time effort where once synchronized, new subscriptions or deletions on one device will always affect the other device?

Does this expect episode actions (eg. playing till a certain timestamp) on one device to also be synced?

My understanding and expected use is any changes (new, removed subscriptions, played status, playback position, etc..) to be always reflected on all devices. So if I play on device A, then jump onto device B, sync, and everything is mirrored.

Sorry for late reply, it has been a while, since I listened to podcasts on separate device, and forgot about this feature request. I wanted to look and get into topic, before replying your question. :)

oxtyped commented 10 months ago

No worries at all! Thanks for the reply!

Been busy working on this feature. Hoping I can get it out by next week 🤞

Sorry that its taking a while, there's quite a bit of other work commitments lately.

oxtyped commented 7 months ago

Hey all, just some updates, I've pushed out v0.2.0 release which contains the sync endpoint function that was just merged into main.

This release adds support for the 2 /sync-device endpoints.

Right now you'll have to manually call the API endpoints to sync the devices (ref: https://gpoddernet.readthedocs.io/en/latest/api/reference/sync.html) but I will be working on adding a wrapper to the endpoints as a cli command soon. (if anyone wants to take a stab at that, please don't let me stop you).

Do let me know if you run into any issues! 🙏

oxtyped commented 7 months ago

Closing this issue. Please feel free to reopen if there's any other sync-related issues, or open a new one.