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
Resources with inconsistent schema; e.g. missing filename_extension field #5528
Comments
This is not a support forum and probably you should ask on the joplin-blog repo anyway. |
I will quote the great Laurent on the Joplin Support forum 😄 :
If you look closer at the content of my issue, you will see that this is potentially a bug report. So that means that Github is the appropriate venue unless you say that this is definitely not a Joplin bug (and it's not considered important how my data got corrupted by Joplin). (I still think it's—more likely than not—a Joplin bug). And also I've already linked to the original discussion on the joplin-blog repo at rxliuli/joplin-utils#19 (comment), which points fingers at Joplin core. |
Ok fair enough. But no it's not a bug in the app because it doesn't affect any of the official Joplin apps, so indeed the right place is to on the joplin-utils repo. |
I want to know what will cause the extension to be empty. If it is not an error, is it possible for me to obtain the extension in a more accurate way? @laurent22 |
Not all resources will have a file extension or even a name, it all depends how it got there. In general the app uses the id as the name and check the mime type if a file extension is needed. You can check the mimeUtils file in this repo for conversion between mime type and file extension. |
Sounds to me like either (1) the Data API could be improved to simply return the filename of a resource or (2) the Data API docs could be improved to explain the "complete and deterministic algorithm for figuring out the filename of the attachment on the filesystem", as I wrote in my initial post. @rxliuli maybe you could figure out that algorithm and submit that as a PR to the Data API docs? |
I'm trying to run the joplin-blog tool and we're running into problems with the resources Web Clipper API endpoint returning empty
filename_extension
fields.I took a look at my database and either it's corrupted or it has vestiges of an old DB schema because the fields
title
,filename
, andfilename_extension
are not consistent:This is the API output for a non-working attachment:
This is the API output for a working attachment:
Environment
Joplin version: 2.4.9
Platform: macOS
OS specifics: 10.15.7
Steps to reproduce
http://localhost:41184/resources/<id>?fields=id,title,file_extension&token=<token>
Describe what you expected to happen
Would like answers to:
Logfile
The text was updated successfully, but these errors were encountered: