Auto Rating of Songs & Radio Announcer v5.02 [Script]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

rovingcowboy
Posts: 14163
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy »

confused, just copy the code he updated the one in his message.

i have a question for you

it is working in this winxp it added the 2.5 stars just fine.

but i would like to use it to check for number of plays over a time
frame of 7 days?

where would i change the code and how would i change it to have it check for the number of plays in the last 7 days.?

i do that since i run the computer all the time playing songs with peke's automatic playlists so the songs are all set at random and for different generes every hour so it is very unlikely for me to play the same song more then once in an hour.

it does happen but that is an error in monkey and nobody knows just why it does that?

but with all the playlists of mine having over 15 hours of songs to pick from you can see it really is very unlikely for me to hear the same song in an hour.
some times i don't hear the same song for 3 or 6 days or even 3 weeks.

so a setting of days is better for me and maybe some internet radio stations to have a weekly top of the charts playlist.

but don't change the whole code here as it is nice i just want to know how to adjust the copy i got for my own likes.

thanks.

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

The script should be fine now. I had to do a couple of fixes due to 'Install on a new machine' issues.

Rowingcowboy, the 'time-thing' is in
WHERE (((DateDiff('h',Now(),[Played].[Playdate])>=-1)=True))

That -1 there is like going back one hour in time.

if you set that to -48 hour it will rate according to last couple of days.

To test the script I set the script to -48 so I didn't have to listen to every song here so many times just to test the script :)

Any song that you've listened to twise over the last couple of days will get rating 3.5. That Case area is where number of plays for #stars

Case 1
AR_GRADE = 60
1 play = 3 star

The script can be improved on with options, on/off button and so on. Just have to see how this rating idea work in real life.

Added: I believe only the MM database get updated, not sure if the ID3v2 tag itself get updated. Sure someone here would know?
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

I forgot to mention that it should be possible to rate a whole collection that you've listened to for awhile.

A similar script could check your play history, and rate every song according to repeated plays in a short amount of time.

This could rate every song you've played in full 3 stars, every none rated 2.5 stars, and any repeated over short amount of time get more stars.

This would be cool to use for 'catch up' purposes. I need to get my focus on work, so I cannot do more 'scripting time' before easter.. so addictive this stuff... :o I'll log off now, I will........ LOL..
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Well thats a fair idea, but MM does not track how many of those plays were in a specific time period...

So you could have an old library with alot of plays on certain tracks, but you haven't listened to those tracks but once in a long time.

IE, I played 'artist - track' 100 times, but 99 of those time was over a year ago.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

The script needs to find
-repeated plays over
-period of time
-over whole play history (years ago if so)

Otherwise the script wouldn't be much good. I'll see if I can do the SQL for that later today.
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

thats just it, MM does not track ongoing history, only play count and last played time.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

I just checked my only 9 day old MM database, and it shows a record of almost 1500 songs played. The Song itself do not contain Play history, but there's an other table that is called Played that seems to do a record of what's played over a long period of time.

I deleted my old database 9 days ago, to start fresh. If you have your old one, you should be able to get an interesting rating by a 'catch up' script.

Maybe something to put up as a SQL Easter Puzzle in this scripting forum.

How to find duplicate plays of a song during x time, over the whole Databasee history :)
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

Just a SQL drop. This one finds what songs have been played 3 to 4 times during a 24 hour period in the whole database history. Should be rated 3.5 Stars for example

SELECT Count(Year([PlayDate]) & Month([PlayDate]) & Day([PlayDate]) & [IdSong]) AS ymd, First(Played.IdSong) AS FirstOfIdSong
FROM Played
GROUP BY Played.IdSong
HAVING (((Count(Year([PlayDate]) & Month([PlayDate]) & Day([PlayDate]) & [IdSong]))>=3 And (Count(Year([PlayDate]) & Month([PlayDate]) & Day([PlayDate]) & [IdSong]))<=4));

Should get zero's included in the Day, Month function by the way, to avoid
2006111 2006, Jan 11
to be confused with
2006111 2006, Nov 1
Guest

Post by Guest »

thanks for your hard work you did on this.

and for telling me how to adjust it for my own needs.

how ever your getting carried away with this .

you are talking about doing double scripting for the same thing.

since you said to adjust the hours by making it -48 and that worked for you.

then all one needs to do for longer times is add in larger number of negitive hours. like i am going to make it -168 since that is how many is in 7 days. it will take longer for monkey to check but that is what i want, as in ways of rating for a week.

this combined with the database playlist add in code from steegy to make the weekly playlist will give a fairly profund weekly top of the charts playlist.

roving cowboy / keith hall
not logging in just posting on this.

now stop having fun your at work it is not ment to be fun, it is ment to be work.
:lol: 8)
Guest

Post by Guest »

oh yeah i forgot
the number of plays is fine with me i just wanted it to be spread over a week.

but some one else might want to adjust them. :o

roving cowboy / keith hall.

still not logging in why ? cause i got to go play with the scripts now :P
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

That is one of those very likely improvements that can be done to the script. I'm sort of hoping more experienced scripters may help with improvements. After all this is my first script.. :roll:

Not sure how it will work over a long past though. Guess if you play a track 3 times a week it deserves a rating greater than 2.5 Stars.

Edit: Removed an incorrect statement, a bit complex this stuff

Glad a discussion about it is going though, as I also would like it to check further back in time.
Last edited by DiddeLeeDoo on Wed Apr 12, 2006 2:50 am, edited 1 time in total.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

Here's a version of the AutoRateSongs.vbs that make it a bit easier to set hours to go back. Set hours as you think fit.

Plus if you play it more than 5 times in this period, it qualify for 5 star.

Code: Select all

REMOVED
Last edited by DiddeLeeDoo on Wed Apr 12, 2006 10:09 pm, edited 1 time in total.
Guest

Post by Guest »

you did more work before i could come back with a beta report?

:o

i been playing for awhile now on my win98 it works fine except one thing i found that is a big bug.

1. it will not work properly with other window scripts.

2. if i run a windows script that is made to run all day and it uses an Non media monkey related program. such as the msagents., i have a vbs script that is run by winscripts that keeps a msagent on screen all day just sitting there playing his guitar making it look like he is playing the music.

3. when i run that script and this auto rate script runs. there are multiple windows scripts showing up in the task manager. i found that out because it was so full it crashed monkey. and the computer.

4. upon some investigation i found that the auto rate script is killing the winscript and starting it again. making two of the same winscript running at the same time.

5. it does this with any program that uses win scripts also.
which can make for tons of winscripts running at once which is what crashed my system.

how do you get it to stop this i do not know. as it only does it with winscripts if i don't use any winscripts it works fine. so i am thinking that the best way to describe the error would be that

" Autorate does not play nice with winscripts "

6. i have found that the best way to get an over all rating for number of plays is to use the script to change the play counter and the last time played date.
the script is at this url.

http://www.mediamonkey.com/forum/viewto ... sc&start=0

but there are so many update posts in that thread i am not sure which i have. but i think it is now included as a default install in monkey.?

but if there were a way to get this playcount script to run once a week on any day and at a certain time and select all the songs and reset them to zero play count that would be great as that would be making the rate beset from a zero count every week.

i'll just keep doing it manualy until some one can figure that out.


7. I have not seen if anything about the auto playlist closing and restarting causes anything Yet. but it is the first couple hours of testing this for you.
so give me time and i will see what it does over the whole day.


roving cowboy / keith hall.
not logged in just wanted to report on this.
Guest

Post by Guest »

8. just changed playlists and had no trouble with it. so that works.

roving cowboy / keith hall.

had to do another post because i did not log in 8)
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

Thank you very much for the report rowing cowboy

It may be that trigger that stuff things up. That one is quite 'heavy duty'

I just saw Jiri wrote something about detecting new song playing, and I'll see if I can get the autorate system to work just by itself, without the trigger.

Simple is KING!!..

Added: OnTrackProperties seems to be the keyword... need to do some reading..
Post Reply