Remove Duplicate Index Entries

From kJams Wiki
Jump to navigation Jump to search

Remove Duplicate Index Entries

This feature is available in the Qt (64-bit) edition of kJams under Advanced → Special → Remove Duplicate Index Entries….

What is an "index entry"?

Each song in your kJams Library has a unique song ID (index entry). That is separate from a playlist item (a reference to a song in a rotation list, custom playlist, singer list, etc.).

Sometimes the same physical media file is imported or added more than once, creating multiple library index entries (different song IDs) that all point at the same file on disk. This command finds those duplicates and consolidates them.

What the command does

  1. Computes a File Hash for each library song that has a resolvable local media path (ZIP, then video, then audio — same priority kJams uses elsewhere).
  2. Groups songs with the same hash (same resolved file path).
  3. Within each group, keeps the entry with the lowest song ID as the canonical copy.
  4. Updates playlists: any playlist reference to a removed song ID is changed to point at the canonical song ID. If the playlist already contains the canonical entry, the duplicate playlist reference is removed instead.
  5. Deletes the extra library index entries (and their library playlist rows). Your media file on disk is not deleted by this operation (only cache/temp files associated with the removed entries may be cleared, same as normal Remove from Library).

What is skipped

Songs with no resolvable local file path are skipped — for example some streaming entries, some music-store entries without a local file, or songs whose files are missing. They are not hashed and are never merged or deleted by this command.

What this does not detect

  • The same audio on disk via different paths (aliases, copies in different folders, hard links with different path strings).
  • Duplicates that share metadata (name/artist/album) but point at different files.
  • Duplicates defined only by playlist references without duplicate library entries.

File Hash column

After running, you can show the File Hash sort column in the Library to inspect the computed values. Songs with the same hash are duplicates by file path.

Before you run

  • Back up your library (Save Database) if you are unsure. This operation removes library entries and cannot be undone from within kJams.
  • Quit any operation that is sorting the library; the command waits for sorting to finish.
  • Read the confirmation dialogs carefully; the second dialog shows counts of groups and entries to be removed.

Technical notes

  • Path resolution uses Resolve As Far As You Can so aliases and broken path chains are normalized when possible.
  • Volume names are normalized for consistent hashing on macOS.
  • The feature is compiled only into the Qt build (`#if _QT_`); 32-bit editions do not include this menu item.