by Gav_ » Tue Sep 18, 2007 6:09 am
Thanks so much trixmoto, had been putting off migrating from MMJB because of having to re-rate all my music (Yahoo Jukebox is awful compared).
A slight mod to the code, some versions of MusicMatch put the rating in as text ("Excellent" to "Poor") instead of a number. My own MP3 collection has some with numbers and some with text.
Here is the updated script:
Code: Select all
Option Explicit
Sub MusicMatchRatings
Dim list,itm,prog,i,q,r,c
Set list = SDB.CurrentSongList
Set prog = SDB.Progress
prog.Text = "Initialising script..."
prog.MaxValue = list.Count
c = 0
For i=0 To list.Count-1
prog.Text = "Checking file "&(i+1)&" of "&list.Count&"..."
prog.Value = i
Set itm = list.Item(i)
r = -1
If isNumeric(itm.Quality) Then
q = Cint(itm.Quality)
If q > -1 Then
If q < 6 Then
r = q * 20
c = c + 1
End If
End If
Else
If Mid(itm.Quality,1,9) = "Excellent" Then
r = 5 * 20
c = c + 1
End If
If Mid(itm.Quality,1,9) = "Very Good" Then
r = 4 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Good" Then
r = 3 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Fair" Then
r = 2 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Poor" Then
r = 1 * 20
c = c + 1
End If
End If
itm.Rating = r
itm.UpdateDB
If prog.Terminate Then Exit For
Next
prog.Text = "Finalising script..."
prog.Value = prog.MaxValue
r = SDB.MessageBox("Tracks updated: "&c&" out of "&list.Count,mtInformation,Array(mbOk))
Set prog = Nothing
End Sub
Thanks so much trixmoto, had been putting off migrating from MMJB because of having to re-rate all my music (Yahoo Jukebox is awful compared).
A slight mod to the code, some versions of MusicMatch put the rating in as text ("Excellent" to "Poor") instead of a number. My own MP3 collection has some with numbers and some with text.
Here is the updated script:
[code]
Option Explicit
Sub MusicMatchRatings
Dim list,itm,prog,i,q,r,c
Set list = SDB.CurrentSongList
Set prog = SDB.Progress
prog.Text = "Initialising script..."
prog.MaxValue = list.Count
c = 0
For i=0 To list.Count-1
prog.Text = "Checking file "&(i+1)&" of "&list.Count&"..."
prog.Value = i
Set itm = list.Item(i)
r = -1
If isNumeric(itm.Quality) Then
q = Cint(itm.Quality)
If q > -1 Then
If q < 6 Then
r = q * 20
c = c + 1
End If
End If
Else
If Mid(itm.Quality,1,9) = "Excellent" Then
r = 5 * 20
c = c + 1
End If
If Mid(itm.Quality,1,9) = "Very Good" Then
r = 4 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Good" Then
r = 3 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Fair" Then
r = 2 * 20
c = c + 1
End If
If Mid(itm.Quality,1,4) = "Poor" Then
r = 1 * 20
c = c + 1
End If
End If
itm.Rating = r
itm.UpdateDB
If prog.Terminate Then Exit For
Next
prog.Text = "Finalising script..."
prog.Value = prog.MaxValue
r = SDB.MessageBox("Tracks updated: "&c&" out of "&list.Count,mtInformation,Array(mbOk))
Set prog = Nothing
End Sub
[/code]