Modified ExportM3U.vbs

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

wolfzell
Posts: 155
Joined: Fri Apr 23, 2004 8:42 am
Location: Germany

Post by wolfzell »

trixmoto wrote:There is a script that is shipped with MM called "ExportM3Us" - use that to do many at once.
Just tested it and it does not work for me.

I don't understand why, but if I am exporting a single playlist into my mp3-folder, the entries look like that:

#EXTINF:174,Tuck & Patti - As Time Goes By
Tuck & Patti\Dream\11 - Tuck & Patti - As Time Goes By.flac

That is perfect. I am moving those files to two other computers, both having other drive letters (or paths before the mp3-directory), so relative paths are exactly what I need.

But now look at what happens, if I am using ExportM3U to the same directory:

#EXTINF:174,Tuck & Patti - As Time Goes By
D:\MP3\Tuck & Patti\Dream\11 - Tuck & Patti - As Time Goes By.flac

Absolute paths now. This way ExportM3U is rather useless for me. Hm. I would rather not try to reactivate my batch knowledge and write some batches to correct those files.

Is there a way to change ExportM3U to get playlists with relative paths?

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

Post by trixmoto »

Relative to what? That's the trouble!
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.
wolfzell
Posts: 155
Joined: Fri Apr 23, 2004 8:42 am
Location: Germany

Post by wolfzell »

Sorry, I thought it was obvious: Relative to the place where the m3u-files are stored.

When I create a m3u-file via context-menu "Send to m3u-Playlist", MM does exactly that. Then I only need to choose the place where the playlist should be stored to and the paths are relative to that place.

So if I have C:\MP3\Artist\Album\Title.flac and choose C:\MP3 as place to store the list using the context-menu, the entry looks like this:

Artist\Album\Title.flac

That way it does not matter, where MP3\... is actually located.

When exporting all playlists using the ExportM3U script, the entries look like this:

C:\MP3\Artist\Album\Title.flac

Now if I move that m3u file to another system where the MP3 directory is on the G: drive, it is clear that no entry can be found.

Now is it possible to change the script ExportM3Us so the entries in all playlists will be relative to the directory where the m3u-files are stored just the same as when exporting single playlists?

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

Post by trixmoto »

This is not too hard if you are using your example, as this just means removing the m3u path from the mp3 path. However, if your m3u path is...

C:\MP3\

And your mp3 path is...

F:\Music\test.mp3

Then this is not possible. I'll see what I can do but I'll split this into a new thread if that's ok, as this is now a different script we're working on.
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.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Here it is, modified to output relative paths, unless it cannot find one...

Code: Select all

See below
Last edited by trixmoto on Fri Oct 20, 2006 7:18 am, edited 1 time in total.
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.
wolfzell
Posts: 155
Joined: Fri Apr 23, 2004 8:42 am
Location: Germany

Post by wolfzell »

Trixmoto, YOU ARE THE MAN!

This works like a charm. Absolutely wonderful.

I made a little change though, to keep the original ExportM3Us (You never know...), I changed the name of the script, variables and subroutines from ExportM3Us to ExportM3Ur (r for relative) and changed the script.ini according to that. Here are the relevant parts:

Script.ini add-on:

Code: Select all

[ExportM3Ur]
FileName=ExportM3Ur.vbs
ProcName=ExportM3Ur
Order=12
DisplayName=All Playlists relative (&M3U)
Description=
Language=VBScript
ScriptType=1
Changed script:

Code: Select all

Trixmoto: see below
wolfzell
Posts: 155
Joined: Fri Apr 23, 2004 8:42 am
Location: Germany

Post by wolfzell »

trixmoto wrote:This is not too hard if you are using your example, as this just means removing the m3u path from the mp3 path. However, if your m3u path is...

C:\MP3\

And your mp3 path is...

F:\Music\test.mp3

Then this is not possible.
Well, of course. Did not think of that, because before I did not know of ExportM3Us.

So when I was using the contextmenu function to export single playlists it was working just like I wanted it to with the relative paths, so I have always been exporting my playlists to the MP3 path.

It only has been a drag to export every single playlist this way. Now with this script, that is history. Thanks again!

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

Post by trixmoto »

I'm glad this is working for you. I've remove my code to avoid confusion! :D
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.
monitoringpost
Posts: 48
Joined: Sun Oct 08, 2006 12:43 pm

Post by monitoringpost »

I have another suggestion for this script. Like a poster in another thread I have just integrated a Roku SoundBridge into my stereo system. This script works great for exporting all the playlists as it's designed. With the ability to enter the path to export M3U's to one can select a path that the media server for the SounBridge scans. All great so far...

It comes apparent though in these circumstances that those playlists that are dynamic remain present in the selected folder even though they may no longer exist within MM. How difficult would it be Trix or others if some sort of synchronization could be incorporated into the script so that when a user chooses to export that either the M3U's resident in the folder are deleted before the script exports OR that a comparison of sorts is made and M3U's are added/deleted or updated as the case may be.

Sorry for the long preamble but I just wanted to substantiate why I thought the added functionality might be warranted. Currently I'm manually deleting the M3U's resident in the folder before exporting a fresh set. Maybe this could be automated for when MM starts!

Looking forward to your comments.

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

Post by trixmoto »

Synchronisation I think would take a long time as it would mean creating all the playlists in a temporary folder, and then trying to compare them line by line. It would be much easier to simply automate the deletion of the old playlists.

Using your modified script, lines 61-63 are...

Code: Select all

  ' Connect to the FileSystemObject
  Dim fso
  Set fso = SDB.Tools.FileSystem
After these add the following line...

Code: Select all

  Call fso.DeleteFile(path&"*.m3u")
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.
Guest

Post by Guest »

Trix, I just set-up a NAS server (see signature) and I'm finding the relative export path for some reason isn't being picked-up as in

\\Mss-hdd\Public\Our Music\Rod Stewart\Greatest Hits\Rod Stewart - Maggie May.mp3

whereas, using MM's export under > File > Export to Playlist... creates

..\Rod Stewart\Greatest Hits\Rod Stewart - Maggie May.mp3

works!

I'm storing all my playlists in subfolder:

\\Mss-hdd\Public\Our Music\Playlists

Would you mind editing a version that will format the path as:

..\<Album Name>\<Album>\<Artist> - <Title>

please! Or tell me if I'm using the script wrong as you intended.

Thanks!!
_________________
Roku SoundBridge M1001 v2.5.171
NAS: Maxtor SS+ v2.6.2-openmss1-rc2
Server: Firefly svn-1433
Router: Linksys BEFW11S4 v2
MediaMonkey v2.5.5.983

... and one kick ass rig!
monitoringpost
Posts: 48
Joined: Sun Oct 08, 2006 12:43 pm

Post by monitoringpost »

Darn, forgot to log in before post this last message.
Roku M1001 v3.0.52 beta | R1000 v3.0.52 beta
XBMC vPre2.1 SVN rev13360
NAS: Maxtor SS+ v2.6.2-openmss1-rc2
Linux Server: Firefly svn-1586-1 mipsel pkg
Router: Linksys WRT54GS
MediaMonkey v3.2.5.1306 | iRock Remote on iPhone
... and one kick ass rig!

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

Post by trixmoto »

At the moment this script does not calculate the relative path, it just allows one if the tracks are in the same folder as the playlist. I'll add this to the next version though. :)
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.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Ok, here's a fully relative version...

Code: Select all

See below
Last edited by trixmoto on Tue Nov 28, 2006 4:19 am, edited 1 time in total.
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.
monitoringpost
Posts: 48
Joined: Sun Oct 08, 2006 12:43 pm

Post by monitoringpost »

Hi Trix,

Thanks for the quick reply. Tried the modified script this morning and it appears to hang at the point where the path to the track is created/written. I had to terminate MM through task manager.

Upon examination it created the playlist file and the contents where just:

Code: Select all

#EXTM3U
#EXTINF:368,The Rolling Stones - (I Can't Get No) Satisfaction (Live)
which would be the first track in the first playlist.

Hope you can sort it out!
Roku M1001 v3.0.52 beta | R1000 v3.0.52 beta
XBMC vPre2.1 SVN rev13360
NAS: Maxtor SS+ v2.6.2-openmss1-rc2
Linux Server: Firefly svn-1586-1 mipsel pkg
Router: Linksys WRT54GS
MediaMonkey v3.2.5.1306 | iRock Remote on iPhone
... and one kick ass rig!

Image
Post Reply