Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No covers displayed #136

Open
pled opened this issue Jul 3, 2024 · 25 comments
Open

No covers displayed #136

pled opened this issue Jul 3, 2024 · 25 comments

Comments

@pled
Copy link

pled commented Jul 3, 2024

Hi,

Using Nextcloud Music 2.0.0 and PowerAmpache2-1.00-61-fdroid.

When using a large music collection (not sure if this is linked) from Nextcloud Music app (13820 tracks 😎 ), I got no covers in Power Ampache 2.
Covers were there initially, but disappear after a disconnection/re-connection.

power-amapache

Is there a way to reset of force to read music collection again ?

Thank you for that beautiful application.

@pled
Copy link
Author

pled commented Jul 4, 2024

Here are the logs I can collect on Netcloud server when connecting Power Ampache 2 :

{"reqId":"6sTdNEFOkm7QZCpXTMdF","level":0,"time":"2024-07-04T08:01:57+00:00","remoteAddr":"192.168.1.20","user":"pascal","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"dirty table reads: SELECT `name` FROM `*PREFIX*authtoken` WHERE (`uid` = :dcValue1) AND (`last_activity` >= :dcValue2)","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"Exception","Message":"dirty table reads: SELECT `name` FROM `*PREFIX*authtoken` WHERE (`uid` = :dcValue1) AND (`last_activity` >= :dcValue2)","Code":0,"Trace":[{"file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":348,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":293,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/notifications/lib/Service/ClientService.php","line":54,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/notifications/lib/Controller/EndpointController.php","line":109,"function":"hasTalkDesktop","class":"OCA\\Notifications\\Service\\ClientService","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"listNotifications","class":"OCA\\Notifications\\Controller\\EndpointController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/ocs/v1.php","line":66,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/ocs/v2.php","line":23,"args":["/config/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/private/DB/Connection.php","Line":316,"message":"dirty table reads: SELECT `name` FROM `*PREFIX*authtoken` WHERE (`uid` = :dcValue1) AND (`last_activity` >= :dcValue2)","tables":["oc_authtoken"],"reads":["oc_authtoken"],"exception":{},"CustomMessage":"dirty table reads: SELECT `name` FROM `*PREFIX*authtoken` WHERE (`uid` = :dcValue1) AND (`last_activity` >= :dcValue2)"}}
{"reqId":"1pZgJ34txO23TnICOvqL","level":0,"time":"2024-07-04T08:02:33+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=handshake&auth=6cdbcd7734572fc4423884d84ced5660781789e923e32c043fda15e78ef52150&user=pascal&timestamp=1720080153","message":"Ampache action 'handshake' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"WlXD1Qk7Jetg72S5FQJW","level":0,"time":"2024-07-04T08:02:33+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=user&auth=5577f70e9eed2ba5d14a45dc5aac4328&username=pascal","message":"Ampache action 'user' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"P3J7DjqvOYM6KHsouUY8","level":0,"time":"2024-07-04T08:02:33+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=ping&auth=5577f70e9eed2ba5d14a45dc5aac4328","message":"Ampache action 'ping' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"7WsGG6d5r9R8EZwd4pbG","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=genres&auth=5577f70e9eed2ba5d14a45dc5aac4328&exact=0&offset=0&limit=0","message":"Ampache action 'genres' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"zFJCMhd0460T2svhKzee","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=highest&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"OHFqao3CygrIHxhlblBK","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=recent&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"txFZLZTVNY0rYm1RVO6E","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=flagged&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"bWkY8tEUlDgQENrJa38X","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=frequent&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"ALsKnBVMUrsp7GmA966L","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=playlists&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=0&filter=&exact=0&offset=0&hide_search=0&show_dupes=1","message":"Ampache action 'playlists' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"3rrM8XW5e4LCJOSxfg1x","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=random&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"JW0mss0o9UHAm0WO0FY2","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=stats&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=40&username=pascal&type=album&filter=newest&offset=0","message":"Ampache action 'stats' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}
{"reqId":"3F5NES0PglNo3O8UO8Cr","level":0,"time":"2024-07-04T08:02:34+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/ampache/server/json.server.php?action=playlists&auth=5577f70e9eed2ba5d14a45dc5aac4328&limit=0&filter=&exact=0&offset=1&hide_search=0&show_dupes=1","message":"Ampache action 'playlists' requested","userAgent":"PowerAmpache2-1.00-61-fdroid","version":"29.0.3.4","data":{"app":"music"}}

Does that mean server does not send covers information ?

@icefields
Copy link
Owner

Thanks for the report.
I'm not an expert on Nextcloud Music, but you can try setting the logging level on Nextcloud temporarily to debug. Edit the file config/config.php and add the key-value line 'loglevel' => 0,. Then use the app and check the file nextcloud.log.
If you server is providing the cover urls in its responses maybe it's slow and the connection is timing out, in that case I can try to increase the timeout for getting the cover images

@pled
Copy link
Author

pled commented Jul 5, 2024

Thanks, I will check on Nextcloud server side then. Need to learn more about how and when cover art is transfered to Ampache client.

@icefields
Copy link
Owner

perfect. If you see that the image urls are being passed to the client, try to open some of those urls from a browser, if everything works fine and the images load without any issue, I will increase the timeout for image-loading in PA2 (for now, without any other data, I'm assuming that would be the issue).

@pled
Copy link
Author

pled commented Jul 7, 2024

Quick update : I got no answer from Nextcloud Music dev (owncloud/music#1156) so far. Let's wait...

In the mean time, I have installed a subsonic client (substreamer), and I do get cover art : in the log, I can see explicit request for cover art like this (which I don't see with Power Ampache) :
{"reqId":"AyKmwNQqoj01xaosADIa","level":0,"time":"2024-07-07T15:01:57+00:00","remoteAddr":"192.168.1.126","user":"--","app":"music","method":"GET","url":"/apps/music/subsonic/rest/getCoverArt.view?u=pascal%20&p=xxxxxxxxxx&v=1.13.0&c=substreamer&f=json&size=500&id=album-5463","message":"Subsonic request getCoverArt.view","userAgent":"Dalvik/2.1.0 (Linux; U; Android 14; Pixel 6a Build/AP2A.240705.004)","version":"29.0.3.4","data":{"app":"music"}}

So at least, my server is able to provide cover art ! 😉 And I don't find any recent ampache client to test it.

@pled
Copy link
Author

pled commented Jul 8, 2024

Hi,
Got answer from Nextcloud Music dev (owncloud/music#1156), did some testing, and all seems to look good on server side.
I had to modify the nginx configuration file because URLs example given for testing brings me to 404 error, you may look at that issue I had when setting up my NCM server : ampache/ampache#3973.
This was about changing from "location ~ ^/apps/music/ampache/server/.*\.php$" to "location ~ ^/apps/music/ampache/.*\.php$" because images were using /apps/music/ampache/images.php.

Can you look at Paulijar's answer : from what he said, there are 2 methods, but none of them can be seen in logs. But using the test URL, all is fine now on my server.

But still no cover art in the app...

@paulijar
Copy link

Could the remaining problem now be a caching issue on the client end? As those image URLs originally returned 404 on @pled 's config, maybe PA2 now remembers that and doesn't try to refetch the images although the nginx configuration is now fixed?

@icefields
Copy link
Owner

thanks for all the info, I will look into it during the weekend.
Unless there's a bug, PA2 tries to refetch if there was an error previously.
I don't make any special call to get an image, the URL is included in the object that I get in response from the server, I just load whatever url I get.
As I was saying previously, one easy thing I could do is to try increasing the timeout to get those images and see if that helps

@pled
Copy link
Author

pled commented Jul 11, 2024

I have clear cache, reinstalled app, etc... still the same, no cover art.
I would be curious to see what type of URL you get from the object to load cover art ? as I had issue configuring nginx to retrieve routes from ampache client : nextcloud/documentation#11951. That could be linked may be.

@icefields
Copy link
Owner

when I request the albums I get a response like this one:

"album": [
     {
         "id": "7379",
         "name": "\u2026And Justice for All",
         "artist": {
             "id": "1496",
             "name": "Metallica"
         },
         "time": 2153,
         "year": 1988,
         "tracks": [],
         "songcount": 5,
         "diskcount": 1,
         "type": "album",
         "genre": [],
         "art": "http:\/\/192.168.43.100\/ampache\/public\/image.php?object_id=7379&object_type=album",
         "flag": 0,
         "preciserating": null,
         "rating": null,
         "averagerating": null,
         "mbid": "d83aa9b6-ba30-4bdf-b3b5-8cd01359f7da"
     },
     {
         "id": "7761",
         "name": "\u2026And Then There Were Three\u2026",
         "artist": {
             "id": "1589",
             "name": "Genesis"
         },
         "time": 3198,
         "year": 1994,
         "tracks": [],
         "songcount": 11,
         "diskcount": 1,
         "type": "album",
         "genre": [],
         "art": "http:\/\/192.168.43.100\/ampache\/public\/image.php?object_id=7761&object_type=album",
         "flag": 0,
         "preciserating": null,
         "rating": null,
         "averagerating": null,
         "mbid": "7b8ea2fb-6edf-4c7f-aa90-6602e6814ab1"
     },

Look for the field art, that would be the url of the image I use in PA2 .

@pled
Copy link
Author

pled commented Jul 11, 2024

It looks very similar to the URL (except the token) I tested from the advice from Nextcloud Music dev (owncloud/music#1156) :

https://xxx.yy/apps/music/ampache/image.php?object_type=album&object_id=5460&token=2-056cc720706eda4d3a6f4cde3a507ec5

And such URL works on my server.
If you want me to test some apk with longer timeout, let me know.

@paulijar
Copy link

@pled: One thing you could do would be to set up another Nextcloud account which would have just a few albums. Then, we would learn if the high number of albums on your account is relevant for this issue or not.

@icefields
Copy link
Owner

that is a good point @paulijar , I feel like the amount of images to download might be a factor here. @pled I'm finishing a new release this weekend, when done I will send you a debug apk with a very high image-loader timeout, so we'll check that too.

@pled
Copy link
Author

pled commented Jul 14, 2024

I already simplified my configuration : moved from external storage to internal, and limited music collection to 4 albums only (2 with cover art embedded in audio files, 2 with covert art in external cover.jpg file.
I will test with another Nextcloud account tomorrow, I am a bit busy that WE.

@pled
Copy link
Author

pled commented Jul 15, 2024

So I created a new user, added only one album (cover art embedded), and connect the Power Ampache client using API password provided for that user. Still the same, no album art displayed.
Tested "art" URL in browser, it does display the cover art as expected :
"https://<myserverURL>/apps/music/ampache/image.php?object_type=album&object_id=5469&token=3-a11d500d50ad9a8d198b1ebd76c68634"

@icefields
Copy link
Owner

thanks for performing all those tests. Would it be possible for you to create a test account for me on your server? So I can check the debug logs directly from my machine.

@pled
Copy link
Author

pled commented Jul 15, 2024

Sure, how can I send you credentials ? is there a PM system on Github ? (never used)

@icefields
Copy link
Owner

no worries @pled , some of the contacts methods are in the readme:
email: arctic.icefields @ slmails . com
telegram: https://t.me/PowerAmpache2
mastodon: https://floss.social/@powerampache

@CypLef
Copy link

CypLef commented Jul 16, 2024

This was about changing from "location ~ ^/apps/music/ampache/server/.*\.php$" to "location ~ ^/apps/music/ampache/.*\.php$" because images were using `/apps/music/ampache/

I have the same problem (no cover art diplayed). And I also got problem simply to connect to my library with PA2. For this, the solution was about the URL: the right URL to use was https://.index.php/apps/music/ampache .
Maybe it's the same kind of problem for displaying cover art?

@icefields
Copy link
Owner

hey @CypLef thanks for checking this issue. @pled have you tried that solution?

@pled
Copy link
Author

pled commented Jul 17, 2024

No, I did not try it, because I don't understand what I should exactly test as a specific location. I would be happy to try if I get more details about that setting.

But mainly because I have now change these settings following recommendations from Nextcloud documentation issue I raised (nextcloud/documentation#11951). So from now, I have no specific location for Ampache client anymore, but added the following general rule as documented here.
I added that generic rewrite rule :

 # Required for legacy support
 rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

So far all is fine with that setting, and I don't see any request refused by nginx server.

@icefields
Copy link
Owner

icefields commented Jul 23, 2024

hey @CypLef , can you expand a bit on this please?

@pled , I tried your credentials, but I don't have any issue with albums covers not loading, look:

image image

----

Artists images, on the other hand, are not showing. But there is no bug here, look at the response I get from "artists", they all have "art":"", and "has_art":false. That means there is no cover to display passed by the server.

{"artist":[
{"id":"4628","name":"Bernard Lavilliers","prefix":null,"basename":"Bernard Lavilliers","albums":null,"albumcount":1,"songs":null,"songcount":8,"time":2376,
"art":"",
"has_art":false,
"rating":0,"preciserating":0,"flag":false,"genre":[{"id":"145","name":"Pop","count":1}]},
{"id":"4631","name":"Kenna","prefix":null,"basename":"Kenna","albums":null,"albumcount":1,"songs":null,"songcount":13,"time":3421,
"art":"",
"has_art":false,
"rating":0,"preciserating":0,"flag":false,"genre":[{"id":"146","name":"(Unknown genre)","count":1}]},
{"id":"4630","name":"Mattafix","prefix":null,"basename":"Mattafix","albums":null,"albumcount":1,"songs":null,"songcount":14,"time":3690,
"art":"",
"has_art":false,
"rating":0,"preciserating":0,"flag":false,"genre":[{"id":"147","name":"Hip-Hop","count":1}]}]}

@pled
Copy link
Author

pled commented Jul 26, 2024

Hi @icefields ,

Thanks you for testing. I think issue is coming from my pihole server used as a DHCP server on my LAN, and also as a DNS ad filtering server befire forwarding to real DNS. When I am outside my LAN, I can see cover art (I should have tested this more accirately before, and this why I got covert art once, see remember my first comment here).

So it appears to be related to some external requests being blocked for privacy concern (PiHole workd with Ad lists).
Looking at Exodus, Power Ampache is using at least ACRA :

exodus

I am still investigating why I don't get cover, I may have observed some request to "Google CrashLytics" in my PiHole logs, put it in white list for test, but still no cover art.
There might be some other URL(s) blocked ? Do you have an idea about other external requests Power Ampache would perform to some site that could be identified as privacy concern or tracking related ?

I am still investigating why I don't get covers in my LAN environment. Will update here my findings.

PS : regarding Artist Art, yes, this is expected, I only manage cover art i, my music collection.

@icefields
Copy link
Owner

hi, all the requests Power Ampache 2 makes are directed to the amapache server you specified at login. I absolutely do not make any third party or tracking requests. All the libraries used are open source and do not make any network request on their own. Even the "(1) pisteur" you see in your report, that's for email crash report, and you can just refuse to send the email if a crash happens, if you want.
I do not use Crashlytics in the app, because it's proprieary software, and I also personally use custom DNSs and various layers of track and ad-blocking, but I haven't had any issue so far.
Anyway, if something comes to mind I will let you know.

@pled
Copy link
Author

pled commented Jul 27, 2024

Hi,
Good to hear this ! 👍 Congrats for using only open source software, and apologies for doubting on this ! ;-)

I have another specific setting that explains the issue : Internally, the default 443 external port for https connection is routed to another one, let say 553. So when I am at home, the server address I use is something like nextcloud.myserver.fr:553/apps/music/ampache. Then it goes to proxy, which maps 553 to 443, then to nextcloud.

Because of this, nextcloud art URL sent to Ampache client is on 443 default port... which is not reachable from proxy.
I have changed my config to use 443 port all long, and all is working fine.

You can close this issue, this is not related to Power Ampache 2, sorry for the disturbing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants