More then one media dir

General discussion about netjukebox
Post Reply
Zulan
User
Posts: 3
Joined: Mon Oct 23, 2006 2:05 pm
Contact:

More then one media dir

Post by Zulan »

Hi!

I have my media on a network share. I have a directory structure like

\\server\mp3\lowquality
\\server\mp3\highquality
\\server\mp3\lossless

Netjukebox thinks all my artists are called highquality :-(
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

This shouldn't be a problem when using the directory structure like this:
http://www.netjukebox.nl/filestructure.php

Here is an example:

Code: Select all

\\server\mp3\lossless\Moby\1999 - Play\01 - Honey.flac
\\server\mp3\lossless\Moby\1999 - Play\02 - Find my baby.flac
\\server\mp3\lossless\Moby\1999 - Play\etc…
As you can see the last directory represent the album.
And the second last directory represent the artist.
I think you have only one directory after lowquality, highquality and lossless.
So you have to insert a directory with the artist name.

A similar discussion, multiple directory's with NTFS HardLinks:
http://forum.lan/viewtopic.php?t=41
Zulan
User
Posts: 3
Joined: Mon Oct 23, 2006 2:05 pm
Contact:

Post by Zulan »

Hi wbartels, thanks for your answer.

You are correct, I only have one directory after "lowquality". Exampel:

\\server\mp3\lossless\Moby - 1999 - Play\01 - Honey.flac

I really don't want to change the structure, first of all I've had it for years so I'm used to it. Second, I have more then 1500 folders like this, it will take some time.

Is there any other way to get around this other then changing the file structure?
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

Netjukebox need a directory per album (for creating an id) witch you have.
So it must be possible to change the code for your directory structure.

The directory structure will be updated in the database by the update.php script.
In netjukebox 3.80b this is done between line 668 and 741.

Code: Select all

$artist_alphabetic          = $temp[count($temp) - 2];
$album                      = $temp[count($temp) - 1];
change to

Code: Select all

$artist_album               = $temp[count($temp) - 1];
Now you only need to edit between line 674 and 686 to retrieve:
$artist_alphabetic, $album, $year and $month
Maybe someone with good knowledge of regular expression can help you with that.

Good luck,

Willem
Zulan
User
Posts: 3
Joined: Mon Oct 23, 2006 2:05 pm
Contact:

Post by Zulan »

I'm afraid this is way over my php skills. I found the lines you mentioned, deleted them and replaced it with the artist_album line, but then update didn't really seem to work anymore so I gave up since I had no idea what I was doing anyway.

Is there anyone out there that already did these changes and can give me a detailed description on how to change this. Or even better, share their update.php file.
SandStorm
User
Posts: 1
Joined: Sat Sep 30, 2006 4:26 pm
Contact:

Post by SandStorm »

it's a bit late and not that easy for me, so i'll try to give you a short description of how it could actually work...

changing the code to

Code: Select all

$artist_album               = $temp[count($temp) - 1];
won't do you any good, you need something that splits up
$temp[count($temp) - 2];
it should contain something like "Artist - Year - Album" depending on your directory structure...
supposing that all of your dirs are formed that way, you need a regex like
([a-zA-Z0-9]* - ([0-9]{4})? - [a-zA-Z0-9]*) to split the dir name into something usable.
(or you just try it with explode... explode('-', $temp[count($temp)-2]);)

your code should look like that:

Code: Select all

$fetch_data = explode('-', $temp[count($temp)-2]);

$artist_alphabetic          = $fetch_data[2];
$album                      = $fetch_data[0];
i know...it's crap ;) but it should work...i'm too tired now to write a complete solution for your problem, but it's pretty easy...
Post Reply