diff --git a/lib/global.php b/lib/global.php index 9830c94..a7704aa 100644 --- a/lib/global.php +++ b/lib/global.php @@ -22,7 +22,26 @@ /* track number sorting function */ function track_sort($a, $b) { - return $a['Track'] - $b['Track']; + if ($a['directory'] && $b['directory']) { + if ($a['directory'] < $b['directory']) { + return -1; + } + elseif ($a['directory'] > $b['directory']) { + return 1; + } + else { + return 0; + } + } + elseif ($a['directory'] && !$b['directory']) { + return 1; + } + elseif (!$a['directory'] && $b['directory']) { + return -1; + } + else { + return $a['Track'] - $b['Track']; + } } /* setup some global vars */ diff --git a/templates/default/index.html b/templates/default/index.html index 766da34..72b8e78 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -1,7 +1,10 @@ + + - Neo MPC 0.2 + Neo MPC 0.2 +