@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.ArtistChat do
|
||||
@moduledoc """
|
||||
Chat implementation for artists using OpenAI streaming with Wikipedia context.
|
||||
"""
|
||||
|
||||
@behaviour MusicLibrary.Chat
|
||||
|
||||
alias MusicLibrary.Artists.ArtistInfo
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Artists do
|
||||
@moduledoc """
|
||||
Artist metadata management from MusicBrainz, Discogs, Wikipedia, and Last.fm.
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
|
||||
alias MusicLibrary.Artists.ArtistInfo
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Artists.Batch do
|
||||
@moduledoc """
|
||||
Batch operations for artists: refresh MusicBrainz, Discogs, Wikipedia, and Last.fm data.
|
||||
"""
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
alias MusicLibrary.Artists
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Assets do
|
||||
@moduledoc """
|
||||
Binary asset storage and retrieval for covers and artist images.
|
||||
"""
|
||||
|
||||
alias MusicLibrary.Assets.{Asset, Cache}
|
||||
alias MusicLibrary.Repo
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
defmodule MusicLibrary.BackgroundRepo do
|
||||
@moduledoc false
|
||||
|
||||
use Ecto.Repo,
|
||||
otp_app: :music_library,
|
||||
adapter: Ecto.Adapters.SQLite3
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.BarcodeScan do
|
||||
@moduledoc """
|
||||
Barcode-to-MusicBrainz lookup workflow.
|
||||
"""
|
||||
|
||||
alias MusicLibrary.BarcodeScan.Result
|
||||
alias MusicLibrary.Records
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
defmodule MusicLibrary.BarcodeScan.Result do
|
||||
@moduledoc false
|
||||
|
||||
defstruct [:status, :number, :record_id, :release]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Batch do
|
||||
@moduledoc """
|
||||
Generic batch runner: streams records through a transaction with error accumulation.
|
||||
"""
|
||||
|
||||
alias MusicLibrary.Repo
|
||||
|
||||
require Logger
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Chat do
|
||||
@moduledoc """
|
||||
Behaviour for streaming AI chat with entity-specific context.
|
||||
"""
|
||||
|
||||
@callback stream_response(
|
||||
messages :: list(map()),
|
||||
context :: term(),
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Collection do
|
||||
@moduledoc """
|
||||
Queries for collected records (where `purchased_at` is set).
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
import MusicLibrary.Records, only: [order_alphabetically: 0]
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
defmodule MusicLibrary.Encrypted.Binary do
|
||||
@moduledoc false
|
||||
use Cloak.Ecto.Binary, vault: MusicLibrary.Vault
|
||||
end
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Notes do
|
||||
@moduledoc """
|
||||
Free-text notes attached to records and artists.
|
||||
"""
|
||||
|
||||
alias MusicLibrary.Notes.Note
|
||||
alias MusicLibrary.Repo
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.RecordChat do
|
||||
@moduledoc """
|
||||
Chat implementation for records using OpenAI streaming with web search.
|
||||
"""
|
||||
|
||||
@behaviour MusicLibrary.Chat
|
||||
|
||||
alias MusicLibrary.Records.Record
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.RecordSets do
|
||||
@moduledoc """
|
||||
User-curated record groupings with ordered items.
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
|
||||
alias MusicLibrary.RecordSets.{RecordSet, RecordSetItem}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Records.Batch do
|
||||
@moduledoc """
|
||||
Batch operations for records: refresh MusicBrainz data and generate embeddings.
|
||||
"""
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
alias MusicLibrary.Batch
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Records.TracklistPdf do
|
||||
@moduledoc """
|
||||
Generates 120mm x 120mm PDF tracklists from record and release data via Typst.
|
||||
"""
|
||||
|
||||
alias MusicBrainz.Release
|
||||
alias MusicLibraryWeb.Duration
|
||||
alias Typst.Format
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.ScrobbleActivity do
|
||||
@moduledoc """
|
||||
Scrobbling releases, media, and tracks to Last.fm.
|
||||
"""
|
||||
|
||||
alias LastFm.Scrobble
|
||||
alias MusicBrainz.Release
|
||||
alias MusicLibrary.Secrets
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Secrets do
|
||||
@moduledoc """
|
||||
Encrypted key-value storage for API keys and credentials.
|
||||
"""
|
||||
|
||||
alias MusicLibrary.Repo
|
||||
alias MusicLibrary.Secrets.Secret
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
defmodule MusicLibrary.TelemetryRepo do
|
||||
@moduledoc false
|
||||
|
||||
use Ecto.Repo,
|
||||
otp_app: :music_library,
|
||||
adapter: Ecto.Adapters.SQLite3
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
defmodule MusicLibrary.Vault do
|
||||
@moduledoc false
|
||||
use Cloak.Vault, otp_app: :music_library
|
||||
end
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
defmodule MusicLibrary.Wishlist do
|
||||
@moduledoc """
|
||||
Queries for wishlisted records (where `purchased_at` is nil).
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
|
||||
alias MusicLibrary.Records
|
||||
|
||||
Reference in New Issue
Block a user