Automatically change Genre?

Get answers about using MediaMonkey 4 for Windows.

Moderator: Gurus

jkimrey
Posts: 8
Joined: Mon Nov 13, 2006 10:02 pm

Automatically change Genre?

Post by jkimrey »

Hi.

I'm trying to download podcasts from Juice into my Creative Zen Vision M.

For odd reasons that we shall not discuss here, the Zencast software from Creative converts all audio podcasts to video files, thereby forcing the screen on at all times, as well as not allowing bookmarking.

I can use Juice, but I'm looking for an easy way to only select podcasts from my other music files. I can choose genre as Podcast, but unfortunately not all of them have this field populated, while other feeds have it populated with 'spoken word', etc.

Will MediaMonkey allow me to automatically change the genre for all of the files to 'Podcast'? I'd like it to run (maybe a script?) and update the tag for any files in a specific directory with genre = "Podcast".

Is there any way to do this automatically?

Thanks!
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

If they are in a specific directory you can just use the Location node to find that folder, select all of the songs, right-click and select properties, then change the Genre field to "Podcast" and hit OK. No script necessary! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Lowlander
Posts: 58892
Joined: Sat Sep 06, 2003 5:53 pm

Post by Lowlander »

Or use the Auto-Tag from Filename if filename or directory contain the name podcast.
Guest

Post by Guest »

Thanks for the info.

Is it possible to use this method and have it work each time? For instance, some of the podcasts download daily. Would I have to do this each time, or only once?

I'm new to MM, but from what I've seen, it's awesome. In fact, I'm going to purchase right now!

Thanks again!
trixmoto wrote:If they are in a specific directory you can just use the Location node to find that folder, select all of the songs, right-click and select properties, then change the Genre field to "Podcast" and hit OK. No script necessary! :)
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

This should be possible with a small auto-script.

Create a textfile called ..\MediaMonkey\Scripts\Auto\AddPodcast.vbs and paste in the following code...

Code: Select all

Sub onStartup
  Script.RegisterEvent SDB, "OnTrackAdded", "AddPodcast"
End Sub

Sub AddPodcast(track)
  If InStr(UCase(track.Path),"\PODCAST\") > 0 Then
    track.Genre = "Podcast"
    track.UpdateDB
  End If
End Sub
You'll need to correct the folder name of your podcasts in the script for this to you. Then start MM, scan for some new podcasts and see if it works.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
jkimrey
Posts: 8
Joined: Mon Nov 13, 2006 10:02 pm

Post by jkimrey »

Trixmoto,

It doesn't appear to be doing anything. Here's what I've done:

I set MM to scan the folder C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts. This is my folder that Juice is downloading the podcasts to.

I then went to file/clear library. This removed the podcasts from the MM library. Then I chose to scan for new files. The podcasts showed up in the MM library, but the Genre was not 'Podcast' for all of them; some of them still had 'Other'.

To try things out, I just put a simple msgbox command, and it doesn't seem to be executing either when files are scanned into the MM library.

Here's the actual code that I pasted in the /Auto directory as 'AddPodcast.vbs':

Code: Select all

Sub onStartup
  Script.RegisterEvent SDB, "OnTrackAdded", "AddPodcast"
End Sub

Sub AddPodcast(track)
  If InStr(UCase(track.Path),"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts") > 0 Then
    track.Genre = "Podcast"
    track.UpdateDB
  End If
End Sub
Of course I restarted MM after creating this file and before clearing the library. My version of MM is showing as 2.5.4.978.

Any other suggestions? This is driving me CRAZY!

Thanks!

trixmoto wrote:This should be possible with a small auto-script.

Create a textfile called ..\MediaMonkey\Scripts\Auto\AddPodcast.vbs and paste in the following code...

Code: Select all

Sub onStartup
  Script.RegisterEvent SDB, "OnTrackAdded", "AddPodcast"
End Sub

Sub AddPodcast(track)
  If InStr(UCase(track.Path),"\PODCAST") > 0 Then
    track.Genre = "Podcast"
    track.UpdateDB
  End If
End Sub
You'll need to correct the folder name of your podcasts in the script for this to you. Then start MM, scan for some new podcasts and see if it works.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

Dont you miss a \ in the end of your path in your script?

Edit, that shouldn't matter...
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
jkimrey
Posts: 8
Joined: Mon Nov 13, 2006 10:02 pm

Post by jkimrey »

I noticed that when I view the file (created in notepad) it shows as a text file.

However, when I view the scripts located in the MM directory (not the /auto directory), the files are showing as 'VBScript Script File'.

Could this be the problem? How would i get the notepad doc saved in the /auto folder as a script file?

Thanks!
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

"VBScript Script File" is the correct description for this type of file. You can simply cut'n'paste the file from the Scripts\ folder to the Scripts\Auto\ folder.

Also, if you are entering the full path correctly then you should remove the "UCase" function as this uppercases the filepath, like this...

Code: Select all

If InStr(track.Path,"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts") > 0 Then
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
jkimrey
Posts: 8
Joined: Mon Nov 13, 2006 10:02 pm

Post by jkimrey »

Thanks; that worked.

Now I'm trying to add functionality to add a track.artist if inserted from a specific directory; this podcast does to populate the artist field.

I'm getting an error when I try to run this:

Code: Select all


Sub onStartup 
  Script.RegisterEvent SDB, "OnTrackAdded", "AddPodcast" 
End Sub 

Sub AddPodcast(track) 
If InStr(track.Path,"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts") > 0 Then
    track.Genre = "Podcast" 

    If InStr(track.Path,"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts\XYZ") > 0 Then 
       track.Artist = "XYZ"
    End If
  
    track.UpdateDB 

End If 
End Sub

Any help? Thanks!
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

track.Artist is not a string, but a property of type "SDBArtist". Try something like this...

Code: Select all

Sub AddPodcast(track)
  If InStr(track.Path,"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts") > 0 Then
    track.Genre = "Podcast"
    If InStr(track.Path,"C:\Documents and Settings\Compaq_Administrator\My Documents\My Music\My Received Podcasts\XYZ") > 0 Then
      track.ArtistName = "XYZ"
      track.UpdateArtist
    End If
    track.UpdateDB
  End If
End Sub
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Hairback357
Posts: 1
Joined: Mon Dec 04, 2006 1:28 am

Post by Hairback357 »

This worked sweet for me but I was wondering if it could be modified to always no matter what in in the artist field to change it to what I want. It now only changes it if the field is blank.


Thanks
oddity
Posts: 7
Joined: Tue Jun 17, 2008 11:02 pm

Re: Automatically change Genre?

Post by oddity »

I know this is a really old post...

but i am looking to try and do the same thing (automatically retag files in particular directory to a specified genre when MM starts).

Is there now a better way to do this?

I tried the method above but it does not work for files that are in subdirectories under the path listed in the script file.
Is there a way to change the script so that it will work for subfolders?
Post Reply