Directory Structure

General discussion about netjukebox
Post Reply
Dxpert
User
Posts: 3
Joined: Sun Jan 29, 2006 7:24 pm

Directory Structure

Post by Dxpert »

Hello, great script. it has all the features that i want and have been looking for. looks like a great active community too!

one question that i have is with regards to the directory structure.
can i extract artist and album and date from the main folder name?

i keep all of my media in one main directory. and keep the same naming structure for all albums. it looks like this

/media/artist - album (200x) [FLAC]/xx - songname.flac

an example would be

/media/3 Doors Down - Seventeen Days (2005) [FLAC]/01 - Right Where I Belong.flac

only problem is the script tags this as artist "media" and album name "3 Doors Down - Seventeen Days (2005) [FLAC]"

you can undoubtedly see my dilemma, i can also not search for "3 doors down" but when i search for "media" it brings up ALL of the albums that do not have sub directories.
i have a few albums with multiple disks that take the form
/media/artist - album (200x) [FLAC]/cd1/xx - songname.flac
/media/artist - album (200x) [FLAC]/cd2/xx - songname.flac

at this point the "cd1" will be the name of the album and "artist - album (200x) [FLAC]" will be the name of the artist.
this is then shows up in a search

i have poked around in the code a little but i seem to break it more than i get it to do what i want. :) makes for quite a few reinstalls.
any points or tips would be greatly appreciated.

also, i many of the album art is folder.jpg, is there any way to add this?
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Directory Structure

Post by wbartels »

Dxpert wrote:Hello, great script. it has all the features that i want and have been looking for. looks like a great active community too!

one question that i have is with regards to the directory structure.
can i extract artist and album and date from the main folder name?

i keep all of my media in one main directory. and keep the same naming structure for all albums. it looks like this

/media/artist - album (200x) [FLAC]/xx - songname.flac

an example would be

/media/3 Doors Down - Seventeen Days (2005) [FLAC]/01 - Right Where I Belong.flac

only problem is the script tags this as artist "media" and album name "3 Doors Down - Seventeen Days (2005) [FLAC]"

you can undoubtedly see my dilemma, i can also not search for "3 doors down" but when i search for "media" it brings up ALL of the albums that do not have sub directories.
i have a few albums with multiple disks that take the form
/media/artist - album (200x) [FLAC]/cd1/xx - songname.flac
/media/artist - album (200x) [FLAC]/cd2/xx - songname.flac

at this point the "cd1" will be the name of the album and "artist - album (200x) [FLAC]" will be the name of the artist.
this is then shows up in a search

i have poked around in the code a little but i seem to break it more than i get it to do what i want. :) makes for quite a few reinstalls.
any points or tips would be greatly appreciated.
All data from the directory structure will be added/updated by update.php.
This is actually done by the function: FileStructure()
The directory structure will be added between line 665 and 773
The code above these lines is for the cover art and thumbnails.
The code below these lines is for the Track names.

Don't forget to look here, this is how the directory/files are interpreted.
http://www.netjukebox.nl/filestructure.php
Dxpert wrote: also, i many of the album art is folder.jpg, is there any way to add this?
This should already be working after an update config > update

Image for the thumbnails | update.php | Line 594-603:

Code: Select all

if     (file_exists($dir . '/image.jpg'))				$source_image = $dir . '/image.jpg';
elseif (file_exists($dir . '/image.png'))				$source_image = $dir . '/image.png';
elseif (file_exists($dir . '/image.gif'))				$source_image = $dir . '/image.gif';
elseif (file_exists($dir . '/folder.jpg'))				$source_image = $dir . '/folder.jpg';
elseif (file_exists($dir . '/folder.png'))				$source_image = $dir . '/folder.png';
elseif (file_exists($dir . '/folder.gif'))				$source_image = $dir . '/folder.gif';
elseif (file_exists($dir . '/cd_front.jpg'))			$source_image = $dir . '/cd_front.jpg';
elseif (file_exists($dir . '/cd_front.png'))			$source_image = $dir . '/cd_front.png';
elseif (file_exists($dir . '/cd_front.gif'))			$source_image = $dir . '/cd_front.gif';
elseif (filemtime($file[0]) == $bitmap['filemtime'])	$source_image = $file[0];
Images for the PDF cover | update.php | Line 648-656:

Code: Select all

if		(file_exists($dir . '/cd_front.jpg')) $cd_front = $dir . '/cd_front.jpg';
elseif	(file_exists($dir . '/cd_front.png')) $cd_front = $dir . '/cd_front.png';
elseif	(file_exists($dir . '/cd_front.gif')) $cd_front = $dir . '/cd_front.gif';
else	$cd_front = '';

if		(file_exists($dir . '/cd_back.jpg')) $cd_back = $dir . '/cd_back.jpg';
elseif	(file_exists($dir . '/cd_back.png')) $cd_back = $dir . '/cd_back.png';
elseif	(file_exists($dir . '/cd_back.gif')) $cd_back = $dir . '/cd_back.gif';
else	$cd_back = '';
Dxpert
User
Posts: 3
Joined: Sun Jan 29, 2006 7:24 pm

Post by Dxpert »

thanks for the swift reply. i got the images working. now just to mess with the folder stuff :)
Dxpert
User
Posts: 3
Joined: Sun Jan 29, 2006 7:24 pm

Post by Dxpert »

my php is well, you will see.
my directory structure on the drive is /media/artist - album (year) [Flac]/0x - track.flac

i also dont know how i am going to deal with the few albums that are of the form
/media/artist - album (year) [Flac]/cd1/0x - track.flac


$temp = DecodeEscapeCharacters($dir);
$temp = explode('/', $temp);
$album = $temp[count($temp) - 1];

$year = 'NULL';
$month = 'NULL';

$temp = explode(' ', $album);
$year = $temp[count($temp) - 2];
$year = substr($year, 1, 4);
$temp = explode(' - ', $album);
$artist_alphabetic = $temp[0];
$temp = explode(' ', $temp[1], -2);
$album = implode(" ", $temp);
$artist = $artist_alphabetic;
Rudolf
User
Posts: 6
Joined: Wed Feb 08, 2006 9:43 pm

Post by Rudolf »

My directory structure is like this:

*:\Artist\Artist - Album\Artist - Album - ## - Title.mp3

I can't figure out how to filter the artist from the albumname.

-- Edit: I did it :!: ;-) --
Post Reply