INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Create one playlist per album in the folder where the media is located  (Read 4119 times)

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118

Hi, i have around 1000 cd albums .. each of them ripped as flac and as mp3 and stored in its own folder as subfolder of album artist with a Folder.jpg file for the cover art.  So all is pretty neatly structured.

I now would like to create (automatically) one playlist per album and store that playlist in the same folder where the files files are located

The name of the playlist must be set to   [album artist] - [album]

1) how can i do for all my albums automatically ?

2) what would be most generic format .. i guess m3u ?

thx koen
Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #1 on: January 08, 2014, 02:39:31 pm »

any ideas ?

reg koen
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #2 on: January 08, 2014, 04:13:09 pm »

There's no automated way in MC to do this.  MC's playlists are stored in the Library, in an MC-specific format.  While MC can read external playlists, or export playlists to external files, it doesn't store them externally.

An m3u playlist is just a text file listing the file paths of the files.  This could be generated via a script easily enough from the folder contents.  The paths in the playlist could be relative, so that the playlist would still be value should the folders be renamed.  Again though, MC won't use them by default, but could auto-import them.  I think you'll end up with a very large list of playlists under Playlists > Imported Playlists.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #3 on: January 09, 2014, 06:35:25 am »

 ok thx.. i can export multiple albums but the result is 1 big playlist .. it would at least be nice if one could create at least one playlist file per album and also be able to influence the name of that file _e.g.   [album artist] - [album].mpl   etc

thx koen
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #4 on: January 09, 2014, 11:33:11 am »

If you are willing to install / use this, I'll create your a scriptlet:

    http://yabb.jriver.com/interact/index.php?topic=85990.0

btw. I'm just a user like you.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #5 on: January 10, 2014, 03:22:29 am »

hi great .. definitively want to do that .. do you need more refined specs ?

thx koen
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #6 on: January 10, 2014, 12:32:16 pm »

I think it should be easy enough.  I was thinking you wanted m3u playlists - do you need mpl?

  - the created playlists will be m3u (or m3u8 or mpl).
  - paths will be relative to the playlist path (so that you can transfer the directory)
  - if you need to indicate which file types you want as part of the playlist, I can add an option to support file types (let me know if this is required; otherwise, I'll assume the standard audio types which you can supplement as necessary).
  - the playlists will be named [album artist] - [album], but I'm thinking you'll create an expression column in the view that is the label used as the playlist name (that way, it is independent of the scriptlet, and you can change how the playlists is named easily within MC).
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #7 on: January 10, 2014, 12:52:20 pm »

hi . m3u is ok.. i have several file types  such as flac . mp3 . jpg . avi etc

thx in advance
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #8 on: January 10, 2014, 08:44:40 pm »

So this brings another question - do you want to create a view that contains all the items you want in the playlist, or do you want the script to simply crawl the folder structures and create a playlist from everything it finds in each folder?

With the former, you'll need all the file types imported and the view must show all the file types you want included.

With the later, an easy script can just recursively create playlists from the contents of the folders, but to be fast, it would need that your folder names contain the Album Artist and Album names so they can be grabbed from the paths.

I have this currently, which uses the view to drive the contents of a playlist (example debug output):

do_postprocessing: make playlist file: Lindsey Buckingham - Under the Skin.m3u
do_postprocessing:      adding Track: ./07 Cast Away Dreams.mp3
do_postprocessing:      adding Track: ./08 Shut Us Down.mp3
do_postprocessing: make playlist file: Lisa Gerrard - Duality.m3u
do_postprocessing:      adding Track: ./02 Tempest.mp3
do_postprocessing:      adding Track: ./09 Sacrifice.mp3
do_postprocessing: make playlist file: Louie Shelton - Hot and Spicy.m3u
do_postprocessing:      adding Track: ./10 Love Mystifies.mp3
do_postprocessing:      adding Track: ./11 Love Mystifies.mp3
do_postprocessing: make playlist file: Louis Armstrong - Greatest Hits.m3u
do_postprocessing:      adding Track: ./03 St. Louis Blues.mp3
do_postprocessing:      adding Track: ./04 Basin Street Blues.mp3
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #9 on: January 13, 2014, 03:18:47 pm »

A little bump on the question above...
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #10 on: January 13, 2014, 11:26:57 pm »

hi, sorry i could not respond earlyer. Actually i would like to end up with a playlist in each folder that contains either audio or images. All my folder names are containing the required info. However i wonder how you will define the correct order of the playlist from there ... not sure if every file has the track number in its name... images might have different sequence numbers .. so how to define the order ? 
some albums are in one folder but occasionally i see (especally various artist albums) being ripped to multiple folders ..   in the database these are alll pretty neatly structured..
so i would say that the script must traverse the database and not the folder structure.
i have flac, mp3 and wav as audio and jpg as images

thx koen
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #11 on: January 13, 2014, 11:40:36 pm »

Given that, we'll go the view route.  You'll define a view to include the files you want, sorted the way you want, and the playlist will be created based on an expression column you create. Since files might cross directories,  paths will be full paths.

I'll have this for you tomorrow.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #12 on: January 14, 2014, 12:05:18 am »

super. i already have have those views .. plse let me know if i have to install something ?

reg koen
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #13 on: January 14, 2014, 01:32:32 pm »

I've updated the pscriptor code to version 1.04, which includes the scriplet you need:

    http://yabb.jriver.com/interact/index.php?topic=85990

The command line you'll use is:

  perl pscriptor.pl  -c pscriptor-config.txt  -f "Playlist Name" -E MakePlaylist

Be sure that the column Playlist Name is in the view.  It is an expression column that defines the name template of the playlist, such as:

   [album artist (auto)] - [album]

The instructions in the thread above, the README.txt and the comments in the Scriptlets\MakePlaylist.pm should give you what you need, but feel free to ask questions specific to this scriplet here.

Note 1: you mentioned there might be files from different folders being grouped into a view.  The scriptlet uses the first item in the view grouping (as defined by the Playlist Name expression) as the basis for the folder where the playlist will be created.  If you need something different, let's discuss it.

Note 2: If you are using mixed file types, and these file types are not all consistently tagged (e.g. cover art which isn't tagged with the fields used in Playlist Name), you'll have to use something else the files have in common, like your folder names (which can be accessed with FileFolder(,0) and FileFolder(,1), etc.)
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #14 on: January 15, 2014, 08:31:13 am »

hi, i will try to get this up and running.. thx
Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #15 on: January 15, 2014, 12:49:23 pm »

hi this really works great !  since i have both a flac and mp3 version of every album i have added file type also to the name of the playlist but due to the expression column (i did not know that feature before) it was pretty easy to do


i only had one issue when i tried to run the import from the "desktop" folder in . it complained that it could not find the MakePlaylist file ..through @INC .. 

when i started the import from the pscriptor directory i had no issue     

thx !!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #16 on: January 15, 2014, 01:02:07 pm »

Thanks for the feedback.

Sorry about the problem with @INC issue.  I'd forgotten to update the directions to account for the changes I made to the script that look for the scriptlets in the Scriptlets directory.  It will probably be easiest to suggest that the entire pscriptor folder be placed on the Desktop (or elsewhere) and run from there.  I'll update the instructions.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #17 on: January 15, 2014, 02:26:36 pm »

i experience some issues with albums that have some special chars in their name or path ... could it be the case that not all chars are allowed  and some chars might fail the regex ?

M:\cd\cd - mp3\cd - mp3 - green day\cd - mp3 - green day - ¡uno! - 2012 09 25\

M:\cd\cd - m4a\cd - m4a  - triggerfinger\cd - m4a  triggerfinger - i follow rivers - 2012\

Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #18 on: January 15, 2014, 02:32:07 pm »

the second one has the following album name   :   

I Follow Rivers (Live @ Giel! - VARA/3FM) - Single



i guess the "!"    is the reason ?

Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #19 on: January 15, 2014, 03:52:27 pm »

The problem is mine.

The OS-specific modules I use to grab data from the clipboard handle encoding / decoding of characters differently.  It works fine on the Mac, where I test, but on Windows, the encoding is broken.  I'm looking into it now.  Hold tight...
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #20 on: January 15, 2014, 05:44:19 pm »

Here's a new version of the scriplet.  If you unzip and install it into the Scriplets folder, and test it out, it should fix the problem.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #21 on: January 15, 2014, 11:50:34 pm »

ok thx, will do that later today

ps.. in your instructions i would not suggest to place and run the whole thing from the "desktop" "folder"  but just propose to place the pscriptor folder directly in the root (c:) or a user tbd location but just mention to kickoff the process from there... personally i like my desktop to be "clean"

also add that you have to INSERT / ADD this   "playlist name" column in the view (since its not in the standard list of columns to add.) . and plse add yhe fact that you must create the expression to reflect how you want your playlist to be named .. and that the expression can be editied when clicking right in the header


thx koen
Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #22 on: January 15, 2014, 11:56:50 pm »

.. and maybe its an idea to add in the readme.txt  file  a small description per scriptlet of the prereqs (such as create in your view an expression column named "Playlist Name" with expression reflecting the name you want assigned to the playlist ... the command to run the scriptlet  .. and the purpose ..

or add this info the the comments/header  in the scriptlet itself (which already contains the purpose)

thx koen

Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #23 on: January 16, 2014, 07:30:50 am »

it also fails over ? .. rest seems ok

reg koen

Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Create one playlist per album in the folder where the media is located
« Reply #24 on: January 16, 2014, 11:16:30 am »

it also fails over ? .. rest seems ok

The ? character, along with a few other characters are illegal filesystem characters.  Try renaming a file in Windows with a ? and you'll see the list.

You should probably add Clean() with mode 3 around your expression, or I can do the same job internally.
Logged
The opinions I express represent my own folly.

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #25 on: January 16, 2014, 11:49:17 am »

actually it was this one

¿

reg koen
Logged

kdwykleingeld

  • World Citizen
  • ***
  • Posts: 118
Re: Create one playlist per album in the folder where the media is located
« Reply #26 on: January 16, 2014, 12:04:18 pm »

forget prev post .. that char was in the file name but it was indeed the question mark that did not workout .. i changed the name
Logged
Pages: [1]   Go Up