Releases whose only audio file is `.mp4` are rejected with "No audio files were registered"
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 901
- Fork
- 70
- Merge medio
- 16h 27m
- PR unite (30g)
- 60
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Listenarrs/Listenarr
-
Search button on a book does not retry without the author when the full query finds nothingForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Listenarrs/Listenarr#1173 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Listenarrs/Listenarr#1133 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Listenarrs/Listenarr#1128 ·
I maintainer di solito rispondono entro 1 giorno
-
Add New's search splits a title that contains "Series:", "Author:"… as if they were search keywordsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Listenarrs/Listenarr#1127 ·
I maintainer di solito rispondono entro 1 giorno
-
p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Listenarrs/Listenarr#971 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Listenarrs/Listenarr
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
conductor-oss/csharp-sdk#183 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
CreateNewLangProj throws when the default analysis writing system's ICU locale differs from its tagAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
unoplatform/uno#26555 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
CactuseSecurity/firewall-orchestrator#5739 ·
I maintainer di solito rispondono entro 1 giorno