If you enable Settings->Import Settings->Extract PDF Metadata, then any PDF you import (using any approach) should result in the metadata being pulled out of the file.
I am currently porting the companion app over to a cross platform framework so it can be released on Linux and MacOS. As part of that, I've redesigned the entire UI using a material design framework to make it more modern. I am also going to add the ability to extract PDF metadata, although I'll be using a new library for this (the one I use in the main app is not available in the language the companion app is written in), so I will have some additional testing to do.
I played around with PDF metadata and it works quite well. I'm using exiftool to set the PDF tags and import the files to MSP.
All of the tags are working, only the "custom_group" field cannot be filled. I renamed the field to "Mappe" which should not affect the import (I hope).
I just want to be sure that this field is supported before investing more time.
(07-04-2023, 06:30 PM)Zubersoft Wrote: Yes, it was added in version 3.8.6. You'll find an option under Settings->Import Settings to automatically extract PDF metadata upon import, or you can manually extract the metadata on the files tab of the song editor.
Mike
Hi Mike,
I wasn't aware this was implemented by now, thanks!
I've been testing, but I can't get this working for certain fields (tempo, time signature, title), so I'm probably doing some wrong. Is there documentation which explains what meta data should be in the PDF with what name to make everything work in MSP?
For tempo, just insert "Tempos" or "tempos" using a tool that can insert XMP metadata. For time signature, insert "Signature". Title is a standard field that any tool that handles metadata should support. When looking at a file in Adobe, it has it listed under Dublin Core Properties->dc:title.
08-24-2024, 11:54 PM (This post was last modified: 08-25-2024, 12:01 AM by merijnb.)
(08-24-2024, 03:48 AM)Zubersoft Wrote: For tempo, just insert "Tempos" or "tempos" using a tool that can insert XMP metadata. For time signature, insert "Signature". Title is a standard field that any tool that handles metadata should support. When looking at a file in Adobe, it has it listed under Dublin Core Properties->dc:title.
Mike
It's starting to work, with some issues though (see other topic).
However, the signature is never imported (it's in the PDF file as "Signatures"), any way to troubleshoot this?
Please see attached pdf, this song is imported as "Test song" and not "Test song - C" with "use filename as title".
In the import all added metadata is imported, except the singature.
Also, when I import this file twice with the same settings, I do not get a duplicate file alert and have the song twice in the database.
08-25-2024, 03:55 AM (This post was last modified: 08-25-2024, 04:02 AM by Zubersoft.)
Your PDF has the title set to "Test song" in the metadata, so that overrides any of the settings in MobileSheets, and is used for the song title. The problem with the signature is that my app is expecting "Signature", not "Signatures". All of the fields with the exception of tempos is singular (i.e. Artist, Key, Signature, Genre, etc). I probably should have used "Tempo" instead of "Tempos", so I may update the code to allow for either.
As far as the duplicate file detection not working, do you have the "Duplicate File Behavior" set to "Ignore Duplicate Files"? If not, make sure to set that value. I imported the file twice and the second time it was ignored, as expected.
(08-25-2024, 03:55 AM)Zubersoft Wrote: Your PDF has the title set to "Test song" in the metadata, so that overrides any of the settings in MobileSheets, and is used for the song title. The problem with the signature is that my app is expecting "Signature", not "Signatures". All of the fields with the exception of tempos is singular (i.e. Artist, Key, Signature, Genre, etc). I probably should have used "Tempo" instead of "Tempos", so I may update the code to allow for either.
As far as the duplicate file detection not working, do you have the "Duplicate File Behavior" set to "Ignore Duplicate Files"? If not, make sure to set that value. I imported the file twice and the second time it was ignored, as expected.
Mike
Hi Mike,
I think I have tested signature as well, but I'll test that again. I don't want to ignore duplicate files, but overwrite them, so the checkbox you mentioned in the other topic would be great.
(08-25-2024, 03:55 AM)Zubersoft Wrote: As far as the duplicate file detection not working, do you have the "Duplicate File Behavior" set to "Ignore Duplicate Files"? If not, make sure to set that value. I imported the file twice and the second time it was ignored, as expected.
To get back on this, if you have the other setting for Duplicate File Behavior, I would expect the "duplicate file" dialog, but I don't get that, do you?
Hello Mike,
Am I right, that "SortTitle" will not be imported/extracted right now?
Had you already a chance to take a look at the behavior, that the metadata will not be updated on batch-import?
That will be a very great feature for my use-case
08-27-2024, 05:26 AM (This post was last modified: 08-27-2024, 05:27 AM by Zubersoft.)
As long as the PDF being imported is different in any way, I always see the conflict dialog which asks how I want to handle the conflict. If the PDF is identical, then it's either ignored or a duplicate song is created depending on that dropdown selection. If you are not seeing the conflict dialog even when importing a PDF that has different content but the same name as an existing PDF in the library, then something is not working the way it should, but I would more details to explain why that's happening.
SortTitle is not currently a supported field - that's something that would have to be added. The batch import should work identically to just using one of the other import options like Import->Local File, as they both use the same underlying code. You cannot update metadata for an existing song by just reimporting the PDF again - that's not currently supported, so if you are trying to do that, it won't work. You'd have to delete the song first, then reimport. Alternatively, update the PDF, then use the option in the song editor to extract the metadata from the PDF again.
(08-27-2024, 05:26 AM)Zubersoft Wrote: As long as the PDF being imported is different in any way, I always see the conflict dialog which asks how I want to handle the conflict. If the PDF is identical, then it's either ignored or a duplicate song is created depending on that dropdown selection. If you are not seeing the conflict dialog even when importing a PDF that has different content but the same name as an existing PDF in the library, then something is not working the way it should, but I would more details to explain why that's happening.
Maybe I misunderstood you earlier. Are you saying that what makes a song unique is only the title? So if I have a song named with title "song 1" I can then import another pdf with title "song 1" and it will be detected as duplicate even if other imported meta data differs?
This is the logic for how the import works (assuming MobileSheets is managing the files which is a setting that is only available on Android):
1) A PDF is selected and imported
2) A title for the new song has to be determined, which is calculated based on whether PDF metadata is being extracted (and with the next update, is being used for the title), or the dropdown selection on the import dialog
3) If "Create Subdirectory per Song" is enabled, a folder will be created in the storage location that matches the calculated title for the song.
4) The output location for the file is calculated based on #3 plus the storage location path + the name of the PDF. So if we are on Windows, for example, no subdirectories are used and the PDF is named "Song 1.pdf", MobileSheets checks C:\Users\<your username>\AppData\Local\Packages\41730Zubersoft.MobileSheets_ys1c8ct2g6ypr\LocalState\Song 1.pdf to see if it already exists (assuming you are using the default storage location)
5) If Song 1.pdf already exists, MobileSheets checks the calculated hash for the existing file against the calculated hash for the new file to see if they match. Any modification, no matter how minor to the PDF, will cause the hash to be different. If the hashes do not match, a conflict dialog is displayed letting the user choose how to handle the new version of the PDF. If a Song 1.pdf does not exist, the new file will just be used and a song will be created with no need for user import. If Song 1.pdf is identical to what is already being used in the library, then it will either be ignored or a new song will be created using the same file based on the duplicate file behavior dropdown
That is the only thing that is considered. The metadata in MobileSheets plays no part. It just matters whether the PDF itself is different from what is already being used.
(08-27-2024, 05:26 AM)Zubersoft Wrote: SortTitle is not currently a supported field - that's something that would have to be added. The batch import should work identically to just using one of the other import options like Import->Local File, as they both use the same underlying code. You cannot update metadata for an existing song by just reimporting the PDF again - that's not currently supported, so if you are trying to do that, it won't work. You'd have to delete the song first, then reimport. Alternatively, update the PDF, then use the option in the song editor to extract the metadata from the PDF again.
Mike
That would be great, if SortTitle will be extracted from Metadata.
Regarding Metadata Change. We talked about that a while ago and you agreed, that it should work and you will work on a fix: