Parse book language from NFO metadata source #3170
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a relatively simple change for parsing metadata from an NFO file to include a "language:" (or "lang:") field.
I tried to find the right files to edit by looking at PR #2305.
My motivation is that it seems hit-or-miss to embed the language in some audio files (and/or to have these tags picked up by audiobookshelf). For example, using
tone
to embed the language into a MP3 file creates additional metadata fields "language=eng" and "LANG=eng", while doing the same for an AAC/M4A file creates "lang=eng". Then, when imported into audiobookshelf, the language field is properly set for the MP3 file, while the language field for the AAC file is empty.This could be somewhat related to Issue #2924. It wouldn't help with the embedding part, but could help anyone who uses NFO files as a way of keeping the metadata in a sidecar file. It also wouldn't matter what audio format/container is used, since the NFO sidecar is a simple text file. I would basically use this as a way to fill in missing language info when tags from the audio file are not properly picked up for whatever reason.