Fix gpodder sync: return update_urls in subscription GET response
All checks were successful
Build and push Docker image / build (push) Successful in 16s
Test / test (push) Successful in 15s

AntennaPod throws JSONException when update_urls is missing from the
subscription list response. Return the change-format object instead
of a plain array for GET requests without a since parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
marwin 2026-03-28 17:15:36 +01:00
parent 2859464b14
commit a205eafd79

View file

@ -143,7 +143,7 @@ def subscriptions_by_device(request, username, deviceid):
return JsonResponse({'add': added, 'remove': removed, 'timestamp': _now_ts(), 'update_urls': []}) return JsonResponse({'add': added, 'remove': removed, 'timestamp': _now_ts(), 'update_urls': []})
else: else:
urls = list(PodcastFeed.objects.filter(user=request.user).values_list('rss_url', flat=True)) urls = list(PodcastFeed.objects.filter(user=request.user).values_list('rss_url', flat=True))
return JsonResponse(urls, safe=False) return JsonResponse({'add': urls, 'remove': [], 'timestamp': _now_ts(), 'update_urls': []})
elif request.method == 'POST': elif request.method == 'POST':
try: try:
@ -178,7 +178,7 @@ def subscriptions_all(request, username):
return JsonResponse({'add': added, 'remove': removed, 'timestamp': _now_ts(), 'update_urls': []}) return JsonResponse({'add': added, 'remove': removed, 'timestamp': _now_ts(), 'update_urls': []})
else: else:
urls = list(PodcastFeed.objects.filter(user=request.user).values_list('rss_url', flat=True)) urls = list(PodcastFeed.objects.filter(user=request.user).values_list('rss_url', flat=True))
return JsonResponse(urls, safe=False) return JsonResponse({'add': urls, 'remove': [], 'timestamp': _now_ts(), 'update_urls': []})
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------