MobileSheets Forums

Full Version: Song ID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.

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.
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.

Thanks for the explanation!