Automatically change Genre?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Automatically change Genre?

Re: Automatically change Genre?

by oddity » Thu Aug 12, 2010 12:00 am

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?

by Hairback357 » Mon Dec 04, 2006 1:30 am

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

by trixmoto » Mon Nov 20, 2006 6:58 am

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

by jkimrey » Sat Nov 18, 2006 10:05 am

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!

by trixmoto » Thu Nov 16, 2006 4:40 am

"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

by jkimrey » Wed Nov 15, 2006 8:31 pm

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!

by Bex » Wed Nov 15, 2006 6:58 pm

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

Edit, that shouldn't matter...

by jkimrey » Wed Nov 15, 2006 6:56 pm

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.

by trixmoto » Wed Nov 15, 2006 5:11 am

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.

by Guest » Tue Nov 14, 2006 9:01 pm

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! :)

by Lowlander » Tue Nov 14, 2006 10:02 am

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

by trixmoto » Tue Nov 14, 2006 5:23 am

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! :)

Automatically change Genre?

by jkimrey » Mon Nov 13, 2006 10:07 pm

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!

Top