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

Application ask for same art multiple time #122

Open
fufroma opened this issue Jun 2, 2024 · 7 comments
Open

Application ask for same art multiple time #122

fufroma opened this issue Jun 2, 2024 · 7 comments

Comments

@fufroma
Copy link

fufroma commented Jun 2, 2024

When I open an album on Power Ampache 1.00.58-free (58) - DB: 82, it look like it download the art for each song of the album.

But the image is the same for all the song, so it download the same image with the same URL a lot of time :

REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 511106 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 511105 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 405654 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 357870 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 346286 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 344365 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 508319 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 508319 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 508319 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 508319 "-" "okhttp/5.0.0-alpha.9"
REDACTED_IP - - [02/Jun/2024:13:30:57 +0200] "GET /image.php?object_id=10933&object_type=album&name=art.jpg HTTP/1.1" 200 508319 "-" "okhttp/5.0.0-alpha.9"

On top of having the server with unnecessary request (not a big deal), because the link for art are to full-size art, on this example we download 5.5M instead of 0.5M, it may be relevant for some country for the cell phone data.

Ampache know how to handle Etag correctly since Ampache 5.5.5, it may be useful here.

@fufroma
Copy link
Author

fufroma commented Jun 2, 2024

If I play "swap left / right / left / right" on a list on the main page, it download the same image in a loop.

I think local cache is missing or faulty

@icefields
Copy link
Owner

thanks for the report.
I use a library called Coil to get images, and I'm using a pretty aggressive cache, this seems like a bug. The library should not retrieve the image multiple times, and the cache should kick in immediately. I will double check my library initialization, in case I will file a bug to the developers of Coil.

@icefields
Copy link
Owner

Is your phone low in space by any chance?
I just checked Coil logger and it looks like it's using the cache without making the network request:

2024-06-02 16:46:37.929  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1270&object_type=album
2024-06-02 16:46:37.930  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=317&object_type=artist
2024-06-02 16:46:37.948  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1081&object_type=album
2024-06-02 16:46:38.068  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1270&object_type=album
2024-06-02 16:46:38.069  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1191&object_type=album
2024-06-02 16:46:38.071  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1330&object_type=album
2024-06-02 16:46:43.264  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1270&object_type=album
2024-06-02 16:46:43.269  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=317&object_type=artist
2024-06-02 16:46:43.320  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1081&object_type=album
2024-06-02 16:46:43.403  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1270&object_type=album
2024-06-02 16:46:43.404  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1191&object_type=album
2024-06-02 16:46:43.418  8104-8104  RealImageLoader         ...ix.powerampache2.fdroid.debug  I  💾 Successful (DISK) - http:https://192.168.66.121/image.php?object_id=1330&object_type=album

I will do some more investigation today.

@icefields
Copy link
Owner

I increased the memory size of the image-cache in version 1.00-59 .
https://github.com/icefields/Power-Ampache-2/releases/tag/v1.00-59
The Dogmazic version follows the name pattern as the previous releases ( PowerAmpache2-v1.00-59-PlayFree-release.apk )

@fufroma
Copy link
Author

fufroma commented Jun 4, 2024

It got worst on some point, better on other:

  • better : no more request when we swipe left/right, it stay in cache
  • worst : there is now a pretty big latency between the moment I clic on an album and the moment it start asking the server for the art. User experience is degraded (may be related to Album Art Caching #126 )
  • no change : they are still multiple request for the same art

@fufroma
Copy link
Author

fufroma commented Jun 17, 2024

PowerAmpache2-1.00-60-free

  • no more the big latency
  • no more request one left / right swipe, look like the cache work fine
  • still many identical request for the art when we open an album

@fufroma
Copy link
Author

fufroma commented Jul 9, 2024

1.00-61-free still have only one issue : many identical request for the art when we open an album

REDACTED - - [09/Jul/2024:08:06:16 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:16 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:16 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224623 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224623 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224623 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224623 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224623 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"
REDACTED - - [09/Jul/2024:08:06:17 +0200] "GET /image.php?object_id=9515&object_type=album&name=art.png HTTP/1.1" 200 224299 "-" "okhttp/5.0.0-alpha.9"

everything else look fine :)

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

2 participants