Skip to content

fix: recognize m4b audiobook files as audio - #10

Open
KalebJS wants to merge 1 commit into
masterxq:masterfrom
KalebJS:fix/m4b-audio
Open

KalebJS wants to merge 1 commit into
masterxq:masterfrom
KalebJS:fix/m4b-audio

Conversation

@KalebJS

@KalebJS KalebJS commented Dec 6, 2026 •

Copy link
Copy Markdown

Summary

  • Register m4b as an audio extension so audiobook files participate in music autodetection and ID3-based matching.
  • Add regression coverage for .m4b audio classification.

Why

m4b was missing from source/org/openfilebot/MediaTypes.properties:

audio/mp4: m4a aac

MediaTypes.AUDIO_FILES is built from that file, so .m4b files were neither audio nor video. Two user-visible failures followed:

  1. Autodetection did not classify .m4b as Music. In a folder named audiobooks, it fell through to series detection, treated audiobooks as a series name, and returned no TheTVDB results.
  2. The ID3 Tags datasource filtered candidates through AUDIO_FILES / VIDEO_FILES, so .m4b files were dropped before their tags were read.

.mp3 audiobooks worked because mp3 is registered.

MediaInfo already reads the Performer, Title, and Album fields from .m4b files, so no new metadata provider is required for local tag-based renaming.

Change

-audio/mp4: m4a aac
+audio/mp4: m4a m4b aac

Plus a MediaDetectionTest.m4bIsAudio regression test covering lowercase and uppercase extensions, the video filter, and AutoDetection.isMusic.

Testing

  • ant -Djavafx.classifier=mac-aarch64 -lib cache/ivy.jar test-compile
  • JUnitCore org.openfilebot.media.MediaDetectionTest → OK (7 tests)
  • Verified AutoDetection now groups these public-domain sample files as Music:
    • The Adventures of Sherlock Holmes.m4b
    • Pride and Prejudice.m4b
  • Verified ID3Lookup resolves:
    • Arthur Conan Doyle - The Adventures of Sherlock Holmes
    • Jane Austen - Pride and Prejudice
  • Built the macOS app bundle with ant -Djavafx.classifier=mac-aarch64 -lib cache/ivy.jar resolve mac; codesign --verify --deep --strict passes.

Fixes #9

Add m4b to the audio/mp4 extension list so autodetection and ID3-based music matching treat audiobooks as audio instead of falling back to movie/series detection.

Fixes masterxq#9
@KalebJS

KalebJS commented Dec 6, 2026

Copy link
Copy Markdown
Author

Tested on MacOS distro UI manually. Worked as expected.

@KalebJS
KalebJS marked this pull request as ready for review December 6, 2026 03:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support .m4b audiobook files in autodetection and ID3-based renaming

1 participant