dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
680 stars 27 forks source link

Album lists aren't populating when connecting to Astiga #248

Closed gravelld closed 9 months ago

gravelld commented 9 months ago

Hi, I and another user (https://community.asti.ga/discussion/623/cant-connect-to-subsonic-clients#latest) are having a problem connecting Supersonic to Astiga. Almost all lists don't seem to be populating.

For albums, I can see that Supersonic makes a request:

GET /rest/getAlbumList2?c=supersonic&f=xml&offset=0&s=???&type=alphabeticalByName&u=???&v=1.8.0 HTTP/1.1

And Astiga replies:

<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response status="ok" version="1.16.0" serverVersion="Astiga/production" xmlns="http://subsonic.org/restapi">
    <albumList2>
        <album id="109701" parent="109700" title="(Loin des) Rivages" album="(Loin des) Rivages" name="(Loin des) Rivages" artist="Bon Voyage Organisation" artistId="109700" isDir="true" duration="5360" songCount="20" coverArt="109702" created="2023-09-15T10:17:12" year="2022"/>
        <album id="109704" parent="109703" title="1 - Four Orchestral Pieces - Concerto For Orchestra [Boulez]" album="1 - Four Orchestral Pieces - Concerto For Orchestra [Boulez]" name="1 - Four Orchestral Pieces - Concerto For Orchestra [Boulez]" artist="Pierre Boulez" artistId="109703" isDir="true" duration="7198" songCount="18" coverArt="109705" created="2023-09-15T10:17:12" year="1993"/>
        ...

However the albums lists remain blank.

The only thing that seems to work is the genre list, which is populated. However, clicking on a genre shows nothing in its list.

I thought this used to work, but maybe there's something Astiga is doing that Supersonic is not expecting... But a quick review of the Subsonic API checks out.

Maybe there's some logging I can enable?

dweymouth commented 9 months ago

The logging situation for Supersonic right now is not great, unfortunately. I don't have an option to enable extra verbose logs but I do log out many (most?) errors. If you run it from the command line does it log out any error message? Also is there an Astiga demo server I could connect to for debugging on my end?

gravelld commented 9 months ago

There is a demo server, but I'll need your email... send it to info@asti.ga .

Oh, I think I've seen the issue:

2023/09/15 19:19:09 error fetching albums: parsing time "2023-09-15T18:19:09" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "Z07:00"

Hmmm I don't think Astiga is sending that second timestamp, where is it coming from?

I don't want to paste the entire output on stdout for fear of sensitive info, but the main logs before that were:

2023/09/15 19:19:08 Starting supersonic...
2023/09/15 19:19:08 Using config dir: /home/gravelld/.var/app/io.github.dweymouth.supersonic/config/supersonic
2023/09/15 19:19:08 Using cache dir: /home/gravelld/.var/app/io.github.dweymouth.supersonic/cache/supersonic
2023/09/15 19:19:08 Creating session lock file
2023/09/15 19:19:08 failed to load theme file "": open /home/gravelld/.var/app/io.github.dweymouth.supersonic/config/supersonic/themes: no such file or directory
2023/09/15 19:19:08 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:08 Fyne error:  could not load SVG, falling back to static content:
2023/09/15 19:19:08   Cause: XML syntax error on line 3: invalid character entity & (no semicolon)
2023/09/15 19:19:08   At: /run/build/supersonic/vendor/fyne.io/fyne/v2/internal/svg/svg.go:27
2023/09/15 19:19:09 error fetching albums: parsing time "2023-09-15T18:19:09" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "Z07:00"
dweymouth commented 9 months ago

The Fyne SVG errors are just noise, the cause is definitely the timestring parsing. I'm surprised no other Subsonic server has had this issue as I just checked the official API example responses on subsonic.org and they do not have the timezone suffix - I guess every known working server includes it.

In any case it's definitely a Supersonic bug and I'll look into making the time string parsing more robust. I will send you an email to get an account added to the test server so I can confirm it's resolved before I push a fix. It's also been awhile since I've done a Supersonic release so I think I'll release 0.5.2 as soon as this issue is resolved.

dweymouth commented 9 months ago

I think this may be resolved by a5417cc8ecd807a9b8ecb0b55d986b4d93f9816f (and https://github.com/dweymouth/go-subsonic/commit/5bb56f464b3994467a48d3f75578617b28258c23) but I need the Astiga test account to verify (or an Astiga user to build Supersonic from source and test)

gravelld commented 9 months ago

I sent you that Drew... thanks.

dweymouth commented 9 months ago

Tested and resolved!

gravelld commented 9 months ago

Awesome!