kagemomiji / airsonic-advanced

airsonic-advanced
GNU General Public License v3.0
166 stars 14 forks source link

[Bug]: Error loading list of podcasts when some of the files are missing/corrupt #316

Closed K3zter closed 9 months ago

K3zter commented 10 months ago

What happened?

I am assuming this is a new issue, as I recently updated to the latest snapshot - however it may be something else weird has changed. My situation is a bit of an edge case, however so it may be hard to replicate. I'll try to explain:

I have an old podcast that I downloaded all the episodes of and have been listening to, however at some point the feed stopped working properly - it would update with new episode titles but fail to download a file. So, in the database it has a list of episodes but they are unable to play. However, the OLD episodes still play just fine.

I listen to these in Dsub, which presumably makes an API request for the list of files when you click on the podcast. Up until recently, these dud podcasts would just show as 0:00 length.. but now instead I can't access the page at all and I get the following error:

"Server error: Cannot invoke "java.lang.Double.doubleValue()" because the return value of "org.airsonic.player.domain.MediaFile.getDuration()" is null

So I'm assuming where previously it would accept a null value and return a length of 0, now it's throwing an error instead.

Steps to reproduce

Not sure if this can be easily reproduced as how I arrived in this situation was a bit odd!

Version

11.1.x (Edge)

Version Detail

No response

Operating System

Docker container on Ubuntu

Java Version

17.0.5

Database

Other

DB Detail

Built-in

Configuration paramter

N/A

Proxy Server

No response

client detail

No response

language

None

Relevant log output

No response

kagemomiji commented 10 months ago

@K3zter Since I am trying to resolve #324 at the same time, could you please try the following Docker image ?

ghcr.io/kagemomiji/airsonic-advanced:pr-328

K3zter commented 10 months ago

Hey, appreciate your looking into this and all the work you're doing to keep airsonic up to date!

I've believe I've updated to that PR properly - the about page says commit dbcfbe. Sadly, the error is the same in Dsub: Screenshot_20231211_134914_DSub

I've tried to do a bit more digging to figure out what's going on:

K3zter commented 10 months ago

I've also made a copy of my airsonic db, and used HSQL to get a list of the entries for the affected podcast here (I stripped out the API key although I'm pretty sure it's useless now anyways). I've considered trying to remove the lines altogether in the main db, but trying to mess with airsonic dbs in the past has never ended well for me...

https://www.dropbox.com/scl/fi/qn0pcb8a3ebhtgmuk3ad2/podcastdb.txt?rlkey=445ythvehmdhsddu7xfxrgj6f&dl=0

Anyway, you can see that a bunch of the episodes say they have a "bytes downloaded" of 23, where presumably they just downloaded an error message. There were never any files for those podcasts as far as I can tell, even though they have a media_file_id.

kagemomiji commented 9 months ago

@K3zter Could you pull ghcr.io/kagemomiji/airsonic-advanced:pr-328 and try again?

K3zter commented 9 months ago

Yes, that fixed it! :) Thanks