halpz / HalpoPlayer

MIT License
30 stars 4 forks source link

[Issue] Client crashes when attempting to view or listen to downloaded albums without a Wi-Fi connection #18

Open Optekah opened 10 months ago

Optekah commented 10 months ago

Howdy :)

Albums get downloaded and cached properly from what I can tell, no problems there.

When I leave the house, and lose my Wi-Fi connection, I am unable to click on any of the downloaded albums. As soon as I do, the entire app instantly hard crashes every time. In the Downloads tab, there are two columns, one being Albums and the other Songs. When I browse the Songs tab, the app is stable, and I can listen to music on the go. It's only when I click on an album from the albums tab.

It should be noted that this doesn't happen when I am connected to a Wi-Fi network. Not that there is any reason to view and listen to downloaded music in the house when I have access to my Navidrome server over Wi-Fi, but I digress. It is stable in that scenario, without fail.

Honestly this is the snappiest, cleanest iOS client I could find for Navidrome. A few fixes here and there and some new features and it will be leaps and bounds better than literally everything else out there. Let me know if you need any more info. I am not the brightest of the bunch and I don't know jack about coding but I'll try my best to help in any average user type of way.

Thanks for the hard work put into this client!

Navidrome v0.50.2 (823bef54) Unraid 6.12.4 Halpo 1.0.8 iOS 17.1.2 iPhone XR

halpz commented 10 months ago

thanks, I will look into it when I get a chance!

joshuarli commented 1 month ago

Ran into this as well. Cleanest iOS client by far, and was hoping to use it offline. As the report says - playing offline songs work, but offline albums crashes. I'm on wifi, but my Navidrome server is offline (I don't have it online 24/7, to save electricity), so that's probably the issue. If HalpoPlayer has a connection to the server, offline albums works. It's probably a failed network request going unhandled.

I'll take a closer look soon, I've never built any iOS apps before so this should be fun. HalpoPlayer is pretty much perfect otherwise.

joshuarli commented 1 month ago

For me, the issue is in albumTapped. When I turn tailscale off on my phone, http://box (tailscale magicDNS for my Navidrome server) fails a hostname lookup when I tap on an album. There's still a network connection so if SubsonicClient.shared.reachability?.connection == Reachability.Connection.unavailable isn't a strict enough condition to determine if we should lookup an album or get the offline one.

Luckily I found AccountHolder.shared.offline which seems like what we want here!