Page 1 of 1

Hide directory on playlist and only show file names.

Posted: 02 Aug 2007 18:41
by JimmyRcom
Sometimes the directory listings are pretty long. It would be much more convenient to have the option to hide the directory and only show the filename.

Re: Hide directory on playlist and only show file names.

Posted: 02 Aug 2007 18:55
by CloudStalker
Improvments for this have been made in the nightly builds (trunk).

Re: Hide directory on playlist and only show file names.

Posted: 02 Aug 2007 19:01
by JimmyRcom
Excellent, thank you. XD

Re: Hide directory on playlist and only show file names.

Posted: 02 Aug 2007 19:13
by JimmyRcom
I downloaded the nightly build from yesterday 20070801. I can't find any options to hide the directory for the playlist items. Is it a command line option?

Re: Hide directory on playlist and only show file names.

Posted: 04 Aug 2007 08:06
by JimmyRcom
ok I wrote a small php code that scans the videolan directory for m3u files and adds an "EXTINF" title based on the file name (to hide the directories). I can't really check how long the file is so I entered -1 so it hides the time, but that settings is intended for streams. I really don't expect this to be used but at least it will be a personal reference in case I forget where the file is.

Code: Select all

<? // Written by Jimmy Ruska (jimmyr.com) Aug 4 2007 // Backup your playlists before you use this. It's not recursive. // Because the directory structure is different in linux I added commented out code. /********************************************************************************************** This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. **********************************************************************************************/ // $dir="/home/you/playlists/"; $dir = "C:\\Program Files\\VideoLan\\VLC\\"; $dh = opendir($dir) or die ("could not open dir"); while ( !(($file = readdir($dh)) === false)){ if (!(eregi("\.m3u$",$file))) continue; $path="$dir\\$file"; @$handle = fopen("$path", "rb"); $contents = stream_get_contents($handle); if (ereg("EXTINF",$contents)){ echo "Already Processed - $path\n"; continue; } // preg_match_all('|.*[^/]+\n|i', $contents, $return); preg_match_all('|.*[^\\\]+\n|i', $contents, $return); $numElements = count($return[0]); $remade=""; for($counter=0; $counter < $numElements; $counter++) { if (ereg("^C\:",$return[0][$counter])) $remade.=ereg_replace("_"," ",preg_replace("|.*\\\([^\\\]+)\.[A-z]{2,4}|i","#EXTINF:-1,\\1",$return[0][$counter])); // $remade.=ereg_replace("_"," ",preg_replace("|.*/([^/]+)\.[A-z]{2,4}|i","#EXTINF:-1,\\1",$return[0][$counter])); $remade.=$return[0][$counter]; } $open = fopen($path, "wb"); fwrite($open, $remade); fclose($open); echo "Finished Processing - $path\n"; } ?>



you don't need apache installed just php.