XilinJia / Podcini

Open source podcast instrument for Android in Kotlin with media3, supporting channels, playlists, podcasts and single media from YouTube and YT Music as well as normal podcasts.
GNU General Public License v3.0
158 stars 7 forks source link

Sync with Nextcloud Gpoddersync fails #49

Closed theheckwr closed 1 week ago

theheckwr commented 4 months ago

Checklist

App version

5.4.0 (36e1823)

Where did you get the app from

F-Droid

Android version

LineageOS 21-24240318-NIGHLY-pstar (Android 14)

Device model

No response

First occurred

No response

Steps to reproduce

  1. Add Sync with Nextcloud (via gpoddersync, Nextcloud hosted on subpath (e.g. example.com/nextcloud))
  2. Login

Expected behaviour

Sync successfully

Current behaviour

Sync fails, sometimes reports: Screenshot_20240528-231209_Trebuchet

Logs

On the server's access log:

2.212.xxx.xxx - - [28/May/2024:21:15:14 +0000] "GET //nextcloud/index.php/apps/gpoddersync/subscriptions?since=0 HTTP/2.0" 404 19 "-" "-" 1168800 "-" "-" 0ms

⇒ That "//" at the beginning seems to be the problem (this issue of Antenna Pod seems similar)

XilinJia commented 4 months ago

I see. Thanks for reporting.

So someone use the server-based sync. I was thinking about removing the feature of sync to servers, focusing more on wifi/instant sync. Can you give some comment on #48 ?

XilinJia commented 3 months ago

I stripped the first "/" and a release will be out shortly. Since I don't have such a server set up, I would rely on any feedback to see if it works.

XilinJia commented 3 months ago

This glitch has been there for ages, since the older AntennaPod. Amazing it's just surfaced.

XilinJia commented 3 months ago

Please confirm this?

theheckwr commented 3 months ago

Sorry, for the late reply. I've been very busy lately and F-Droid takes some time to push out your update. Long story short: It works! Thanks a lot for fixing!

XilinJia commented 3 months ago

Glad it works.

d3ighty commented 2 months ago

Hello, i got the Error "404" when trying to sync with gpoddersync on nextcloud. However i cant easily provide logs. Im using the newest version. AnetennaPod sync works flawless.

XilinJia commented 2 months ago

Sorry about that. I will check what might a problem there. The thing again is I don't have a test environment for that.

Can someone explain in some detail why exactly you need sync with a server like gpoddersync?

d3ighty commented 2 months ago

In my case because I listen to podcast on my pc via nextcloud via repod addon or kasts and on my phone via podcini. In order to always have the same subscription and played Informations, it's synced with gpoddersync

XilinJia commented 2 months ago

I see. Do you know in which recent version the sync works?

d3ighty commented 2 months ago

The latest version I used before was the latest version 5,i believe. The latest one before you updated the packageid

XilinJia commented 2 months ago

Do you know if it's 5.5.5, 5.5.4, ...?

XilinJia commented 2 months ago

Seems this is broken in 5.5.1 and 6.0.0 builds on top of 5.5.2, and the most recent version 6 releases stay compatible with 5.5.5 in terms of these sync features.

Since 5.5.1 and 6.0.0, three properties have been added to EpisodeActions: playedDuration, playState, isFavorite.

These improve wifi sync as well as import/export of progress, but possibly break the nextcloud and gpoddernet syncs which don't include these properties. In the coming 6.1.6 I removed these properties when syncing with either of the two servers. Let me know that helped.

d3ighty commented 2 months ago

thanks for your fast work, but it still reports "code 404"

XilinJia commented 2 months ago

Hum, I see. I guess @theheckwr confirmed it worked with 5.5.0 (or some version earlier but later than 5.4.0). Could you do a test on 5.5.0 and 5.5.1 and let me know if my assumption that the former works and the latter doesn't is correct?

XilinJia commented 2 months ago

@d3ighty I think it's more likely an issue with your connection with the server. Are you sure you have specified the correct hostname and port number etc? When you start using Podcini.R (i.e. version 6), you need to redo the settings. Sure, you can import the settings from version 5, but can you verify all the settings are correct, just in cases there might be errors in the import process?

d3ighty commented 2 months ago

5.5.0 and 5.5.1 are working, i just tested those. However i dont import settings and did a clean install, because i only need to change a few settings and and i was sure, a lot of things changed since i last updated. Hostname etc is the same for all versions.

XilinJia commented 2 months ago

I see. That's good to know. can you possibly get a server log of things like: 2.212.xxx.xxx - - [28/May/2024:21:15:14 +0000] "GET //nextcloud/index.php/apps/gpoddersync/subscriptions?since=0 HTTP/2.0" 404 19 "-" "-" 1168800 "-" "-" 0ms

XilinJia commented 2 months ago

Also, I wonder, in Settings->Synchronization, when you enter the server address in the Login dialog and then press "Proceed to login", did it succeed?

d3ighty commented 2 months ago

It does succeed. I'm looking if I can provide any logs.

XilinJia commented 2 months ago

And, if you don't mind, can you export and send me the preference file? it should "ac.mdiq.podcini_preferences.xml" in the exported directory.

d3ighty commented 2 months ago

Here you go. Ive renamed to txt file. So github supports it. ac.mdiq.podcini.R_preferences.txt

d3ighty commented 2 months ago

I just exported the preferences from 5.1.1 and imported to newest 6 version, and now the syncs seems to work. Atleast it's in my sync settings and I just imported podcasts, but the episodes status, categories or whatever wasn't synced

XilinJia commented 2 months ago

That's interesting. can you send me the new preference file? the previous file doesn't contain relevant info, wonder why.

to update your episodes status, you need to import the podcasts first, then import the progress. To get a best progress file, it's better exporting it from 5.5.5.

categories and podcast settings are not available for import.

d3ighty commented 2 months ago

New file looks identical. Which entry are you looking for?

XilinJia commented 2 months ago

Sorry, it should be this file instead: gpodder.net.xml

I wonder what are the differences between the new one and the old one, especially for prefGpodnetHostname, prefHostport

d3ighty commented 2 months ago

Also the same entry for old and new file.

XilinJia commented 2 months ago

Wow, that's really strange it didn't work before.

d3ighty commented 2 months ago

I would say, that version 6 writes doesn't save the login or whatever. I'm glad it's working with the export workaround. Looking forward for future features

XilinJia commented 2 months ago

So you said gpodder.net.xml is the same before and after you import the preferences? So before importing, it has the login etc? Can you verify that? I would like to get this right for other users.

d3ighty commented 2 months ago

Podcini 6 before import: no gpodderxml at all, because of the 404 error. Podcini 5 export gpodderxml same as exported Podcini 6 gpodderxml after importing the Podcini 5 preferences into Podcini 6.

I hope that's what you meant

XilinJia commented 2 months ago

I see. Thank you.

Dacid99 commented 1 week ago

Hey, I have the same issue trying to sync against my nextcloud. Im using the new Podcini.R version 6.6.6 from fdroid.

The main thing I can contribute to this discussion is that it did and does work with the old podcini app version 5.5.2 from fdroid. Maybe one could just roll the respective code back to that version as a fix?

XilinJia commented 1 week ago

@Dacid99 Thanks for the info. In discussing with @d3ighty , I had the impression that gpodder.net.xml was not saved in Podcini.R, but I'm not sure how come. He seemed to work around it by importing all the preferences (including gpodder.net.xml) from version 5 and get it work for version 6. Can you test it if it's the case? Then I will try to figure out what is happening (my difficulty on this is that I don't have such a server set up for testing).

Dacid99 commented 1 week ago

Yes I tried it and I can fully back up what has already been found. I can export the gpodder.net.xml on the old version (5.5.2), on the new version (6.6.6) it doesnt exist. When I import the preferences from the old into the new version, the sync seems to work.

Dacid99 commented 1 week ago

I've tried looking into the code but as far as I could tell all that changed from 5.5.2 to the first version 6 fdroid release was the location of the classes in charge of sync. Maybe something in the manifest or other metafiles causes the issue. I may do some debugging tomorrow in case I remain curious of this issue..

XilinJia commented 1 week ago

Appreciate your effort @Dacid99

Dacid99 commented 1 week ago

I found the bug and am looking for the best fix. Ill send you a pull request probably by tomorrow