Skip to content

Plugin AlbumMerger

Derrik Diener edited this page Jul 16, 2026 · 1 revision

Album Merger Plugin

Enabled by Default: Yes (Disable via SUPERNOVA_PLUGIN_ALBUMMERGER=false)

Purpose

Metadata is rarely perfect. Often, an album rip might have tracks scattered across two separate logical "albums" in the database because of slight variations in the Release Year tag, or trailing whitespace in the Album tag.

The Album Merger runs in the background and consolidates duplicate albums into a single, canonical record.

Technical Internals

  1. Identification: The plugin queries the database for albums that have the exact same title (case-insensitive) belonging to the same artist.
  2. Canonical Selection: It selects the album with the earliest created date (or the one containing the most tracks) as the "canonical" album.
  3. Transaction Safety: It opens a strict SQLite transaction (db.BeginTx).
  4. Reassignment: It executes UPDATE tracks SET album_id = ? WHERE album_id = ? to move all tracks from the duplicate to the canonical album.
  5. Heart Migration: It migrates user favorites. If a user "hearted" the duplicate album, that heart is safely transferred to the canonical album (or ignored if they already hearted the canonical one) via UPDATE OR IGNORE hearts.
  6. Purge: The duplicate album is deleted. Because SQLite is configured with ON DELETE CASCADE, this automatically cleans up the album_artists junction table.

API Execution

You can manually trigger this plugin from the web UI Settings page or via: POST /api/plugins/albummerger/run

Clone this wiki locally