Releases whose only audio file is `.mp4` are rejected with "No audio files were registered"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
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 の本文から書いたものです。
説明
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:76collects scan candidates withFileUtils.IsAudioFile.listenarr.infrastructure/Library/Scanning/AudiobookScanService.ExistingRegistration.cs:24filters existing registrations the same way.listenarr.infrastructure/Metadata/Jobs/MetadataRescanService.cs:100gates 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
- Accept
.mp4only 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 onIsAudioFilefirst (Probing.cs:44), so that gate would need to allow.mp4through to the probe. (Read.) - Add
.mp4toAudioExtensionsoutright. Smallest change, but it inherits the scanner consequence above: stray video files scan as audio. - Document the limitation and do nothing; users rename to
.m4a/.m4bas 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
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Listenarrs/Listenarr のほかの issue
-
Search button on a book does not retry without the author when the full query finds nothing対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Listenarrs/Listenarr#1173 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Listenarrs/Listenarr#1133 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Listenarrs/Listenarr#1128 ·
メンテナーはふだん 1 日以内に返信
-
Add New's search splits a title that contains "Series:", "Author:"… as if they were search keywordsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Listenarrs/Listenarr#1127 ·
メンテナーはふだん 1 日以内に返信
-
p3
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Listenarrs/Listenarr#971 ·
メンテナーはふだん 1 日以内に返信
Listenarrs/Listenarr の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
conductor-oss/csharp-sdk#183 ·
-
CreateNewLangProj throws when the default analysis writing system's ICU locale differs from its tagオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
unoplatform/uno#26555 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
CactuseSecurity/firewall-orchestrator#5739 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信