• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Song IDs and sync
#5
I've modified the matching logic in the library sync to match on song ID if possible, and if no match is found, it falls back to title. 

I really don't want to add logic to enforce a unique song ID. There are scenarios where you may want to have multiple songs with the same song ID. For example, a master device may want to load two different versions of a song, but on the connected slave device, you always want it to load one specific version regardless of what the master is loading. So the master should be allowed to assign the same song ID to multiple songs if desired.  I also don't really think auto-generating song IDs for every song would be that useful in practice either. If you did this on two different tablets, there is no guarantee that the song IDs would match up, and it's actually dangerous if they dont, as now all of the songs would be matched up incorrectly.

The database itself already has a primary key on the song table which is used for certain kinds of matching (like with the library sync). This ID is rarely useful when comparing two different libraries, but with the library sync functionality, it's a useful check as the two libraries may be mostly identical. So the song table ID is used to distinguish the correct match when dealing with multiple songs whose title matches, or in the case where no song title match is found (i.e. a song was renamed) but a matching song exists in the library (the creation date is also compared in this instance to ensure it really is a match). 

If you performed renames of songs and MobileSheetsPro couldn't match those songs up correctly during a sync, it means your two databases don't match. In that case, you really need to back up the library on one device using Settings->Backup and Restore->Backup Library, then restore that library on the other device (effectively wiping out the library and replacing it). If you do this, then the two libraries will match up perfectly even after renaming songs. It also ensures songs that are created from that point forward will have the same ID in the song table assuming you only add songs on one device at a time and sync in between changes.

Mike
Reply


Messages In This Thread
Song IDs and sync - by sciurius - 01-19-2019, 11:41 PM
RE: Song IDs and sync - by Zubersoft - 01-20-2019, 04:24 AM
RE: Song IDs and sync - by sciurius - 01-21-2019, 06:52 AM
RE: Song IDs and sync - by evaneaston - 02-02-2019, 12:57 AM
RE: Song IDs and sync - by Zubersoft - 02-02-2019, 03:50 AM
RE: Song IDs and sync - by evaneaston - 02-02-2019, 04:05 AM
RE: Song IDs and sync - by Zubersoft - 02-02-2019, 09:09 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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