• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Song ID
#1
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).
Reply
#2
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
Reply
#3
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).
Reply
#4
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
Reply
#5
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).
Reply




Users browsing this thread:
1 Guest(s)


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