
so diddeleedoo
your almost done with the catch up ratings script.?

Yeah thats cool, but still there is unfortunately no negative ratings defined in the id3 tag standards.confused wrote:did you see the stars rovingcowboy made to work on the dark skins?
he made the bomb on them a grave stone being hit by a lighitinning bolt.
thats a negative star?
http://www.id3.org/id3v2.4.0-frames.txt4.17. Popularimeter
The purpose of this frame is to specify how good an audio file is.
Many interesting applications could be found to this frame such as a
playlist that features better audio files more often than others or
it could be used to profile a person's taste and find other 'good'
files by comparing people's profiles. The frame contains the email
address to the user, one rating byte and a four byte play counter,
intended to be increased with one for every time the file is played.
The email is a terminated string. The rating is 1-255 where 1 is
worst and 255 is best. 0 is unknown. If no personal counter is wanted
it may be omitted. When the counter reaches all one's, one byte is
inserted in front of the counter thus making the counter eight bits
bigger in the same away as the play counter ("PCNT"). There may be
more than one "POPM" frame in each tag, but only one with the same
email address.
<Header for 'Popularimeter', ID: "POPM">
Email to user <text string> $00
Rating $xx
Counter $xx xx xx xx (xx ...)
No, what I am saying is there no negative stars, so I use bomb thru 2 as negative, 2.5 as zero/neutral, 3+ as positive.rovingcowboy wrote:so teknojnky
what your saying is that there is the options to use 10 ratings 5 for postive stars and 5 for negative stars?
Code: Select all
' EXPLAINING THE SYSTEM
'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
' This system is based on how many times you tolerate
' to listen to the same song in a set amount of time.
'
' 1 play = 2.5 stars (Accepted)
' 2 plays = 3.0 stars (Like)
' 3 plays = 3.5 stars (Nice)
' 4 plays = 4.0 stars (Any time)
' 5 plays = 4.5 stars (Love It)
' 6 plays or more = 5 stars (In Love!).. Lucky you!!
'
' 2.0 Stars = New Album, Unratet and Unplayed
'
' Skip degrading steps for 2.0 Star songs
' 1st skip = 1.5 Stars = Not now, maybe another day
' 2nd skip = 1.0 Stars = Not now either
' 3rd skip = 0.5 Stars = Not now either!!! Annoying
' 4th skip = 0.0 Stars = Bad Album Filler, Rating "Recycle Bin" (bomb)
'
' 1.5 and 1.0 Star songs get 2.5 Star (accepted) if played fully once.
' 0.0 and 0.5 Star songs needs to be played twise to get 2.5 Star
'
' Songs already rated high, only loose half a star if they are skipped.
'
' A 2.5 Star song jump down to 1.5 Star (maybe another day) if
' skipped, to keep 2.0 Star songs for new albums, unplayed, unrated
' A 2.0 Stars song go down to 1.5 on first skip
' (Not sure if it would need two skips to go down to 1.5 Star???)
Code: Select all
ProtectSpecialSongs = True
' Songs with values in either the Mood or
' the Occasion field will not be rated at all.
' This song is probably well classified already.
Code: Select all
[x] Protect Songs with values in Occasion or Mood
(General Use Songs do not have values there)
----------------------------------------------------------------------------
Tag upgraded songs with
Occasion: Christmas
The next [6] Hours
Only songs with the same Occasion value will degrade if skipped
----------------------------------------------------------------------------
Tag upgraded songs with
Mood: Party
the next [8] Hour(s)
Only songs with the same Mood value will degrade if skipped
Code: Select all
[AutoRateSongs]
FileName=AutoRateSongs.vbs
ProcName=AutoRateLastSongPlayed
Language=VBScript
ScriptType=2
Code: Select all
' Save this script to \MediaMonkey\Scripts\Auto\AutoRateOptionSheet.vbs
' Companion script to \MediaMonkey\Scripts\AutoRateSongs.vbs
' Author: DiddeLeeDoo
' Thank you fellow monkeys for great ideas and help
' Date: 3 May 2006
Sub OnStartup
ind = SDB.UI.AddOptionSheet("Auto Rating", Script.ScriptPath, "InitSheet", "SaveSheet", -3)
End Sub
Dim oT(13,3)
oT(0,0) = "os00"
oT(0,1) = False
oT(0,2) = "Ctr00"
oT(0,3) = "Enable"
oT(1,0) = "osTimeStamp"
oT(1,1) = False
oT(1,2) = "Ctr01"
oT(1,3) = "Time Stamp to Custom2"
oT(2,0) = "osNH"
oT(2,1) = True
oT(2,2) = "Ctr02"
oT(2,3) = "Northern Hemisphere"
oT(3,0) = "osRadio"
oT(3,1) = False
oT(3,2) = "Ctr03"
oT(3,3) = "Radio Announcer"
'-
oT(4,0) = "osSMStart"
oT(4,1) = 10
oT(4,2) = "Ctr04"
oT(4,3) = "Start Skip-Monitor after XX seconds play. Allow you to sample songs."
oT(5,0) = "osInterlude"
oT(5,1) = 20
oT(5,2) = "Ctr05"
oT(5,3) = "Do nothing with sound clips shorter than XX Seconds"
oT(6,0) = "osSMStop"
oT(6,1) = 85
oT(6,2) = "Ctr06"
oT(6,3) = "Stop Skip-Monitor at XX % of song."
oT(7,0) = "osPeriod"
oT(7,1) = 1
oT(7,2) = "Ctr07"
oT(7,3) = "Number of days to check for multi-plays. (Default=1)"
oT(8,0) = "osPR050"
oT(8,1) = 1
oT(8,2) = "Ctr08"
oT(8,3) = "Minimum 2.5 Stars when played up to or equal to # (Default=1)"
oT(9,0) = "osPR060"
oT(9,1) = 2
oT(9,2) = "Ctr09"
oT(9,3) = "Minimum 3.0 Stars when played up to or equal to # (Default=2)"
oT(10,0) = "osPR070"
oT(10,1) = 3
oT(10,2) = "Ctr10"
oT(10,3) = "Minimum 3.5 Stars when played up to or equal to # (Default=3)"
oT(11,0) = "osPR080"
oT(11,1) = 4
oT(11,2) = "Ctr11"
oT(11,3) = "Minimum 4.0 Stars when played up to or equal to # (Default=4)"
oT(12,0) = "osPR090"
oT(12,1) = 5
oT(12,2) = "Ctr12"
oT(12,3) = "Minimum 4.5 Stars when played up to or equal to # (Default=5)"
oT(13,0) = "osProtect"
oT(13,1) = False
oT(13,2) = "Ctr13"
oT(13,3) = "Ignore songs having"
'--
Sub InitSheet(Sheet)
Set UI=SDB.UI
Set Edt = UI.NewCheckBox(Sheet)
Edt.Common.SetRect 20, 20, 120, 20
Edt.Checked = oT(0,1)
Edt.Common.ControlName = oT(0,2)
Edt.Caption = oT(0,3)
Set Edt = UI.NewCheckBox(Sheet)
Edt.Common.SetRect 280, 20, 150, 20
Edt.Checked = oT(1,1)
Edt.Common.ControlName = oT(1,2)
Edt.Caption = oT(1,3)
Set Edt = UI.NewCheckBox(Sheet)
Edt.Common.SetRect 280, 40, 150, 20
Edt.Checked = oT(2,1)
Edt.Common.ControlName = oT(2,2)
Edt.Caption = oT(2,3)
Set Edt = UI.NewCheckBox(Sheet)
Edt.Common.SetRect 150, 20, 120, 20
Edt.Checked = oT(3,1)
Edt.Common.ControlName = oT(3,2)
Edt.Caption = oT(3,3)
Set Edt = UI.NewCheckBox(Sheet)
Edt.Common.SetRect 150, 40, 118, 20
Edt.Checked = oT(13,1)
Edt.Common.ControlName = oT(13,2)
Edt.Caption = oT(13,3)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 169, 60, 150, 20
Edt.Caption = "Mood and/or Occasion values"
Edt.Autosize = True
Edt.Alignment = 0
'-
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 90, 50, 20
Edt.Value = oT(4,1)
Edt.MinValue = 5
Edt.MaxValue = 50
Edt.Common.ControlName = oT(4,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 93, 300, 20
Edt.Caption = oT(4,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 110, 50, 20
Edt.Value = oT(6,1)
Edt.MinValue = 35
Edt.MaxValue = 95
Edt.Common.ControlName = oT(6,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 113, 300, 20
Edt.Caption = oT(6,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 130, 50, 20
Edt.Value = oT(5,1)
Edt.MinValue = 5
Edt.MaxValue = 90
Edt.Common.ControlName = oT(5,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 133, 300, 20
Edt.Caption = oT(5,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 155, 50, 20
Edt.Value = oT(7,1)
Edt.MinValue = 1
Edt.MaxValue = 5000
Edt.Common.ControlName = oT(7,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 158, 300, 20
Edt.Caption = oT(7,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 180, 50, 20
Edt.Value = oT(8,1)
Edt.MinValue = 0
Edt.MaxValue = 500
Edt.Common.ControlName = oT(8,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 183, 300, 20
Edt.Caption = oT(8,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 200, 50, 20
Edt.Value = oT(9,1)
Edt.MinValue = 0
Edt.MaxValue = 500
Edt.Common.ControlName = oT(9,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 203, 300, 20
Edt.Caption = oT(9,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 220, 50, 20
Edt.Value = oT(10,1)
Edt.MinValue = 0
Edt.MaxValue = 500
Edt.Common.ControlName = oT(10,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 223, 300, 20
Edt.Caption = oT(10,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 240, 50, 20
Edt.Value = oT(11,1)
Edt.MinValue = 0
Edt.MaxValue = 500
Edt.Common.ControlName = oT(11,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 243, 300, 20
Edt.Caption = oT(11,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewSpinEdit(Sheet)
Edt.Common.SetRect 20, 260, 50, 20
Edt.Value = oT(12,1)
Edt.MinValue = 0
Edt.MaxValue = 500
Edt.Common.ControlName = oT(12,2)
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 263, 300, 20
Edt.Caption = oT(12,3)
Edt.Autosize = True
Edt.Alignment = 0
Set Edt = UI.NewLabel(Sheet)
Edt.Common.SetRect 77, 283, 300, 20
Edt.Caption = "Anything over the 4.5 Star level receive 5.0 Stars"
Edt.Autosize = True
Edt.Alignment = 0
'--
Set Regs = SDB.Registry
If Regs.OpenKey("Auto Rating", True) Then
If Regs.ValueExists(oT(0,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(0,2))
Edt.Checked = Regs.BoolValue(oT(0,0))
End If
If Regs.ValueExists(oT(1,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(1,2))
Edt.Checked = Regs.BoolValue(oT(1,0))
End If
If Regs.ValueExists(oT(2,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(2,2))
Edt.Checked = Regs.BoolValue(oT(2,0))
End If
If Regs.ValueExists(oT(3,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(3,2))
Edt.Checked = Regs.BoolValue(oT(3,0))
End If
If Regs.ValueExists(oT(13,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(13,2))
Edt.Checked = Regs.BoolValue(oT(13,0))
End If
'-
If Regs.ValueExists(oT(4,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(4,2))
Edt.Value = Regs.IntValue(oT(4,0))
End If
If Regs.ValueExists(oT(5,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(5,2))
Edt.Value = Regs.IntValue(oT(5,0))
End If
If Regs.ValueExists(oT(6,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(6,2))
Edt.Value = Regs.IntValue(oT(6,0))
End If
If Regs.ValueExists(oT(7,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(7,2))
Edt.Value = Regs.IntValue(oT(7,0))
End If
If Regs.ValueExists(oT(8,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(8,2))
Edt.Value = Regs.IntValue(oT(8,0))
End If
If Regs.ValueExists(oT(9,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(9,2))
Edt.Value = Regs.IntValue(oT(9,0))
End If
If Regs.ValueExists(oT(10,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(10,2))
Edt.Value = Regs.IntValue(oT(10,0))
End If
If Regs.ValueExists(oT(11,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(11,2))
Edt.Value = Regs.IntValue(oT(11,0))
End If
If Regs.ValueExists(oT(12,0)) Then
Set Edt = Sheet.Common.ChildControl(oT(12,2))
Edt.Value = Regs.IntValue(oT(12,0))
End If
Regs.CloseKey
End If
End Sub
'--
Sub SaveSheet(Sheet)
Set Regs = SDB.Registry
If Regs.OpenKey("Auto Rating", True) Then
Set Edt = Sheet.Common.ChildControl(oT(0,2))
Regs.BoolValue(oT(0,0)) = Edt.Checked
Set Edt = Sheet.Common.ChildControl(oT(1,2))
Regs.BoolValue(oT(1,0)) = Edt.Checked
Set Edt = Sheet.Common.ChildControl(oT(2,2))
Regs.BoolValue(oT(2,0)) = Edt.Checked
Set Edt = Sheet.Common.ChildControl(oT(3,2))
Regs.BoolValue(oT(3,0)) = Edt.Checked
Set Edt = Sheet.Common.ChildControl(oT(13,2))
Regs.BoolValue(oT(13,0)) = Edt.Checked
'-
Set Edt = Sheet.Common.ChildControl(oT(4,2))
Regs.IntValue(oT(4,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(5,2))
Regs.IntValue(oT(5,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(6,2))
Regs.IntValue(oT(6,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(7,2))
Regs.IntValue(oT(7,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(8,2))
Regs.IntValue(oT(8,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(9,2))
Regs.IntValue(oT(9,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(10,2))
Regs.IntValue(oT(10,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(11,2))
Regs.IntValue(oT(11,0)) = Edt.Value
Set Edt = Sheet.Common.ChildControl(oT(12,2))
Regs.IntValue(oT(12,0)) = Edt.Value
Regs.CloseKey
End If
End Sub
Code: Select all
' Save this script to
' \MediaMonkey\Scripts\AutoRateSongs.vbs
' Author: DiddeLeeDoo
' Thank you fellow monkeys for great ideas and help
' Date: 16 May 2006
'############################################################
Dim Itm
Set Regs = SDB.Registry
Sub AutoRateLastSongPlayed
If Regs.OpenKey("Auto Rating", True) Then
If Not Regs.BoolValue("os00") Then
Regs.CloseKey
Exit Sub
End If
End If
If Regs.IntValue("arSongID") = 0 Then
Regs.StringValue("arSongPlayStart")= Now
WriteCurrentSongData
Exit Sub
End If
Set Itm = SDB.Player.CurrentSong
If Itm.ID = Regs.IntValue("arSongID") and Regs.IntValue("arSongSeconds") > DateDiff("s",Regs.StringValue("arSongPlayStart"),Now) Then
Regs.IntValue("arSongSeconds") = Regs.IntValue("arSongSeconds") + 2
Regs.IntValue("arSongRating")=Itm.Rating
Regs.CloseKey
Exit Sub
End If
arRT = DateDiff("s",Regs.StringValue("arSongPlayStart"),Now)
Regs.StringValue("arSongPlayStart")= Now
If Regs.IntValue("arSongSeconds") <= Regs.IntValue("osInterlude") Then
WriteCurrentSongData
Exit Sub
End If
If Regs.IntValue("osProtect") and Trim(Regs.StringValue("arSongMood")) & Trim(Regs.StringValue("arSongOccasion")) <> "" Then
WriteCurrentSongData
Exit Sub
End If
If arRT <= Regs.IntValue("osSMStart")+1 Then
WriteCurrentSongData
Exit Sub
End If
D_H = "'d'"
Dim dbTable, dbSong
Set dbTable = SDB.Database.QuerySongs("AND Songs.ID=" & Regs.IntValue("arSongID"))
Set dbSong = dbTable.Item
If arRT <= Regs.IntValue("arSongSeconds")*(Regs.IntValue("osSMStop")/100) Then
If Regs.IntValue("arSongRating") < 0 Then
If Not dbTable.EOF Then
dbSong.Rating = 30
dbSong.UpdateDB
End If
ElseIf Regs.IntValue("arSongRating") >= 10 Then
SkipVal = 10
If Regs.IntValue("arSongRating") = 50 Then SkipVal = 20
SkipStep = Regs.IntValue("arSongRating") - SkipVal
If Not dbTable.EOF Then
dbSong.Rating = SkipStep
dbSong.UpdateDB
End If
End If
Else
StrQuery = "SELECT Count(Played.IdSong) AS arNoP "_
+ "FROM Played "_
+ "WHERE (((DateDiff(" & D_H & ",Now(),[Played].[Playdate])" & _
+ ">=-" & Regs.IntValue("osPeriod") & ")=True)) GROUP BY Played.IdSong "_
+ "HAVING Count(Played.IdSong) >0 AND Played.IdSong=" & _
+ Regs.IntValue("arSongID")
Dim dbT
Set dbT = SDB.Database.OpenSQL(StrQuery)
If Not dbT.EOF Then
dbD=Int(dbT.StringByIndex(0))
End If
If dbD<=Regs.IntValue("osPR050") Then
cRate = 50
ElseIf dbD<=Regs.IntValue("osPR060") Then
cRate = 60
ElseIf dbD<=Regs.IntValue("osPR070") Then
cRate = 70
ElseIf dbD<=Regs.IntValue("osPR080") Then
cRate = 80
ElseIf dbD<=Regs.IntValue("osPR090") Then
cRate = 90
Else
cRate = 100
End If
If Regs.IntValue("arSongRating")>=0 and Regs.IntValue("arSongRating")<20 Then
RateUp = Regs.IntValue("arSongRating") + 10
Else
RateUp = cRate
End If
If RateUp > Regs.IntValue("arSongRating") Then
If Not dbTable.EOF Then
dbSong.Rating = RateUp
If Regs.BoolValue("osTimeStamp") Then dbSong.Custom2=wDay&" "&TimeOfDay&" "&Season
dbSong.UpdateDB
End If
End If
End If
If Itm.ArtistName = Regs.StringValue("arSongArtist") Then
SayThis = Itm.Title & "."
Else
SayThis = Itm.ArtistName & ", " & Itm.Title & "."
End If
If Regs.BoolValue("osRadio") Then
Dim tts
Set tts = CreateObject("SAPI.SpVoice")
SDB.Player.Pause
tts.Speak SayThis
tts.WaitUntilDone(-1)
SDB.Player.Pause
Regs.StringValue("arSongPlayStart")= Now
End If
WriteCurrentSongData
End Sub
Sub WriteCurrentSongData
Set Itm = SDB.Player.CurrentSong
Regs.IntValue("arSongID")=Itm.ID
Regs.IntValue("arSongSeconds")=Int(Itm.SongLength/1000)
Regs.IntValue("arSongRating")=Itm.Rating
Regs.IntValue("arSongPlayed")=Itm.PlayCounter
Regs.StringValue("arSongMood")=Itm.Mood
Regs.StringValue("arSongOccasion")=Itm.Occasion
Regs.StringValue("arSongArtist")=Itm.ArtistName
Regs.CloseKey
End Sub
Function Season()
osNH = Regs.IntValue("osNH")
wwNow = Int(DatePart("ww",Now))
If wwNow < 12 Then
If osNH Then Season = "Winter" else Season = "Summer"
ElseIf wwNow < 25 Then
If osNH then Season = "Spring" else Season = "Autumn"
ElseIf wwNow < 38 Then
If osNH then Season = "Summer" else Season = "Winter"
ElseIf wwNow < 51 Then
If osNH then Season = "Autumn" else Season = "Spring"
Else 'for those two weeks at the end of the year
If osNH then Season = "Winter" else Season = "Summer"
End If
End Function
Function TimeOfDay()
tNow = DatePart("h",Now)
If tNow < 6 Then
TimeOfDay = "night"
ElseIf tNow < 9 Then
TimeOfDay = "morning"
ElseIf tNow < 17 Then
TimeOfDay = "daytime"
ElseIf tNow < 19 Then
TimeOfDay = "dinner"
ElseIf tNow < 24 Then
TimeOfDay = "evening"
End If
End Function
Function wDay()
wDay = WeekdayName(Weekday(Now))
End Function
So there'll be no performance issues with that do you think?Teknojnky wrote:You know, you could combine this to one script, just change the script.ini entry to point to the auto\autoratesongs.vbs file.