I doing this over in C# because I want to eliminate the manual process, and build a graphical interface with button that will let me easily indicate the changes to make. Since I don't fully understand the MM database, I wanted to make sure that I do the changes correctly.
The program is just beginning, but right now I do an OpenSQL query, and then I iterate over the results, adding each Artist to a list:
Code: Select all
var QueryData = SDB.Database.OpenSQL( "select * from artists" );
while( true )
{
if (QueryData.StringByName("Artist") == null)
break;
ArtistsList.Add( QueryArtists.StringByName("Artist") )
QueryData.Next();
}
Now let's say that I have find an Artist with the correct spelling and another Artist with the "same" name spelled incorrectly. If I just change the incorrect spelling to the correct spelling, would I end up with 2 Artists with the correct spelling? Would MM handle this or complain?
I am thinking that I really should step through all the Songs, with a query to match to the incorrect spelling, and change each song's Artist to the Artist with the correct spelling. Something like (semi-pseudo-code):
Code: Select all
QUERY = "Artist LIKE " + IncorrectSpelling
var QuerySongs = SDB.Database.QuerySongs( QUERY );
foreach( Song in QuerySongs ) {
Song = QuerySongs.Item;
Song.ArtistName = CorrectSpelling;
Song.WriteTags();
Song.UpdateDB();
QuerySongs.Next();
}
Any other tips/info would be appreciated! Thanks.