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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Postby DiddeLeeDoo » Thu Apr 13, 2006 11:46 pm

Tried that, (you'll find how a bit back in this thread)
But it becomes very annoying seeing the screen jump like that after each song. Would be so nice to target that one song only, and ensure that it get updated using the 'front-door'.... it's sort of a 'back-door' operation at the moment.
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby Steegy » Fri Apr 14, 2006 3:47 am

Indeed, "front-door" *is* the way to go.
(other reasons already explained in my previous post)

This will work:
Code: Select all
            Dim MySongIter, MySong, strWhere
            strWhere = "AND Songs.ID=" & LastSongsID
            Set MySongIter = SDB.Database.QuerySongs(strWhere)
            If Not MySongIter.EOF Then
                Set MySong = MySongIter.Item
                MySong.Rating = 50
                MySong.UpdateDB
            End If

I forgot that the QuerySongs function returns a SDBSongIterator object, not a SDBSongData object.
To get the SDBSongData object from the iterator, you have to use .Item
So "songdata = songiterator.Item"
(it's all in the scripting reference, if you were wondering how I knew that)

What the code does:
-Declaring the variables (using Dim)
-Using QuerySongs, getting the SDBSongIterator object, filled with all SDBSongData objects that suit the strWhere condition(s).
-Check if there is an entry in the iterator (in this case, check if there really was a song with ID = LastSongsID) so there will never be an error if you supply a wrong LastSongsID.
-Get the current (first and only) SDBSongData object from the iterator (using .Item), and call it MySong.
-Change the rating for the song's object.
-Let MM update the database (and internal data and GUI and file tags).
(make sure you understand every line of code you write)

BTW: Pablo hasn't been seen here for months, so probably he won't respond to your message anymore. (It's him that wrote the MagicNodes script, now becoming out-of-date).

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3448
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby DiddeLeeDoo » Fri Apr 14, 2006 4:21 am

I'll give it a try right aways... Currently trying to reduce the code, and correct some errors done in timing issues.

Old code
Code: Select all
REMOVED


and I'll try your so very much appreciated suggestion....

Testing version.
Code: Select all
REMOVED
Last edited by DiddeLeeDoo on Fri Apr 14, 2006 9:16 am, edited 4 times in total.
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Fri Apr 14, 2006 4:34 am

YAAAAAAAAAAAAAHHHHHHHHHOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


:D :D :D :D :D :D :D :D :D :D :D :D

There's a very happy boy 'down under' at the moment.

Thank you STEEGY!!!!!!!!!

I'll write a new version right aways.........
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby judas » Fri Apr 14, 2006 7:19 am

Love it...congrats DiddeLeeDoo...and thx steegy!

judas

EDIT: What happened to the %played thing? :-)
judas
 
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Postby DiddeLeeDoo » Fri Apr 14, 2006 7:27 am

I removed the 'played percentage in the version above'

That may have been a mistake.

Situation;
Stop playing a song in the middle of the song.
Start playing another song later...

The current version above will believe that you skipped that stopped song, so I need to get in that percentage thing in again... Version above is just a testing project. You'll see the cool screen update Steegy is responsible for.. What a gem!
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby judas » Fri Apr 14, 2006 7:59 am

yah....i noticed the update...its beautiful allthough i can't appreciate the beauty of the code itself :-(

cheers
judas
 
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Postby Guest » Fri Apr 14, 2006 8:52 am

so ya down under are ya?

thats were a lot of people are this time of the year.

down under the weather ha hah just a joke.

will see what this new script is like i will put it on this xp. and test here first :lol:

roving cowboy / keith hall.
Guest
 

Postby DiddeLeeDoo » Fri Apr 14, 2006 9:31 am

Here it goes, a new version to test.

Installation procedure:
That is, if you haven not tried one of the earlier versions.
If you already did the scripts.ini section, you just replace text in the
AutoRateSongs.vbs file


Exit MM

Edit \scripts\scripts.ini file
Add section

Code: Select all
REMOVED


Then the script, should be \Scripts\AutoRateSongs.vbs
Note: There are some options (parameters) there to
consider/modify, and then you forget about it, and see
your collection get rated as you go.


Code: Select all
REMOVED
Last edited by DiddeLeeDoo on Mon Apr 17, 2006 7:17 am, edited 2 times in total.
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Fri Apr 14, 2006 10:15 am

Anonymous wrote:down under the weather ha hah just a joke.
roving cowboy / keith hall.


The weather is too nice. When living in north europe, we could at least bitch and complain about the weather. You cannot down here. A weird change really. People are too nice too, friendly all the time. :wink: Appreciate the bitching you have. I sort of miss it, it unites...

Anyways, hope the script works out. May have bugs, and have no fancy option sheet at the moment. I plan to just lay back a bit, and take a break from this and just see it do the ratings. (bit tired I guess, it's very dark here at the moment) A million thanks to Steegy! I tried to figure out how to get that update to screen to work, but that was not that easy to figure out...

I welcome any improvements from anyone. Like it would be nice to have the log file stored in the \scripts\ folder and other stuff. It may even have bugs. Time to test I guess. The script only touch the rating field by the way, and should behave well together with other stuff...
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby Steegy » Fri Apr 14, 2006 10:40 am

it would be nice to have the log file stored in the \scripts\ folder

Well, you can use
Code: Select all
Dim DataFileLocation
DataFileLocation = """" & SDB.ApplicationPath & "Scripts\AutoRateSongs.dat"""


BTW: To natively use a " in a string, you have to double it. You can also insert it with the method Chr(34) (I'm not sure about the 34).


Actually, it's a data file, and not a log file. For that, if you would move the file to the Scripts folder, please also change the extension to .dat
One of the reasons is that log files just contain logs (unneccessary information), they are almost never used as data. Log files can get deleted by "hard disk cleaners" and similar software (that delete all *.log files), and that would mean that your data file would be gone too...

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3448
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby rovingcowboy » Fri Apr 14, 2006 10:42 am

well i came to say WOW i did not want the auto refresh or think that i needed it but it sure is nice to sit and watch it change on the playlist and on the now playing playlist..

will put it on the 24/7 computer in a few minutes.

great job of it i don't see anything that will make any errors show up for me but that can always change you know. :roll:
roving cowboy / keith hall. My skins viewtopic.php?f=9&t=16724 for some help check on Monkey's helpful messages at viewtopic.php?p=44008#44008 MY SYSTEMS.1.Xp pro sp3, vers 3.2 jukebox, pcchips mb. amd sem... built by me) 2.WinXP pro sp3, vers 2.5.5 and vers 3.2 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.WinXp pro sp 3 version 2.5 and version 3.2 work gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 4.Dell demension, winxp pro sp3, mm3.5 spare jukebox. 5.WinXp pro sp3, vers 2.5.5, moms computer. Sony vaio.)6. Motorola Photon. Android 4.1.2
rovingcowboy
 
Posts: 13399
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)

Postby Steegy » Fri Apr 14, 2006 10:55 am

Off-topic but here it comes anyway:

Some posts up, I said that Pablo has been away for a long time, well.............. HE'S BACK!!! :D

Welcome back Pablo!
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
 
Posts: 3448
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium

Postby DiddeLeeDoo » Fri Apr 14, 2006 6:35 pm

Good to see Pablo is back!

I do not know the history there, but if he was one of those real major resources of knowledge, maybe his brain got picked dry ?

Anyways, I just discovered a timing issue. Like when do MM really register a song to be played. It seems to be at the 50% mark or something like that. So if you find a song to no be degraded even if skipped at 60% that may be the reason.

Just something to be aware about.

Next version will certainly get a .dat file. A very good idea, and the .dat should be together with the script.

Just need to give it a break and give it some testing, as those things are not really critical. Updating the database/screen was critical, and I've just had the best night sleep, knowing that was fixed.!

Need to play catch-up with life, so today I plan just playing music, and get on with life.... sure to be back when catch-up is done...
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby Pablo » Fri Apr 14, 2006 6:45 pm

Steegy wrote:Welcome back Pablo!


Thanks!!! :D

I think Jiri said that the play counter is increased after a third (or 30%) has played.

I'm still catching up with all the great new scripts. I'll probably give this one a pass because there are many songs I love and give a high rating but I only listen to in some special occasions/moods. So even though I don't listem to them that often and skip them, I still want them to keep their high rating. But this is a cool script!

My scripting skills are definitely rusty :wink:
Pablo
 
Posts: 554
Joined: Sun Feb 22, 2004 2:59 am

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 30 guests