[gpodder] Cannot store more than one play episode action

  • From: Martin Fietz <martinfietz@xxxxxxxxx>
  • To: gpodder@xxxxxxxxxxxxx
  • Date: Fri, 20 Mar 2015 11:50:32 +0100

[Hope this doesn't get sent twice. I subscribed with the wrong email
address at first.]

Hi,

I am trying to implement gpodder's episode actions into AntennaPod and
run into an issue with play actions.

Start, no actions:

$ curl -i -u marf:<PW> -H "Content-Type: application/json" -H "Accept:
application/json" -X GET
https://gpodder.net/api/2/episodes/marf.json?since=1426846000
-> {"timestamp":1426846255,"actions":[]}

Send two new play actions:

$ curl -i -u marf:### -H "Content-Type: application/json" -H "Accept:
application/json" -X POST -d '[ { "podcast":
"http://example.com/feed.rss";, "episode":
"http://example.com/files/foo.mp3";, "action": "play", "timestamp":
"2015-03-20T10:00:00", "started" : 0, "position" : 500, "total" : 1000
}, { "podcast": "http://example.com/feed.rss";, "episode":
"http://example.com/files/foo.mp3";, "action": "play", "timestamp":
"2015-03-20T10:10:00", "started": 500, "position": 750, "total": 1000
}]' http://www.gpodder.net/api/2/episodes/marf.json
-> {"timestamp":1426846646,"update_urls":[]}

Yeah, something is wrong with the result. In all my testing, I have
never seen a non-empty update_urls...

Check updates:

$ curl -i -u marf:### -H "Content-Type: application/json" -H "Accept:
application/json" -X GET
https://gpodder.net/api/2/episodes/marf.json?since=1426846000
-> 
{"timestamp":1426846682,"actions":[{"total":1000,"episode":"http:\/\/example.com\/files\/foo.mp3","started":500,"timestamp":"2015-03-20T10:10:00","action":"play","position":750,"podcast":"http:\/\/example.com\/feed.rss"}]}

Only the last action is returned...

Send another play action:
$ curl -i -u marf:### -H "Content-Type: application/json" -H "Accept:
application/json" -X POST -d '[{"podcast":
"http://example.com/feed.rss";, "episode":
"http://example.com/files/foo.mp3";, "action": "play", "timestamp":
"2015-03-20T10:15:00", "started" : 750, "position" : 950, "total" :
1000 }]' http://www.gpodder.net/api/2/episodes/marf.json
-> {"timestamp":1426846906,"update_urls":[]}

Checking...
$ curl -i -u marf:#### -H "Content-Type: application/json" -H "Accept:
application/json" -X GET
https://gpodder.net/api/2/episodes/marf.json?since=1426846000
-> 
{"timestamp":1426846923,"actions":[{"total":1000,"episode":"http:\/\/example.com\/files\/foo.mp3","started":500,"timestamp":"2015-03-20T10:10:00","action":"play","position":750,"podcast":"http:\/\/example.com\/feed.rss"}]}

Nope, from now on any new play actions are ignored... Seems like some
kind of unique constraint on podcast, episode and action.

I am not sure if I am doing anything wrong or if this is an actual bug.

Any help is appreciated.

Have a good day,
Martin Fietz

Other related posts: