Auto Rating of Songs & Radio Announcer v5.02 [Script]
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
Indeed, "front-door" *is* the way to go.
(other reasons already explained in my previous post)
This will work:
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
(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
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).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
I'll give it a try right aways... Currently trying to reduce the code, and correct some errors done in timing issues.
Old code
and I'll try your so very much appreciated suggestion....
Testing version.
Old code
Code: Select all
REMOVED
Testing version.
Code: Select all
REMOVED
Last edited by DiddeLeeDoo on Fri Apr 14, 2006 9:16 am, edited 4 times in total.
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
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!
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!
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
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
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.
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
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.
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
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. Appreciate the bitching you have. I sort of miss it, it unites...Anonymous wrote: down under the weather ha hah just a joke.
roving cowboy / keith hall.
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...
Well, you can useit would be nice to have the log file stored in the \scripts\ folder
Code: Select all
Dim DataFileLocation
DataFileLocation = """" & SDB.ApplicationPath & "Scripts\AutoRateSongs.dat"""
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).
-
- Posts: 14163
- Joined: Sat Oct 25, 2003 7:57 am
- Location: (Texas)
- Contact:
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.
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.
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.
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!!!
Welcome back Pablo!
Some posts up, I said that Pablo has been away for a long time, well.............. HE'S BACK!!!
Welcome back Pablo!
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
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...
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...
Thanks!!!Steegy wrote: Welcome back Pablo!
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