@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Assets.Cache do
|
||||
@moduledoc """
|
||||
ETS-based asset cache with TTL for serving frequently accessed images.
|
||||
"""
|
||||
|
||||
@spec new() :: :ets.table()
|
||||
def new do
|
||||
:ets.new(__MODULE__, [:named_table, :public, :compressed, read_concurrency: true])
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Assets.Image do
|
||||
@moduledoc """
|
||||
Image processing via Vix (libvips) for covers and artist images.
|
||||
"""
|
||||
|
||||
alias Vix.Vips.{Image, Operation}
|
||||
|
||||
fallback_path = Application.app_dir(:music_library, ["priv", "image-not-found.jpg"])
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Assets.Transform do
|
||||
@moduledoc """
|
||||
Represents an image transformation (hash + target width) for asset serving.
|
||||
"""
|
||||
|
||||
@derive JSON.Encoder
|
||||
defstruct [:hash, :width]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user