feat: album covers with palettes and signed links (M2)
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 55s
ci / ts / ts (packages + web) (push) Successful in 1m0s
ci / docker / docker (образы собираются — их сервер собирает сам при обновлении) (push) Successful in 34s
ci / api / api (push) Successful in 26s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 34s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 55s
ci / ts / ts (packages + web) (push) Successful in 1m0s
ci / docker / docker (образы собираются — их сервер собирает сам при обновлении) (push) Successful in 34s
ci / api / api (push) Successful in 26s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 34s
- covers are taken from the embedded picture of the first track or a
cover/folder/front image in the album folder, converted by ffmpeg to
WebP 64/300/1200 and named by content hash, so albums sharing a cover
share the files; a full scan looks again for albums without one
- a 3-colour palette (dominant, second, most saturated accent) from a
deterministic k-means feeds placeholders, page tints and the wave
- /covers/{id} is public but HMAC-signed and immutable; nginx serves
the file via X-Accel-Redirect, X_ACCEL=false serves it from api
- the web client picks the size by display size and pixel density
- install.sh and update.sh generate STREAM_SIGNING_KEY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a685b1b7ca
commit
8b76aa3964
22 files changed
+988
-166
No files matched your search
@@ -24,6 +24,7 @@ const (
|
||||
|
||||
// Handler реализует search-часть gen.StrictServerInterface.
|
||||
type Handler struct {
|
||||
dto library.DTO
|
||||
meili *Meili
|
||||
catalog *library.Store
|
||||
indexer *Indexer
|
||||
@@ -31,8 +32,8 @@ type Handler struct {
|
||||
}
|
||||
|
||||
// NewHandler создаёт обработчик поиска.
|
||||
func NewHandler(meili *Meili, catalog *library.Store, indexer *Indexer, log *slog.Logger) *Handler {
|
||||
return &Handler{meili: meili, catalog: catalog, indexer: indexer, log: log}
|
||||
func NewHandler(meili *Meili, catalog *library.Store, indexer *Indexer, dto library.DTO, log *slog.Logger) *Handler {
|
||||
return &Handler{meili: meili, catalog: catalog, indexer: indexer, dto: dto, log: log}
|
||||
}
|
||||
|
||||
type limits struct{ artists, albums, tracks, offset int }
|
||||
@@ -132,7 +133,7 @@ func (h *Handler) hydrate(ctx context.Context, f found, corrected string) (gen.S
|
||||
return out, err
|
||||
}
|
||||
for _, a := range rows {
|
||||
out.Albums = append(out.Albums, library.AlbumSummaryDTO(a))
|
||||
out.Albums = append(out.Albums, h.dto.AlbumSummary(a))
|
||||
}
|
||||
}
|
||||
if len(f.tracks) > 0 {
|
||||
@@ -141,7 +142,7 @@ func (h *Handler) hydrate(ctx context.Context, f found, corrected string) (gen.S
|
||||
return out, err
|
||||
}
|
||||
for _, t := range rows {
|
||||
out.Tracks = append(out.Tracks, library.TrackDTO(t))
|
||||
out.Tracks = append(out.Tracks, h.dto.Track(t))
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
|
||||
Reference in new issue
Block a user