Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
Each song has an internal Id and a customizable SongId. When a new song is created, it seems that SongId is initially set to its internal Id. Is that correct?
What is the purpose of the big 'circled plus' button next to the Song Id in the 'Edit Song' form?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 13,377
Threads: 302
Joined: Apr 2012
Reputation:
236
02-19-2019, 05:44 PM
(This post was last modified: 02-19-2019, 05:44 PM by Zubersoft.)
The song ID (primary key) in the Songs table is hidden from the user. The Song ID field in MobileSheetsPro that is shown in the song editor should default to 0 (not set). In order to aid users in picking unique song IDs for their songs, I added that plus button next to the song ID. It will go through all of the songs in the library and find the highest unused song ID.
Mike
Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
I see.
Why not use the song Id as a default (or when hitting the plus button)? It is guaranteed to be unique and, for a new song, it already *is* the highest unused song Id.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 13,377
Threads: 302
Joined: Apr 2012
Reputation:
236
02-20-2019, 02:22 AM
(This post was last modified: 02-20-2019, 02:27 AM by Zubersoft.)
Because then if two users try to use the "Connect Tablets" feature or the library sync feature (or .msf files) and their libraries aren't based on the same library backup (meaning all of the song IDs in their tables are different), songs will be incorrectly matched between their devices. I don't want to automatically set the song ID field for all new songs as it can lead to these problems. The field should really only be used when people plan on having multiple tablets use the exact same song IDs for the songs they want to be matched up. The reason for the button to generate a song ID is so that on one tablet, they can assign a new song ID without having to remember which song ID they used last, and then they can assign that song ID to the other tablets they plan on connecting with.
As far as why I woiuldn't use song table ID as the default when hitting the plus button, that value is not guaranteed to be unique among all song IDs the user might have entered themself. Additionally, for new songs, a song ID isn't available yet, so I would be having to perform a database query to get the Max ID + 1 anyways. If I tightly controlled the field and didn't let users enter values themselves, something like that might work, but then it would cause issues when interacting with libraries that aren't identical. It also wouldn't add any value beyond the existing table ID then.
Mike
Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
Thanks for the explanation!
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).