Releases whose only audio file is `.mp4` are rejected with "No audio files were registered"

オープン
#995 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
backend, databases

調査の方向性

Start with listenarr.domain/Common/FileUtils.cs:44-56 and the scanner call sites named in the issue, then read listenarr.infrastructure/Ffmpeg/Installation/FfmpegService.Probing.cs. Compare the import and scanning paths before choosing among the listed options; the issue leaves that behavior as a product decision. Done means .mp4 audio imports without causing video files to be scanned as audiobooks, or the limitation is explicitly retained.

索引モデルが issue の本文から書いたものです。

説明

p3

Summary

A release whose payload is a single .mp4 file registers zero audio files and lands in Import Blocked with "No audio files were registered after file import" on the first attempt. The cause is that .mp4 is not in the recognized audio extension set, even though .m4a and .m4b (which are also MP4 containers) are and import cleanly.

This came up in the discussion on #890; I am splitting it out as its own issue so a fix has a home and the case is trackable. There is a real design tradeoff here, which is why I am filing it as an issue rather than opening a PR straight away.

Where it comes from

AudioExtensions in listenarr.domain/Common/FileUtils.cs:44-48 is a fixed 14-entry set:

.aac .aif .aiff .alac .ape .flac .m4a .m4b .mp3 .ogg .opus .wav .wma .wv

.mp4 is not present. IsAudioFile (same file, line 55) is a pure extension check against that set, so a .mp4 file is treated as a non-audio file everywhere IsAudioFile is consulted. (Read: FileUtils.cs:44-56.)

Because .m4a and .m4b are themselves MP4 containers and both import fine, the thing that rejects the file is the extension string, not the container format. (Measured on stock ghcr.io/listenarrs/listenarr:canary at a630572e: a release carrying only a .mp4 went straight to Import Blocked with "No audio files were registered after file import"; the same content renamed to .m4a imported.)

Why this is not just "add .mp4 to the set"

The same FileUtils.AudioExtensions / IsAudioFile set also feeds the library scanner, not only the download import path. For example:

  • listenarr.infrastructure/Library/Scanning/ScanFileDiscovery.Enumeration.cs:76 collects scan candidates with FileUtils.IsAudioFile.
  • listenarr.infrastructure/Library/Scanning/AudiobookScanService.ExistingRegistration.cs:24 filters existing registrations the same way.
  • listenarr.infrastructure/Metadata/Jobs/MetadataRescanService.cs:100 gates rescans on it (also :201).

(Read: the three call sites above.)

So adding a bare .mp4 to the set outright would also mean any stray video .mp4 sitting under a library folder gets discovered and scanned as an audiobook. That is the reason a blind addition is risky: .mp4 genuinely is ambiguous in a way .m4a/.m4b are not.

Worth noting: Readarr (the closest lineage for this) makes exactly this distinction. Its audio extension map recognizes .m4a, .m4b, .m4p, and .mp4a but deliberately omits bare .mp4 (src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs, the _audioExtensions dictionary). (Read.)

Options

  1. Accept .mp4 only when the file actually carries an audio stream, probed by content. The tree already bundles ffprobe and calls it with -show_streams (listenarr.infrastructure/Ffmpeg/Installation/FfmpegService.Probing.cs), so the audio/video question can be answered from the file rather than from its name. This keeps the extension-only fast path honest for the scanner while letting genuine audio-in-mp4 releases import. It is more code, and the current probe helper itself gates on IsAudioFile first (Probing.cs:44), so that gate would need to allow .mp4 through to the probe. (Read.)
  2. Add .mp4 to AudioExtensions outright. Smallest change, but it inherits the scanner consequence above: stray video files scan as audio.
  3. Document the limitation and do nothing; users rename to .m4a/.m4b as a workaround.

If it were my call I would build option 1, since it is the only one that fixes import without teaching the scanner to swallow video, and it matches the Readarr precedent of keeping the ambiguous extension out of a name-only set. But the scanner tradeoff is a product decision, so I would rather ask than assume.

I have a tentative branch for option 1 in progress (fix/mp4-audio-import) and am happy to open it as a PR if that is the direction you want. It is not finished, so I am not claiming it is ready.

The retry-and-exception-logging behavior around this same "no audio files" failure is a separate matter already covered in #930 and #933; I am not re-reporting it here.

Environment

Reproduced on stock ghcr.io/listenarrs/listenarr:canary at commit a630572e.


Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting.

主要言語
C#
スター
901
フォーク
70
平均マージ
16時間 27分
マージ済み PR(30日)
60

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Listenarrs/Listenarr のほかの issue

Listenarrs/Listenarr の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。