fixup! Rework my page and add info from listenbrainz
Docker Build and Push / build-and-push (push) Successful in 38s

This commit is contained in:
2026-02-04 15:02:22 +03:00
parent 8c1ffdcdfe
commit d98bd7d6d8
4 changed files with 7 additions and 1 deletions
+2
View File
@@ -15,6 +15,8 @@ WORKDIR /app
COPY . . COPY . .
COPY --from=sass /build/blueprints/ ./blueprints/ COPY --from=sass /build/blueprints/ ./blueprints/
RUN apt update && apt upgrade
RUN apt install libmagic1 -y
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
ENV FLASK_ENV=production ENV FLASK_ENV=production
+3 -1
View File
@@ -1,4 +1,5 @@
import os import os
import magic
from pathlib import Path from pathlib import Path
from htmlmin import minify from htmlmin import minify
from datetime import datetime, timedelta from datetime import datetime, timedelta
@@ -53,7 +54,8 @@ def static(filename: str):
@bp.route("/asset/mb/<mbid>") @bp.route("/asset/mb/<mbid>")
def mb_cover(mbid): def mb_cover(mbid):
r = make_response(get_image_front(mbid, "250")) r = make_response(image := get_image_front(mbid, "250"))
r.headers['Content-Type'] = magic.from_buffer(image[:2048], mime=True)
r.headers['Cache-Control'] = 'public, max-age=86400' r.headers['Cache-Control'] = 'public, max-age=86400'
r.headers['Expires'] = (datetime.now() + timedelta(days=1)) \ r.headers['Expires'] = (datetime.now() + timedelta(days=1)) \
.strftime('%a, %d %b %Y %H:%M:%S GMT') .strftime('%a, %d %b %Y %H:%M:%S GMT')
+1
View File
@@ -4,3 +4,4 @@ htmlmin2
requests requests
APScheduler APScheduler
musicbrainzngs musicbrainzngs
python-magic
+1
View File
@@ -7,6 +7,7 @@ pkgs.mkShell {
buildInputs = with pypkgs; [ buildInputs = with pypkgs; [
python python
python-magic
virtualenv virtualenv
pkgs.nodePackages.sass pkgs.nodePackages.sass
]; ];