Skip to content

ASIN not read from audio file tags during library scan — files with embedded ASIN get no identifier #780

Description

@dny238

Summary

When ListenArr scans an existing audio file (m4b/mp3) that has an ASIN embedded in its tags, the ASIN is not extracted and stored. The "Rescan Metadata" button then fails immediately with "No ASIN or ISBN identifiers are available for metadata rescan", even though the information is sitting in the file.

Root cause

FfprobeTagMetadataMapper.Apply() in listenarr.infrastructure/Ffmpeg/Metadata/FfprobeTagMetadataMapper.cs only maps a small set of tags:

```csharp
metadata.Title = FirstNonEmpty(metadata.Title, GetTag(tags, "title", "TITLE"));
metadata.Artist = FirstNonEmpty(metadata.Artist, GetTag(tags, "artist", "ARTIST"));
metadata.Album = FirstNonEmpty(metadata.Album, GetTag(tags, "album", "ALBUM"));
metadata.AlbumArtist = ...
metadata.TrackNumber ...
metadata.DiscNumber ...
metadata.Year ...
```

ASIN is never read, even though ffprobe surfaces it under the key ASIN (from ----:com.apple.iTunes:ASIN, the standard location used by Audible-ripped files and most audiobook taggers).

Impact

Any file imported into the library that already carries an ASIN tag starts life with no identifiers. The user must then manually open Edit Metadata → Identifiers → Add ASIN and type/paste the value before Rescan Metadata will work. This defeats the purpose of the embedded tag.

Suggested fix

  1. Add Asin (and optionally Isbn) to AudioMetadata if not already present.
  2. In FfprobeTagMetadataMapper.Apply(), read it:
    ```csharp
    metadata.Asin = FirstNonEmpty(metadata.Asin, GetTag(tags, "ASIN", "asin"));
    ```
  3. In LibraryAddService (or wherever the AudioMetadataAudiobook mapping occurs), populate audiobook.Asin / audiobook.ExternalIdentifiers from metadata.Asin when non-empty.

Happy to submit a PR with these changes if the approach looks right to you.

Environment

  • ListenArr (latest main)
  • File type: m4b (AAC), ASIN stored at ----:com.apple.iTunes:ASIN
  • ffprobe confirms the tag is present in the file; ListenArr DB shows asin = null after scan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions