To help with this, I've decided to write a script to help alleviate one of my pet peeves: missing disc numbers.
Basically, this script would iterate through the music library, check if the ID3 tags for %discnumber% and %totaldiscs% are present, and if not, insert '1' into each tag. There's no need for a user interface.
I'm familiar with C# and Java programming, but not with VBScript, nor the MediaMonkey API; please pardon the influence on my code
I've got this so far:
Code: Select all
' ---------------
' DISC HUNTER
' ---------------
' Iterates through music and appends to TotalDiscs and CurrentDiscs Tag
' ---------------
Sub DiscHunter
' Vars
Dim SongList, SelectedSong, Iterate
' Import the song database, break if empty.
Set SongList = SDB.CurrentSongList
If SongList.Count = 0 Then
Exit Sub
End If
' Iterate through song database.
For Iterate = 0 To SongList.count - 1
Set SelectedSong = SongList.Item(Iterate)
' If the DiscNumber tag is empty, replace it with '1'.
If SelectedSong.DiscNumber = null Then
SelectedSong.DiscNumber = 1
End If
' Same, but with the TotalDiscs.
If SelectedSong.TotalDiscs = null Then
SelectedSong.TotalDiscs = 1
End If
Next
SongList.UpdateAll
End Sub
Code: Select all
public class DiscHunter
{
ArrayList SongList;
Song SelectedSong;
public DiscHunter()
{
SongList = SDB.CurrentSongList;
}
public void RunScript()
{
for (int i = 0; i < SongList.length; i++)
{
SelectedSong = SongList[i];
if (SelectedSong.DiscNumber == null)
{
SelectedSong.DiscNumber = 1;
}
if (SelectedSong.TotalDiscs == null)
{
SelectedSong.TotalDiscs = 1;
}
}
SongList.UpdateAll();
}
}
P.S. Is there somewhere I could get a list of methods (functions) and their descriptions? I'm looking for something like the Javadocs or the MSDN documentation, but any list would do.
Thanks.