I am working on a project, where a server automatically generates .pdf files of all parts whenever a musescore .mscz is updated.
I would like to sync these into my cloud backup/sync (e.g. Dropbox) to update my devices with the latest .pdf files.
On the other hand, since most parts dont change, all the time (e.g. the Trombone is untouched, only Sax was changed), I want to keep annotations made on my device on an older file.
My actual javascript goes like this:
One thing i had to learn is, that 2-Way-Sync does not look for LastModified date of the file, but for LastModified of the song.
So, whenever I update a File, I make sure to
8. also update the LastModified of the corresponding Song.
This allows me to update the pdf files of all my songs, but I lose annotations of files, that are updated. Files that are not updated keep their annotations, even though i mark the Song as updated.
Can we have the option to keep old annotations, if File is updated but File.Id is kept?
I would like to sync these into my cloud backup/sync (e.g. Dropbox) to update my devices with the latest .pdf files.
On the other hand, since most parts dont change, all the time (e.g. the Trombone is untouched, only Sax was changed), I want to keep annotations made on my device on an older file.
My actual javascript goes like this:
- find newly generated .pdf files e.g. (Gallowstreet - A Trip Worth Making - Trombone.v5.pdf)
- open mobilesheets.db and list all Files in library
- Find files with similar naming but different version (e.g. Gallowstreet - A Trip Worth Making - Trombone.v4.pdf)
- compare version strings and abort if library version is equal or newer
- copy new .pdf (e.g. v5) to Dropbox and remove old (v4)
- update db File.Path, LastModified, FileSize and Hash (in Future, maybe also pages etc.)
- find and update entry in mobilesheets_hashcodes.txt
One thing i had to learn is, that 2-Way-Sync does not look for LastModified date of the file, but for LastModified of the song.
So, whenever I update a File, I make sure to
8. also update the LastModified of the corresponding Song.
This allows me to update the pdf files of all my songs, but I lose annotations of files, that are updated. Files that are not updated keep their annotations, even though i mark the Song as updated.
Can we have the option to keep old annotations, if File is updated but File.Id is kept?