MobileSheets Forums

Full Version: Synchronisation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Mike
Upcoming new synchronization features are mentioned in various threads in the forum.
It would be nice to hear about what you are planning to implement.

I would appreciate features like these:
- mobilesheets.db is synchronized to all devices
- mobilesheets.db is adapted during synchronization so that it works correctly on different operating systems
  (Not only Android and Win 10 differ, even different Android versions use different path names)
- song files are synchronized between the devices
- other files that need to be in the same folder as the song files are also synced (and maybe included in the backup)
  This applies mainly to CSVs for fakebooks, MuseScore and iRealPro files that are linked to song files.
  Imho it won't do any harm if just all files in the MSP folder would be synced
- folder structure (subfolders) is kept
- song files can be stored on Android partly in internal memory and partly on SD card
- maintaining song files manually is still possible
- "expose database" stays available
All of that is planned and should be possible except for the part about including CSVs and other files that aren't referenced in the MobileSheets database at all. They may be linked through PDFs, but I don't plan on opening every PDF in the library to check for links to files, as that would significantly slow down the sync.  If you are looking more for a directory sync, where every single file is copied to each device so certain folders match, I could certainly look into adding that either as separate option or utility, but that is not part of the core functionality I currently have planned. I can already see this getting messy with certain device combinations where one device may have folders in use that can't be created on the other device or one is using a removable SD card while the other doesn't, etc. I'll do my best to replicate file paths and folders when possible, but when not possible, I will have to fall back to using the storage location.

> I don't plan on opening every PDF in the library to check for links to files, as that would significantly slow down the sync
Opening every file is not necessary and not what I asked for.
The feature could be "include all files in the MSP folder into backup and/or synchronisation"
CSV files are one example. They have to be in the same folder as the fakebook file they refer to, but aren't linked to anything.
Another example are files that are the source to generate PDFs in the library. They could be of any type and are not necessarily linked to the PDF. That could be Finale or Sibelius files or whatever.
Folders that don't exist on one of the devices (and cannot be created):
Currently I use a workflow to synchronize songs in two folders (one in internal memory, one on SD card) on an Android tablet with the MSP folder on Win10:
Files in these folders are synced with FolderSync
mobilesheets.db is exposed
I adapt mobilesheets.db with a script (see attachment) before I copy it from one device to the other.
There are a number of "folder pairs" that match on the devices. More than expected because the same folder can be mounted on Android under different paths. (see --src / --dst in the attached file)
I consider one of the devices as the "master" where I enter all of the changes and synchronize only in one direction.

Something like that could be generalized and integrated into MSP sync.
I can sync up the storage locations on each device, but if you aren't using the storage location for all of your files, how am I supposed to know which folders should be synchronized on each device? Should I assume that any folder containing files used by any song should be synchronized to the other device? If so, what folder should I place it on in the other device? I could try to mimic the paths on each device, but that only works for Android to Android, and only if the file systems are identical (i.e. if each device is running Android 6.0 and using removable SD cards, the path for the removable SD cards will be different on each device). If instead you want the user to be able to pick what folders to synchronize, I can try to work that into the UI and the logic, but there is still the issue of knowing exactly what paths to use on the other device. If you are sync'ing Android to Windows, for example, I can only create files inside the storage location in the Windows version, so I would have to figure out how to properly handle that (does it even make sense at that point?).

A list of name / folder pairs for every device could solve that.
The names have to be the same on all devices, the folders are specific for each device.
Folders can have subfolders.

For example my usecase:

Acer-Tablet with Android 4.4:
MSP directory: /storage/emulated/0/_MobileSheets
Database: /storage/emulated/0/_MobileSheets/mobilesheets.db
Folder "Songs": /storage/emulated/0/_MobileSheets/Songs/
Folder "Fakebooks0": /storage/emulated/0/_MobileSheets/Fkbk0
Folder "Fakebooks1": /storage/sdcard1/Android/data/com.zubersoft.mobilesheetspro/files/Fkbk1/

Samsung S4 with Android 5.0.1:
MSP directory: /storage/emulated/0/_MobileSheets
Database: /storage/emulated/0/_MobileSheets/mobilesheets.db
Folder "Songs": /storage/emulated/0/_MobileSheets/Songs/
Folder "Fakebooks0": /storage/emulated/0/_MobileSheets/Fkbk0/
Folder "Fakebooks1": /storage/ExtSdCard/Android/data/com.zubersoft.mobilesheetspro/files/Fkbk1/

HP Detachable with Win10 1709 / Acer Notebook with Win10 1709:
MSP directory: d:\HerbertsGoogleDrive\_MobileSheets\
Database: c:\Users\her\AppData\Local\Packages\41730Zubersoft.MobileSheets_xxx\LocalState\mobilesheets.db
Folder "Songs": d:\HerbertsGoogleDrive\_MobileSheets\Songs\
Folder "Fakebooks0": d:\HerbertsGoogleDrive\_MobileSheets\Fkbk0\
Folder "Fakebooks1": d:\HerbertsGoogleDrive\_MobileSheets\Fkbk1\

I checked thoroughly on the detachable and on the tablet that MSP creates files, folders and subfolders as expected when I restore a backup from the same device and when I import files. These are currently the only cases when MSP needs write access to the song file folders. MSP on the S4 is just for a case of emergency, so it requires some more tests.
When I restore a backup from a different device (e.g. make a backup on the Acer tablet and restore it on the Samsung S4 or on a Win10 device) MSP works correctly, but some file locations are changed (files are moved into the root of the MSP folder). So automatic sync would completely confuse the folder structure.
With my folder structure I can put files that I want to edit with other programs into the local memory on Android ("Songs" and "Fakebooks0") and make full use of a lot of space on the external SD card for files that I don't expect to be edited locally ("Fakebooks1"). On Win10 I am able to edit every file, song files are synced between Win10 devices by GoogleDrive. Related files can be organized nicely in subfolders.

It's correct that write access is limited in different ways on the different OSs. I'm not free to choose any path on every device and it needs to be checked if MSP is able to create files and folders. Files in locations where MSP has no write access are probably not useful.
But I think the advantages of being able to use both internal memory and SD card on Android and sync between Android and Win10 are worth considering.
One issue is still open: the same path can show up under more than one name on Android. E.g. /storage/emulated/legacy/, /storage/sdcard0/ and /storage/emulated/0/ are different names for the same root folder in internal memory.