fix icon loading
This commit is contained in:
parent
036ab856eb
commit
55a0a2dce1
3
app.py
3
app.py
@ -614,13 +614,14 @@ def human_readable_size(num_bytes):
|
||||
num /= 1024
|
||||
|
||||
@app.route('/icon/<string:size>.png')
|
||||
@app.route('/icons/<string:size>.png') # legacy path
|
||||
def serve_resized_icon(size):
|
||||
cached_image_bytes = get_cached_image(size)
|
||||
response = send_file(
|
||||
io.BytesIO(cached_image_bytes),
|
||||
mimetype='image/png'
|
||||
)
|
||||
response.headers['Cache-Control'] = 'public, max-age=86400'
|
||||
response.headers['Cache-Control'] = 'public, max-age=86400, immutable'
|
||||
return response
|
||||
|
||||
@app.route('/custom_logo/<string:filename>.png')
|
||||
|
||||
@ -197,7 +197,7 @@ class SimpleAudioPlayer {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title : file.replace(/\.[^/.]+$/, ''),
|
||||
artist: parts.pop(),
|
||||
artwork: [{ src:'/icons/logo-192x192.png', sizes:'192x192', type:'image/png' }]
|
||||
artwork: [{ src:'/icon/logo-192x192.png', sizes:'192x192', type:'image/png' }]
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
@ -266,4 +266,3 @@ class SimpleAudioPlayer {
|
||||
// Initialize instance
|
||||
const player = new SimpleAudioPlayer();
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user