timendum / raiplaysound

GNU General Public License v3.0
29 stars 11 forks source link

Fix bad episodes ordering #1

Closed FrancescoCappio closed 2 years ago

FrancescoCappio commented 2 years ago

In some cases episodes' timestamps on RaiPlaySound are not consistent with episodes order. For example the timestamps for the episodes of "Io ero il milanese" are:

Ep1 2022-03-11 15:33:00
Ep2 2022-03-11 15:33:01
Ep3 2022-03-11 15:41:00
Ep4 2022-03-11 15:41:02
Ep5 2022-03-17 11:21:00
Ep6 2022-03-17 11:17:00
Ep7 2022-03-17 11:13:00
Ep8 2022-03-17 11:13:03
Ep9 2022-03-25 15:09:00
Ep10 2022-03-25 15:09:04
Ep11 2022-03-25 15:05:00
Ep12 2022-03-25 15:09:00
Ep13 2022-04-01 11:12:00
Ep14 2022-04-01 11:12:05

With this fix the timestamp is automatically fixed. The final purpose is to have correct episodes ordering when importing the podcast in an app (AntennaPod in my case).

Timestamps with the fix applied:

Ep1 2022-03-11 15:33:00
Ep2 2022-03-11 15:33:01
Ep3 2022-03-11 15:41:00
Ep4 2022-03-11 15:41:01
Ep5 2022-03-17 11:21:00
Ep6 2022-03-17 11:21:01
Ep7 2022-03-17 11:21:02
Ep8 2022-03-17 11:21:03
Ep9 2022-03-25 15:09:00
Ep10 2022-03-25 15:09:01
Ep11 2022-03-25 15:09:02
Ep12 2022-03-25 15:09:03
Ep13 2022-04-01 11:12:00
Ep14 2022-04-01 11:12:01
timendum commented 2 years ago

Thanks for the PR, this is an issue I've found to, but I'm not sure about the fix, because it assumes that the order of appearance is always more important than the data in the json.

Are you sure this change does not introduce any drawbacks in other podcasts?

timendum commented 2 years ago

I've checked some podcasts and this PR would be and improvement for all of them, so i'm merging it, thanks.