Work in progress - Modify Play Counter via script
I have a version of this script installed but when I upgraded to MM3, it started putting 12/31/1899 as the last played date. Below is the code. Anyone have any ideas how to fix this problem?
' increments play counter and sets last time played to current date and time
' Source: http://www.mediamonkey.com/forum/viewtopic.php?t=1461
' modified to work with a non-English date format and to also update the "Played" table.
' you need to refesh (F5) the screen to see the changes.
Option Explicit
Sub IncrPlayCntr
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
'must use sql because there is no itm.LastTimePlayed property
SDB.database.execSQL("UPDATE Songs SET PlayCounter=" & (itm.PlayCounter + 1) & ",LastTimePlayed='" & now() & "' WHERE Id=" & itm.songID)
' there is another DB table that stores when the song was played,
' so in order to stay consistent, we update this, too.
' This table is used for the "50 last played songs" playlist
SDB.database.execSQL("INSERT INTO Played (IdSong, PlayDate) VALUES (" & itm.songId & ", '" & now() & "')")
Next
End Sub
' increments play counter and sets last time played to current date and time
' Source: http://www.mediamonkey.com/forum/viewtopic.php?t=1461
' modified to work with a non-English date format and to also update the "Played" table.
' you need to refesh (F5) the screen to see the changes.
Option Explicit
Sub IncrPlayCntr
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
'must use sql because there is no itm.LastTimePlayed property
SDB.database.execSQL("UPDATE Songs SET PlayCounter=" & (itm.PlayCounter + 1) & ",LastTimePlayed='" & now() & "' WHERE Id=" & itm.songID)
' there is another DB table that stores when the song was played,
' so in order to stay consistent, we update this, too.
' This table is used for the "50 last played songs" playlist
SDB.database.execSQL("INSERT INTO Played (IdSong, PlayDate) VALUES (" & itm.songId & ", '" & now() & "')")
Next
End Sub
I'm looking for a script that will allow me to decrease playcounts. Will this script do that? I've read that it might be possible but I'm really not following how that could be accomplished. I'm also unclear on what modifications I need to make to the original script, if any.
If there is another, easier method to edit play counts, please point me to it. I understand I could have used Access for MM2. Is there an equivalent application for MM3's type of database that will allow me to see and edit values directly?
Thanks for any help!
Cheers,
Paula
If there is another, easier method to edit play counts, please point me to it. I understand I could have used Access for MM2. Is there an equivalent application for MM3's type of database that will allow me to see and edit values directly?
Thanks for any help!
Cheers,
Paula
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
Paula:spacefish wrote:I'm looking for a script that will allow me to decrease playcounts. Will this script do that? I've read that it might be possible but I'm really not following how that could be accomplished. I'm also unclear on what modifications I need to make to the original script, if any.
If there is another, easier method to edit play counts, please point me to it. I understand I could have used Access for MM2. Is there an equivalent application for MM3's type of database that will allow me to see and edit values directly?
Thanks for any help!
Cheers,
Paula
You could try the Change Playcounter script, that is what I use when I want to change playcounts.
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
OMG, that's awesome! And it worked out of the box. Thanks, Nyn!nynaevelan wrote:You could try the Change Playcounter script, that is what I use when I want to change playcounts.
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
-
- Posts: 312
- Joined: Mon Apr 03, 2006 9:11 am
- Location: Denver, CO
Re: Work in progress - Modify Play Counter via script
I see the latest post is from the middle of 2008 and noone responded. I hope this thread is still active.
I installed MM about 9 months ago, I only put a few songs into library so I could play and learn. Now that I am going to keep MM, I want to be able to reset my playcounts before I start filling in the library.
I installed the first script in the thread and inserted the corresponding script in the script.ini file. I can't tell if this works or not. The playcount field in track properties, classification tab does not change when I use Reset Play Counter and press F5. It does change if I use the Set Play Counter script.
I suppose I could use the Set Play Counter to set all songs to 0, but then what is the point for Reset?
As a couple others have posted, which one of the many scripts in this thread are the ones to use?
I installed MM about 9 months ago, I only put a few songs into library so I could play and learn. Now that I am going to keep MM, I want to be able to reset my playcounts before I start filling in the library.
I installed the first script in the thread and inserted the corresponding script in the script.ini file. I can't tell if this works or not. The playcount field in track properties, classification tab does not change when I use Reset Play Counter and press F5. It does change if I use the Set Play Counter script.
I suppose I could use the Set Play Counter to set all songs to 0, but then what is the point for Reset?
As a couple others have posted, which one of the many scripts in this thread are the ones to use?
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
Re: Work in progress - Modify Play Counter via script
RRF:
I am sure you will get many opinions on which is the "best", however I find Bex's AddRemove PlayStats offers the most flexbility and it is one of the most used scripts in my arsenal.
Nyn
I am sure you will get many opinions on which is the "best", however I find Bex's AddRemove PlayStats offers the most flexbility and it is one of the most used scripts in my arsenal.
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Re: Work in progress - Modify Play Counter via script
I second that ^^.
Re: Work in progress - Modify Play Counter via script
I was actually talking about this particular script as it seems there are a couple versions along with other people's modifications. Looks like only the Set Playcount works for me, not the Reset Playcount. Does that mean that this script and AddRemovePlayStats are redundant?
However, I have played with AddRemovePlayStats quite a bit today, along with others, to reset all of my tracks at once (I've been practicing on just artists today), since I will begin to fill my library soon. Looks like AddRemovePlayStats only has a couple actions that change more than one track at a time. I'll have to deal with that.
One other thing. I noticed that MR does not completely agree with the Playing History & Stats node. A couple counts are off by one (not a biggee) but MR has two artists in the top 10 that I wiped out their playcounts.
Does it make sense to reset remove all plays if I reset the playcount? Is that the issue in MR?
Guess I have more to learn about these relationships.
However, I have played with AddRemovePlayStats quite a bit today, along with others, to reset all of my tracks at once (I've been practicing on just artists today), since I will begin to fill my library soon. Looks like AddRemovePlayStats only has a couple actions that change more than one track at a time. I'll have to deal with that.
One other thing. I noticed that MR does not completely agree with the Playing History & Stats node. A couple counts are off by one (not a biggee) but MR has two artists in the top 10 that I wiped out their playcounts.
Does it make sense to reset remove all plays if I reset the playcount? Is that the issue in MR?
Guess I have more to learn about these relationships.