advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.85k stars 484 forks source link

[Bug]: `index` column in `podcastEpisodes` table always has `-Inf` as value #3135

Open nichwall opened 4 months ago

nichwall commented 4 months ago

What happened?

The index column of the podcastEpisodes table seems to have been broken around server version 2.9.0. Podcast episodes downloaded before February 2024 (not sure exactly when I upgraded my main server) have the index column set, but all of the rows have -Inf as their value if the extraData column has data other than {}. Screenshots from the database below.

Episodes from before 2.9.0: index_normal

Episodes downloaded beginning with 2.9.0: index_infinity

What did you expect to happen?

Consistent data types for the OpenAPI spec, or some sort of database migration to keep everything consistent. I'm not really sure how the "previous" and "next" logic works in the web client Episodes modal because the web client is behaving as expected for episodes with and without the index column set correctly. If the modal is just using the series and episode field, maybe this column can be removed?

Steps to reproduce the issue

  1. Download podcast episodes from before 2.9.0 and after upgrading to 2.9.0 and inspect the database.

Audiobookshelf version

v2.10.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

advplyr commented 4 months ago

I'm not sure if we should remove that column yet. Originally podcast episodes would set that index column and allow for sorting podcast episodes. Sorting was removed but the index column remained getting updated for a while even though it wasn't used for anything. I'm not sure why it is -Inf so that should be fixed regardless

nichwall commented 4 months ago

That's fair. Removing the column from the database would also make rolling back to older versions more difficult. I mean if it isn't being used by a client then it can be removed from the API.

advplyr commented 4 months ago

Yeah it can be removed from the API