Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative path names inside m3u playlists : possible ?
19-10-2016, 23:07
Post: #1
Relative path names inside m3u playlists : possible ?
I have minimserver configured on a Win10 platform to read media files (contentDir) from the following absolute paths on a portable USB drive:
M:\mu\fla (holds .flac files)
M:\mu\dsd (holds .dsf files)
M:\mu\playlists (holds .m3u playlists)

Each of those directories can hold nested subdirectories.

A typical .m3u playlist reads as follows.

File full path name:
Quote:M:\mu\playlists\Composers\Abel, Carl Friedrich\Abel - The Drexel Manupscript - Pandolfo.m3u

File contents:

Quote:M:\mu\fla\Pandolfo, Paolo\Abel- The Drexel Manuscript\01 Abel- The Drexel Manuscript - Suite in D major -1. Prélude.flac
M:\mu\fla\Pandolfo, Paolo\Abel- The Drexel Manuscript\02 Abel- The Drexel Manuscript - Suite in D major -2. Allegro.flac
...

This setup allows access to the playlists by browsing the minimserver [folder view]. Everything works flawlessly.

The problem I have is when the portable drive is moved to another machine with minimserver installed, resulting in a change in the prefix of the absolute path leading to the directories. If the new machine is a Windows one, the drive letter assiged to the portable drive will likely change (eg from M: to G: ). If the new machine is running Linux, the drive will be mounted under a subdirectory directory of the Linux file system (eg /mnt/something).

The minimserver contentDir config can easily be edited to accomodate those changes. However, the contents of the .m3u playlists will become unaccessible to minimserver, because the path names point to a now invalid location (eg M:\mu\fla\... is invalid if the portable drive is assigned G: on windows).

The contents of the playlists could of course be edited to substitute the good path prefix, but if the number of playlists is high (> 15,000 in my case), this can quickly become troublesome. This also requires to maintain different versions of the playlists, eg one for G: on windows, possibly also H: , etc). I would greatly prefer to change the pathnames inside my playlists once and for all so as to make them immune to a change of drive letter or mount point. I am thinking here of the possibility to use relative path names inside .m3u plalists.

On Windows, I found that the drive letter can be omitted. In the example above, I can write:
Quote:\mu\fla\Pandolfo, Paolo\Abel- The Drexel Manuscript\01 Abel- The Drexel Manuscript - Suite in D major -1. Prélude.flac
\mu\fla\Pandolfo, Paolo\Abel- The Drexel Manuscript\02 Abel- The Drexel Manuscript - Suite in D major -2. Allegro.flac
...
I found that by trial and error, and I do not know if this is specific to my setup or not.

I did not try on Linux. In this invironment, I also suspect the possibility of problems arising from the use of backslashes inside path names on Windows names.

Could it be possible to get some advice on how to make .m3u contents somewhat immune to a change of drive letter on Windows, or mount point on Linux ? Is there an easy solution to this problem, like a possible config in minimserver to specify a prefix to transform relative path names into absolute ones ?

Any help would be greatly appreciated.
Find all posts by this user
Quote this message in a reply
20-10-2016, 07:16
Post: #2
RE: Relative path names inside m3u playlists : possible ?
You can use relative paths with forward slashes. This works on both Windows and Linux.
Find all posts by this user
Quote this message in a reply
20-10-2016, 11:48
Post: #3
RE: Relative path names inside m3u playlists : possible ?
Hello Simon,

can you please describe, how a relative path would look like?

In my usecase, my library rests on two machines: One on my windows-PC, the other on my NAS. MinimServer itself is installed on the NAS and streams the files that are located there. I find it easier to do the "work" (adding files, tagging etc.) in the library that is stored on my PC (performance- and usability-reasons) and then synchronize with the NAS.

Therefore, I would create playlists on the PC, and using relative paths, the playlists could as well be used on the NAS.

Best regards
Lakorus
Find all posts by this user
Quote this message in a reply
20-10-2016, 13:27 (This post was last modified: 20-10-2016 14:09 by DavidHB.)
Post: #4
RE: Relative path names inside m3u playlists : possible ?
Please forgive me if I am telling you what you already know, but this might help other forum users as well.

The key thing is that MinimServer indexes any playlist (.m3u) files it finds in its assigned music folder(s), and makes them available to the user via a 'Playlists' entry in the top level menu it presents for the Control Point to display. This means that the playlists are available on any control point you use, and are accessed in the same way as you access all your music, which is a great feature. It also means that the playlists need to be where the music is, and not on some other machine or in a folder not indexed by MinimServer.

When it comes to using relative paths, you need to establish and maintain a consistent relationship between the folder where the playlist resides and those where the music tracks reside. There are a number of ways of doing this, but the one I have found easiest is to put a 'Playlists' folder in the Music folder used by MinimServer, and keep all my playlist files there.

My music folder (I keep identical copies on my PC and on my NAS, so my playlists work on both) is organised at the top level essentially by genre, but I put the Playlists folder at the top level as well. An extract from one of the playlist files then looks like this:

#EXTM3U
#EXTINF:380,Piano Sonatas [Kempff, mono][Disc 4] - 9 - Piano Sonata No. 14 in C sharp minor ("Moonlight"), Op. 27, No. 2: 1. Adagio sostenuto - attacca:
../Classical/Beethoven/Piano Sonatas [Kempff, mono]/Piano Sonatas [Kempff, mono][Disc 4]/409 Piano Sonata No. 14 in C sharp minor (Moonlight), Op. 27, No. 2 1. Adagio sostenuto - attacca.flac
#EXTINF:139,Piano Sonatas [Kempff, mono][Disc 4] - 10 - Piano Sonata No. 14 in C sharp minor ("Moonlight"), Op. 27, No. 2: 2. Allegretto - attacca:
../Classical/Beethoven/Piano Sonatas [Kempff, mono]/Piano Sonatas [Kempff, mono][Disc 4]/410 Piano Sonata No. 14 in C sharp minor (Moonlight), Op. 27, No. 2 2. Allegretto - attacca.flac
#EXTINF:363,Piano Sonatas [Kempff, mono][Disc 4] - 11 - Piano Sonata No. 14 in C sharp minor ("Moonlight"), Op. 27, No. 2: 3. Presto agitato


Note that the paths all begin with "../", meaning "go to the next level up from where this playlist file is located (i.e. the Music folder in this case)". That's where the 'relative' bit comes in.

Although .m3u files are plain text and could be created in Notepad, my files were all generated in Playlist Creator, which saves a lot of mental effort. It has settings both to use relative rather than absolute paths and to use forward rather than backslashes in paths, even when working in Windows. Provided that your music and playlist locations stay the same after you have created the playlist, Playlist Creator is a doddle to use.

When you have created your playlist, do a rescan in MinimServer, and check the log for errors (if MinimServer cannot find a file referenced in a playlist it has scanned, there will be an error message).

Hope this helps.

David
Find all posts by this user
Quote this message in a reply
20-10-2016, 17:15
Post: #5
RE: Relative path names inside m3u playlists : possible ?
Hey David,

that worked great, thank you! Although I must admit that for me the Playlist Creator is not very user-friendly, as I prefer to browse and search my library while creating my playlist, listening to the odd song, etc.. That way, I get more inspiration. :-)

But I figured out a workaround: I create a playlist in WinAmp (still my prefered Mediaplayer on PC - the library is yet to be beaten), save it in the playlist-folder - as suggested by you. From there, the playlist can be imported and converted by the Playlist Creator. That is not the most convenient way, but quite easy, once you figure out the steps.

Best regards
Lakorus
Find all posts by this user
Quote this message in a reply
21-10-2016, 15:23
Post: #6
RE: Relative path names inside m3u playlists : possible ?
(20-10-2016 07:16)simoncn Wrote:  You can use relative paths with forward slashes. This works on both Windows and Linux.

Thanks Simon.
As I wrote before, I notice that omitting the drive letter prefixing the path names inside a m3u playslist generated on Windows works well, and makes the playlist more portable between windows machines.

Could you explain the rationale behind this ? How does minimserver infer the drive on which the media reside when scanning the path names inside the playlist ? Does minimserver assume the path names refer to the same drive as the one holding the m3u playlist ?

I am just curious about this. I would like to know if I can permanently count on this feature with minimserver on windows.

Thanks for your excellent software.

Regards,
André
Find all posts by this user
Quote this message in a reply
21-10-2016, 19:24 (This post was last modified: 21-10-2016 19:35 by DavidHB.)
Post: #7
RE: Relative path names inside m3u playlists : possible ?
(21-10-2016 15:23)Andre Gosselin Wrote:  I am just curious about this. I would like to know if I can permanently count on this feature with minimserver on windows.

Removing the drive letter prefix (C:, C:\ or whatever in Windows) makes the specified absolute path into a relative path commencing in the current directory. If that is what you want, fair enough, but it does take a fair amount of mental attention and effort to keep track.

The purpose of the folder structure I described in my previous post is to maintain a more or less consistent structure, which makes this process a good deal easier. If playlists are always in the same place relative to the top level music folder, the 'relative' part of the path to each listed track will be the same. Personally, I prefer the better known (and explicit) conventions of using '.\' to refer to the current directory and '..\' to refer to the parent directory to just omitting the drive letters. These also work in the Unix type systems typically installed on NASs (though with forward slashes of course).

All these conventions are part of the relevant file system(s); they are not features of MinimServer, which, like any other application, has to comply with them.

David
Find all posts by this user
Quote this message in a reply
22-10-2016, 02:27
Post: #8
RE: Relative path names inside m3u playlists : possible ?
(21-10-2016 19:24)DavidHB Wrote:  
(21-10-2016 15:23)Andre Gosselin Wrote:  I am just curious about this. I would like to know if I can permanently count on this feature with minimserver on windows.

Removing the drive letter prefix (C:, C:\ or whatever in Windows) makes the specified absolute path into a relative path commencing in the current directory. If that is what you want, fair enough, but it does take a fair amount of mental attention and effort to keep track.

The purpose of the folder structure I described in my previous post is to maintain a more or less consistent structure, which makes this process a good deal easier. If playlists are always in the same place relative to the top level music folder, the 'relative' part of the path to each listed track will be the same. Personally, I prefer the better known (and explicit) conventions of using '.\' to refer to the current directory and '..\' to refer to the parent directory to just omitting the drive letters. These also work in the Unix type systems typically installed on NASs (though with forward slashes of course).

All these conventions are part of the relevant file system(s); they are not features of MinimServer, which, like any other application, has to comply with them.

David

David,
Thanks for the time taken to discuss about this subject in a very informed and elaborated way.

First about why omitting the windows drive letter from the playlist contents works in my case, which was the question I asked. I now clearly understand that if, on windows, a playlist entry reads "/a/b/c/...", the path name is taken to be relative to the drive storing the m3u playlist. If the playlist is stored in the C: drive, minimserver will look for file with full path name "C:/a/b/c/...". If stored on a M: drive, it will look for path name "M:/a/b/c/...", etc. I verified this my moving my playlists to drive C:, while the music files were left in an M: drive. Minim could'nt find any music file referred to by the playlists.

Now for the use of relative "../../.." prefixes in the path names inside a playlist. I am not a stong supporter of this usage, for the following reasons. As I have a huge number of playlists (> 15,000), it is clearly impossible to manage them all in a "flat" list inside a single directory. Browsing this directory through the top-level Minimsever "Playlists" index would be painfully slow. I rather store them inside a "playlists" hierarchy divided along composers and then composition types, and possibly more subdirectories according whatever groupings you may like. For ex., in the case of J.S Bach:

Code:
playlists/
    ...
   Bach, J.S./
      Catalogue/
        BWV-001-0099/
          BWV 0001 - Cantata "Wie schön leuchtet der Morgenstern" - Koopman.m3u
          BWV 0001 - Cantata "Wie schön leuchtet der Morgenstern" - Richter.m3u
        ...
      Cantatas/
         BWV 0001 - Cantata "Wie schön leuchtet der Morgenstern" - Koopman.m3u
         BWV 0001 - Cantata "Wie schön leuchtet der Morgenstern" - Richter.m3u
        ...
The above "playlists" folder can be entered as one of the MinimServer "contentDir" directories, and then browsed as a hierarchy in your UPnP control point by going to the MinimServer "[Folder view]".

Two important points must be underlined here.
1- MinimServer will let you browse the above "playlists" hierarchy, folder by folder, up and down. To my knowledge, MinimServer is the only music server that allows that. All others that I have tried will scan the folder hierarchy for playlists, but will then present to the control point all the found playlists at the same level inside an endless flat list. This completely defeats the purpose of managing the playlists inside a hierarchy, and makes the hierarchy totally useless. In my opinion, this MinimServer feature has too often been underrated, if not ignored, even if it allows one of the best way to organize your playlists and build all sorts of meaningfull groupings inside your music library.

2- Once a playslist has been created, it can be duplicated it in any number of subdirectories directories that suit your taste. For ex., the playlist shown above in the "Catalogue" directory and holding the BWV 0001 performance by Koopman was duplicated in another "Cantatas" directory specific to the Bach cantatas. It could as well be duplicated inside a "Favorite Bach Cantatas" directory, a "Favorite Cantatas" directory holding playlists for many different composers like Bach, Telemann, Handel, etc.
In order to duplicate a playlist inside any subdirectory at any level of the "playlists" directory, you must make sure that the path names stored inside the playlist will remain valid whatever the level of the subdirectory into which it is copied. Fully relative path names (using "../../ ..." prefixes) will make this impossible, because the pathnames will needed to be adjusted according to the "deepness" of the subdirectory holding the playlist relative to the music files. Tying the path names to the the deepness of the playlist in the file system amounts to creating a new playlist for each different level, instead of a simple copy.

This explains why I much prefer the use of "lightly" relative pathnames inside playlists stored on the same file system as the music files they refer to, and omitting the drive letter (on windows). Such playlists can be used on linux, provided that forward slashes are used inside path names and that the file system is correctly mounted.

I hope that this can throw light on my use of playlists in MinimServer, and the reason of my post in the first place.

Regards to all,
André
Find all posts by this user
Quote this message in a reply
22-10-2016, 18:16 (This post was last modified: 22-10-2016 18:19 by DavidHB.)
Post: #9
RE: Relative path names inside m3u playlists : possible ?
@Andre Gosselin

Just a couple of points from my end. Firstly, I have not understood why you would wish to duplicate a playlist that is indexed and referenced by MinimServer (I assume of course that by 'duplicate', you mean 'produce another playlist that references the same set of tracks'), or why you need such a large number of playlists. MinimServer will put all the lists in the same place in its browse tree. What is the sequence of actions that requires a duplicated list?

Secondly, you might like to read (or re-read) the Microsoft Guidelines on path naming, which contains the following:

"A file name is relative to the current directory if it does not begin with one of the following:
- A UNC name of any format, which always start with two backslash characters ("\\") ... ;
- A disk designator with a backslash, for example "C:\" or "d:\";
- A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path.
If a file name begins with only a disk designator but not the backslash after the colon, it is interpreted as a relative path to the current directory on the drive with the specified letter. Note that the current directory may or may not be the root directory depending on what it was set to during the most recent "change directory" operation on that disk."


So the point is that your system works because it happens to create valid relative paths. Using ".\" or "..\" as appropriate can also help you to ensure that relative paths remain valid when files are copied or moved.

David
Find all posts by this user
Quote this message in a reply
22-10-2016, 19:18
Post: #10
RE: Relative path names inside m3u playlists : possible ?
(22-10-2016 18:16)DavidHB Wrote:  @Andre Gosselin

Just a couple of points from my end. Firstly, I have not understood why you would wish to duplicate a playlist that is indexed and referenced by MinimServer (I assume of course that by 'duplicate', you mean 'produce another playlist that references the same set of tracks'), or why you need such a large number of playlists. MinimServer will put all the lists in the same place in its browse tree. What is the sequence of actions that requires a duplicated list?

Secondly, you might like to read (or re-read) the Microsoft Guidelines on path naming, which contains the following:

"A file name is relative to the current directory if it does not begin with one of the following:
- A UNC name of any format, which always start with two backslash characters ("\\") ... ;
- A disk designator with a backslash, for example "C:\" or "d:\";
- A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path.
If a file name begins with only a disk designator but not the backslash after the colon, it is interpreted as a relative path to the current directory on the drive with the specified letter. Note that the current directory may or may not be the root directory depending on what it was set to during the most recent "change directory" operation on that disk."


So the point is that your system works because it happens to create valid relative paths. Using ".\" or "..\" as appropriate can also help you to ensure that relative paths remain valid when files are copied or moved.

David
David,
I get your point about the "current directory". I was just confused about what constitutes the current directory in the context of a playlist contents. Now I understand that, with MinimServer, the current directory is the one where the playlist file resides. Sorry for having been a bit slow to understand ...

I use playlists to manage compositions-by-artits (works). This explains the large number of playlists I have (> 1,000 for J.S. Bach, same for Telemann, etc). This number does not create problems, as long as the playllists are organized in a multi-level hierarchy, which can be navigated easily with minimserver through the [folder view]. I know that minimserver also serves all the playlists as a "flat" list in its top "Playlist" index, but the length of the list makes it unmanageable and painfully slow to browse.

The possiilyty offered by MinimServer to hierarchically oganize playlists is of an immense value for me, as this lets me manage and quickly browse a composer catalogue, and create all sorts of meaningful groupings of composers works. In my humble opinion, MinimServer shows here one of its best strengths.

Regards,
André
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)