mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Enhancement]: Support more m4b tags #491
Open
opened 2026-04-24 23:11:05 +02:00 by adam
·
10 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sqlite
playl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4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#491
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DarkShortie on GitHub (Jun 28, 2022).
Describe the feature/enhancement
I prefer storing all metadata in the file itself instead of using "companion files" or folder / filenames and have a whole audiobook in one file.
Therefore I'm using the m4b format and I have activated the setting "Scanner prefer audio metadata".
Then I tried to to set the metadata according to the mp4 metadata fields and what is described here https://www.audiobookshelf.org/docs#book-audio-metadata
I've also set some additional tags which are used by the aaxc format from Audible (which is also just a mp4 container) and it would be great if those custom tags could also be supported by audiobookshelf.
Not all tags are working, is there a list which mp4 tags are mapped to which audiobookshelf data field? For the mp4 tags it would be could to know the atom names instead of what is displayed in different tools because the friendly name also differs between the different tools.
This is are my results and enhancement requests so far:
@advplyr commented on GitHub (Oct 1, 2022):
We are going to be switching our meta tag reader & writer from ffmpeg to tone. If you can test your m4b audio files are read correctly using tone that would be helpful.
https://github.com/sandreas/tone
If you install the CLI then you can just
tone dump ./path/to/audiobook.m4band see if it gets everything you want.@sandreas commented on GitHub (Mar 18, 2023):
@DarkShortie @advplyr
For
seriesandvolume numberusually the tagsmovementNameandmovementIndexare used.Unfortunately, these are not yet supported by
ffprobeandffmpeg, but today I submitted an enhancement issue to address this (https://trac.ffmpeg.org/ticket/10269#ticket). I don't have too high hopes, because theffmpegteam has much to do and issues I submitted in the past did not gain too much interest, but the source code is pretty straight forward and linked in the issue, maybe a happy ABS user with good C coding skills can submit a PR.Let's hope for the best.
@sandreas commented on GitHub (Apr 11, 2023):
@DarkShortie @advplyr
I found out, that tagging
m4bfiles with----:com.pilabor.tone:SERIES=Harry Potterwill make ABS detect the series correctly. This solved A LOT of my problems organizing my audiobook collection. I plan to integrate----:com.pilabor.tone:SERIES = <Movement>into theM4bFillupTaggerfortone v0.1.6to ensure, that ABS detects the series correctly. Currently you have to use a custom javascript tagger to write this field, it does unfortunately not work via--meta-additional-fieldThe only remaining problem (that I also solved, but it was kind of an effort) is that ABS still requires a directory per audiobook, while I would be nice have a setting: 1 audiobook per file for the following extensions:
m4bWhatever, at least I no longer need the
Movementtag :-)@advplyr commented on GitHub (Apr 11, 2023):
@sandreas What about
SERIES-PART?Also, you don't need to have each audiobook in a separate folder if the audio files are in the root. I'm guessing your folder structure has m4b files in sub folders?
@sandreas commented on GitHub (Apr 11, 2023):
@advplyr
SERIES-PARTis not as important to me, because it is only additional information and not used for grouping audiobooks together. However I already use a custom tag----:com.pilabor.tone:PARTas custom tag, becauseMovementis an integer, whilePARTcan also contain strings like2.1orVI(only to name a few) and the part number is part of thesort_titleand thelongdescriptionin my audiobooks.My folder structure is this (i reorganized because of ABS...):
/series/%genre/%author/%series-name/%part/%part - %title/%part - %title.m4b- for series with part/series/%genre/%author/%series-name/%title/%title.m4b- for series without part (especially kids audiobooks are organized that way)/individuals/%genre/%author/%title/%title.m4b- for individual titles (no series)For the series I would love to remove the last directory to group series together:
/series/Fantasy/J.K. Rowling/Harry Potter/1/1 - Harry Potter and the Philosophers Stone.m4bBut this is no necessity any more, since my whole workflow supports subfolders right now and I don't see them very often :-)
I use this structure, because every now and then an audio book that was an individual changes to a series and in this case i have to move the book and retag it via folder structure (often the Offical series name is not my preferred one):
@advplyr commented on GitHub (Apr 13, 2023):
So how is Abs populating your series sequence if you are only using the
SERIEStag?@sandreas commented on GitHub (Apr 14, 2023):
It doesn't. But as long as it gets the series right, it is much easier to navigate, since I can collapse the series in the frontend.
However, I would love to see the following fallback option:
SERIES-PARTis defined, prefer it and sortPARTis defined, take it and sortsort_nameorsort_albumis defined sort by thissort_name/sort_album!=title/albumand ends withtitle/album, look for a Part-Number at the end of the prefix of the sort titlename=Harry Potter and the philosophers stone,sort_name=Harry Potter 1 - Harry Potter and the philosophers stone@advplyr
Here, feel free to use and adjust to your needs:
@sandreas commented on GitHub (Apr 22, 2023):
@advplyr any feedback?
@advplyr commented on GitHub (May 2, 2023):
Have you checked if
ffprobeis able to detect thePARTtag? I can add that to the list of tags we look for for seriespart https://github.com/advplyr/audiobookshelf/blob/master/server/utils/prober.js#L186I haven't seen the tags
sort_nameandsort_albumused before. We're currently not using any separate sort fields but there is a request open for title sort #1074. I haven't added it yet since the UI is getting overwhelmed with so many fields I wanted to see ifit can be simplified.
I do have
ffprobelooking fortitle-sort,album-sortandartist-sorthttps://github.com/advplyr/audiobookshelf/blob/master/server/utils/prober.js#L166 but they aren't used yet.The actual sorting of the series books doesn't happen in the way you are thinking. When we populate the books the in database we are storing each book with
BookMetadataobject https://github.com/advplyr/audiobookshelf/blob/master/server/objects/metadata/BookMetadata.jsThe sorting of the series happens from the API. Here we sort the series books by series sequence first and fallback to using the book title if the sequence is not defined.
Just to be complete in my response we are also sorting series here except here I didn't implement the title fallback. This is used in the API request that requests all series
@sandreas commented on GitHub (May 3, 2023):
@advplyr Thank you for this detailed answer and sorry if I was a bit pushy on this :-) This
seriesandpartproblem inffprobe/ffmpegis really annoying to me, it's not your fault ;)Yes, it does support
PARTinm4bfiles (see Harry Potter 1 example below).ffprobedoes supportsort_nameandsort_album, as well assort_composer,sort_artistandsort_albumartist. Even iTunes does support most of these in an extra tab - so you can sort your audio books correctly if the titles are not in alphabetical order and thePARTtag is not set (e.g. audiobook series for children often don't have part numbers at all but only theseries-name)Yeah
title-sort,album-sortandartist-sortare synonyms for the same tags often used inmp3... Either it is a dash-suffix*-sort, underscore suffix*_sortor prefixsort-*,sort_, these should be all the same information.ffmpegis not totally strict about this. Most commonly used issort_album,sort-albumandalbum-sortand the same for*title*.I know... I was just curious, if it would be possible to guess the
PARTof the series using existing fields likesort_albumand store it as sequence number while indexing. Sinceffprobeis not supportingMovementNameandMovementIndex(and probably won't in the near future), I thought it would be a nice fallback to extract the sequence out of thesort_albumif possible.PARTtag would be enough for the moment :-) See PR #1750Example: Harry Potter 1 (german)