-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to fetch book data on upload #2333
Add ability to fetch book data on upload #2333
Conversation
@kieraneglin I was looking for some feature like that - would love such a feature. |
This is working great and you taught me about the I came across one issue that has been an existing bug but got highlighted when fetching the proper title. I'm using Windows and I matched a book that had a There is a feature request open to have the scanner also parse subtitles with |
@advplyr great to hear! Regarding that bug, I don't necessarily agree that sanitizing file names should be a client-side concern for a few reasons:
Please let me know what you think! |
I was wrong here, the tempfiles upload with a safe filename. I just have to worry about what the tempfile is renamed to 🤙🏻 |
I definitely agree this needs to be handled server side. I thought it may be useful to also check for this client side to better inform the user, but as you said it would be difficult for the client to know the proper way to sanitize. audiobookshelf/server/utils/fileUtils.js Line 284 in f59516c
We could force sanitize it that way server side or we could just catch the exception and return the error. The error will not happen until the upload completes which can be slow for some users. Edit: the exception needs to be caught either way |
Oh yeah the sanitize filename function also exists client side https://github.com/advplyr/audiobookshelf/blob/master/client/plugins/init.client.js#L53 |
Awesome, thanks! |
IMPORTANT NOTE
This PR is work-in-progress, mainly when it comes to the finishing touches in the UI. I will likely eventually need some UI direction, but for now the focus is on the general concept's viability.
Issue:
When importing media via the upload page, it can be tedious to import lots of media if you also want to ensure the author/series name is correct. This has the most impact to the structure of files stored on-disk - keeping this data correct will namespace media under the desired author/series directories. Keeps things clean!
A secondary issue comes from the details of media not actually being what you expect or may casually call it. For example, people (me) may call this series
The Kingkiller Chronicles
, according to Audible it's justKingkiller Chronicle
. Again, this mostly impacts keeping the directory structure of things well-formed and consistent.Fix Description
I've added some UI to allow for automatic fetching of media data based on what data you have entered in so far (title is required). This fires on-selection of media as long as the title gets auto-populated! If it returns the wrong information, you can always edit it to your preference OR give it a little hint by updating, say, the author and fire a re-fetch manually.
As mentioned, this also provides a way to manually fetch details for a single piece of media. This is helpful for re-fetching media if-needed, but it's also good for when the uploaded filename is VERY different than the actual title of the media.
NOTE: this only works on audiobooks.
Additional Fixes:
directory
input being smaller and misaligned compared to theseries
input on upload page.trim
modifier to upload form inputs to chop leading/trailing whitespaceItemUploadCard
'sgetData
method to use an I18n string rather than hardcodingRegressions:
None known.
GitHub Issues Resolved:
None known.
Screen Captures
ABS.Auto-fetch.2.mov