• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connected tablets and Song ID not working
#1
Hi Mike,

I have two tablets here, a server and a client.

I've created a new, empty database on the client and synchronised the two tablets so they should be identical.

On the server, under Connect Tablets, I create a New Leader with default settings.  On the client I connect to the server and in Settings I set "Match songs using:" to Song ID.

Thereafter, selecting a song on the server calls up a song on the client with the same name but not always the same Song ID.

I've checked the songs on the server and client have Song IDs defined and are identical.

I must be missing something obvious.  Can you please let me know what it is?

Kind regards,
Terry.
Reply
#2
Chasing this further:

Having performed a Sync Library from server to client, I compare one of my Setlists on each tablet.  The client Setlist has songs of the same name but not the right ones.

Performing another Sync Library I see that the client songs in this setlist have changed to other songs of the same name.

I'd be happy to grab and compare the databases on each tablet if that would help.
Reply
#3
Having multiple songs with identical names is going to cause a lot of potential issues with the synchronization. Normally, MobileSheetsPro will try to uniquely identify songs by a combination of title and file name. Do your identical songs also have identical file names? If so, that's going to be a real problem for the synchronization.

Mike
Reply
#4
Thanks Mike,

You're right, my identically named songs have identical filenames. I was hoping Song ID would also be used in that comparison, which would seem natural. Shame though.

It looks like my workaround is to rename all of the files. That'll be fun :-)

Kind regards,
Terry.
Reply
#5
In theory, song ID is supposed to be used during the library synchronization as the first thing that is checked. That's probably working as intended for merging your songs together. When it comes to merging the setlists, I'm guessing there is an issue in the code where it's just looking for songs by title right now and using the first one that is found. I will see if I can improve that logic to use song ID first like the rest of the synchronization. So you can hold off on renaming your files.

Mike
Reply
#6
It looks like song ID is used when merging setlists during the library sync to find matching songs on each device, so if you have assigned unique song IDs to all your songs with duplicate titles and filenames, I'm not sure why it's not picking the correct one. I can run some tests to see if I can reproduce the issue you are seeing.

Mike
Reply
#7
So I just set up two setlists. The first setlist uses a version of a song that we will call Song A. The second setlist uses a version of that same song that we will call Song B. Both have identical titles and filenames in the library. I then synchronized my device using a one-way sync (two-way synchronizations are a lot more error-prone), and then loaded both those setlists on the second device. Both setlists used the correct versions of the song. The first setlist had Song A, and the second setlist had Song B. I then repeated the test by adding Song B to the end of the first setlist, synchronizing again, and checking the setlist on the second device. It loaded correctly with both song versions. So it's working as intended with song IDs as far as I can tell. If you want me to investigate this further, I would need a complete copy of your library (create a library backup file under Settings->Backup and Restore->Backup Library and share the .msb through the cloud with mike@zubersoft.com) along with instructions for which setlists to test.

Mike
Reply
#8
Hi Mike,

Apologies for the delay.  I'd assumed that our conversation had finished and I didn't see an email from the forums to inform me about new messages.  Many thanks for looking at this again.

Here's a link to my library backup (apologies for the size):

https://drive.google.com/drive/folders/1...sp=sharing

If you sync this database between Android tablets and look on the Client at the Set List called "All Explorers" you'll see 120+ songs.  Any song title that doesn't begin with the string "Scott - " has been substituted with a song having the same title from a different Collection.  Frequently the first song will be wrong.  This happens even if I've set the connection to match by Song ID.

I'll keep a closer eye on the forums this time.

Kind regards,
Terry.
Reply
#9
Terry,

I restored your backup file on one device, then synchronized that library to another device using Sync Type: Update Client, and Merge Behavior: Always use data from server. I connected the two devices using WiFi (as I strongly prefer that over bluetooth), then loaded the setlist "All Explorers" and verified that every song loaded correctly on both devices. I reloaded the setlist 10 times in a row and the correct song is always shown on each device. So I'm not able to reproduce the issue at the moment. Can you test using WiFi and see if bluetooth is the source of the problem? Otherwise I'm not sure why we are seeing such different results.

Thanks,
Mike
Reply
#10
Mike,

Thank you for looking at my library.

I always use WiFi for syncing. 

When you say the songs loaded correctly are you looking at the jpg and particularly the title at the top?

One large difference is that my original database references files from an external directory, the files aren't managed by MSP. Perhaps it's worth trying to reproduce that scenario. I can add the relevant files to the shared drive with a copy of the database. I could even send a copy of the client's database if that would help.

Kind regards,
Terry.
Reply
#11
Terry,

I'm looking at each tablet screen and verifying the exact same image is displayed on both devices. With your library, when it restored, it immediately started trying to connect multiple devices using bluetooth. So that tells me you use the Connect Tablets feature using bluetooth to have one leader device control another follower device. Are you saying this is not how you use the "Connect Tablets" feature? I was not talking about the library synchronization, as I didn't run into any issues related to that. I think the libraries are synchronizing fine, unless you are telling me that when you load individual songs on each tablet not using the Connect Tablets feature, that you see different versions of songs on each device. When I synchronized my one table to the other tablet, the other tablet had an empty library, so this ensured that the two matched perfectly. If this is not sufficient to reproduce what you are seeing, then it's going to be difficult to know where to go from here. If that is the case, you can do the same thing with your tablets (either use a library backup file from one tablet and restore it on the other tablet or clear the library off one tablet then sync) to ensure that everything works properly, although that wouldn't work well if you are managing your own files and folders.

The best thing for me to be able to investigate this issue would be for you to provide me two backups (one from each device), along with instructions for what to look for after synchronizing the two devices, meaning "load this song on each device after synchronizing and you will see that it loads a different version of the song on each device". Obviously things would need to be in a correct state before the synchronization so that I can see how the synchronization is taking things into an incorrect state. If the problem is related to you using an external directory, that will definitely make things more complicated, as I would then have to set up my own library for testing and hope that I can somehow reproduce the issue. In that case, it would help to have information about what I should be doing to reproduce the issue, i.e. "Create a song named "Song A" using this file, then create another song named "Song A" using a different file, assign different song IDs to both songs, then synchronize the libraries and you should see a problem". As I mentioned earlier, I already set up a fairly simple test using multiple songs with identical titles but different song IDs, but did not run into any issues, so that's why I'm looking for help understanding what it is I need to do differently to see what you are seeing. If the problem is not related to using an external directory, then I should be able to reproduce the issue just using your two backup files.

Thanks,
Mike
Reply
#12
Hi Mike,

Thank you for your explanation.

In the same shared folder as before I've placed the following:

* 3 directories (Collection [123]), each containing 3 files (Song [ABC])
* test.db which has these 9 songs in three collections and one Setlist

You'll need to repoint the PDFs in the songs in the database to wherever you place the directories of course.

From there, I've synchronised this database to an empty database on a different client tablet over WiFi.  Looking at the Setlist on the client I can see that it contains the wrong songs - at least the wrong PDF file as the Song ID looks correct.

It appears as though the code that you use to store the external files during a library backup is preserving their uniqueness but the synchronisation code isn't.

Hopefully this simple example will be reproducible and can be used to resolve the problem.

Kind regards,
Terry.
Reply
#13
Hello Terry,

I don't encounter those problems at all after fixing the database. The database was pointing to files using an absolute file path (i.e. /storage/5BA3-FA26/Cloud/Google/MobileSheets/Shared/Collection 1/Song A.pdf instead of just "Collection 1/Song A.pdf") - that usually leads to problems when synchronizing. Did you set up your library on an Android device where you unchecked the option to Let MobileSheets Manage your Files? If you do that, and you use your own folders to organize the files, it's going to cause conflicts in various parts of the application, especially when synchronizing to a non-Android device, because MobileSheets won't know which folders to preserve when transferring the files, so it just throws them all into the same folders on the target device. MobileSheetsPro can't always write to the same absolute file path on each device, because a different unique identifier is assigned for a removable SD card on each device, so MobileSheetsPro has to redirect the files to the storage location specified under Settings->Storage->Set MobileSheets Storage Location. That results in Song A.pdf being overwritten during the sync, which it sounds like exactly what is happening on your device. If you uncheck the option to let MobileSheets manage your files, you are really on your own for managing the files and folders across your devices if you want to avoid any conflicts, particularly when mixing Android with Windows, or two Android devices while using removable SD cards. 

There is only one scenario where you can sort of get away with managing your own files/folders while allowing MobileSheetsPro to also use relative file paths. You need to set the storage location in MobileSheets to the root folder containing all your other folders, and then you import all of your files from inside the storage location. Even though MobileSheetsPro won't be managing the files, it will recognize that the files are inside the storage location, so it can shorten the paths. This ensures that when you synchronize to another device that may have a different storage location, MobileSheetsPro can still use the relative file paths, which preserves the folder structure you've set up. 

In theory, I can help you fix your database by changing all of the absolute file paths to relative ones assuming you have all of your folders and files under one root folder. Then you'll have to change the storage location to that root folder, and in theory, then everything should work properly and the sync will also work as you are expecting. Let me know if you want to go down that path.

Mike
Reply
#14
Hi Mike,

Thank you for looking at this problem again.

I was indeed unchecking Let MobileSheets Manage your Files and this was my problem.

I'm populating the database and filestore programmatically so making small changes to the file paths is trivial.  I'm now storing everything in the default MSP folder and it's working perfectly synchronising between both Android tablets.  

Sorry for the wild goose chase.

Kind regards,
Terry.
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.