Got the idea from this thread: http://www.mediamonkey.com/forum/viewto ... highlight=
And got some help from this thread:
http://www.mediamonkey.com/forum/viewto ... dfakeplays
I'm new at this but I thought it would be fun to make a script so I did
The code might not be the best written but it works for me.
I thought about doing a script that could read the xml-files from this site and add all weeks plays:
http://www.audioscrobbler.net/data/webservices/
But this one was easier for the first script
Code: Select all
'Place in .ini:
'[AddingLastFM]
'FileName=AddingLastFM.vbs
'ProcName=AddingLastFM
'Order=29
'DisplayName=&Adding Last FM plays
'Description=Adding plays from Last FM
'Language=VBScript
'ScriptType=0
Sub AddingLastFM
Set objFilesystem = CreateObject("Scripting.FileSystemObject")
' The path to your textfile
Set objMyFile = objFilesystem.GetFile("D:\Program Files\MediaMonkey\Scripts\songs.txt")
Set objTextStream = objMyFile.OpenAsTextStream(1)
' define vars
Dim Plays, Track, Artist
Dim list, itm, i
Dim tmpId, tmpPlayed
Dim strOut
Dim intPlayCountDiff
Dim strDummyDate
Dim qryStats
Dim mes
' get the list of selected tracks
Set list = SDB.CurrentSongList
' loop through the textfile
Do While Not objTextStream.AtEndOfStream
Plays = objTextStream.readline
Track = objTextStream.readline
Artist = objTextStream.readline
' loop through the list
For i=0 To list.count-1
Set itm = list.Item(i)
tmpId = itm.ID
If itm.artistName = Artist Then
If itm.title = Track Then
If Plays > 0 Then
' add fake plays
For x=0 To Plays-1
strDummyDate = Now
strSQL = "INSERT into Played (IdSong, PlayDate) values (" & itm.ID & ",'" & strDummyDate & "')"
SDB.Database.ExecSQL(strSQL)
next
strSQL = "select Count(Played.IdSong) AS CountOfPlays from Played where Played.IdSong = " & itm.ID
Set qryStats = SDB.Database.OpenSQL(strSQL)
' find out how many plays of this track there have been
countofplays = qryStats.StringByName("CountOfPlays")
' increase PlayCounter
SDB.Database.ExecSQL("UPDATE Songs INNER JOIN Artists ON Songs.IDArtist = Artists.ID SET Songs.PlayCounter = "& countofplays &" WHERE Songs.SongTitle = '"& replace(Track,"'","''") &"' AND Artists.Artist = '"& replace(Artist,"'","''") &"' ")
mes = mes & "||" & itm.title &" - "& itm.artistName & " (" & countofplays & ") ||"
End If
End If
End If
Next
loop
Call SDB.MessageBox(mes,mtInformation,Array(mbOk))
objTextStream.Close
End Sub
The textfile should look like this to work:
Code: Select all
164
Call Me When You're Sober
Evanescence
82
The Diary of Jane
Breaking Benjamin
81
Anywhere
Evanescence
78
Hard Rock Hallelujah
Lordi
77
Broken (Acoustic)
Seether
77
Bones
The Killers
72
The Diary Of Jane (Acoustic Version)
Breaking Benjamin
- If you have two songs with the same title and artist it will increase both playcounts.