Skip to content

Commit

Permalink
v1.03 as published on web page
Browse files Browse the repository at this point in the history
fixed some bugs and a bit of code clean-up
  • Loading branch information
ArturSierzant committed May 2, 2017
1 parent 647fa14 commit 6206d98
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 67 deletions.
12 changes: 10 additions & 2 deletions about.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function about() {
<td></td>
<td>Current version:</td>
<td></td>
<td style="color: <?php echo (versionCheck($ttl)) ? 'Green' : 'Red'; ?>"><?php echo html(NJB_VERSION); ?></td>
<td style="color: <?php echo (versionCheck($ttl)) ? 'Green' : 'Red'; ?>"><?php echo '&nbsp;' . html(NJB_VERSION); ?></td>
<td></td>
</tr>
<tr class="even">
Expand All @@ -159,7 +159,7 @@ function about() {
<tr class="line"><td colspan="5"></td></tr>
<tr class="<?php echo ($i++ & 1) ? 'even' : 'odd'; ?>">
<td>&nbsp;</td>
<td style="vertical-align: top;">v1.03 <br>????</td>
<td style="vertical-align: top;">v1.03 <br>2017.05.02</td>
<td></td>
<td>
<ul style="padding-left: 1em;">
Expand All @@ -177,6 +177,7 @@ function about() {
<li> added list of favorite tracks in artist search results</li>
<li> added possibility to use more than one file name for album cover</li>
<li> added random play from directory</li>
<li> fixed bugs</li>
</ul>
<br>
</td>
Expand Down Expand Up @@ -320,6 +321,13 @@ function about() {
<td><a href="http://labs.rampinteractive.co.uk/touchSwipe/" target="_new">http://labs.rampinteractive.co.uk/touchSwipe/</a></td>
<td></td>
</tr>
<tr class="<?php echo ($i++ & 1) ? 'even' : 'odd'; ?>">
<td></td>
<td>Browser</td>
<td></td>
<td><a href="http://tomicki.net/" target="_new">http://tomicki.net/</a></td>
<td></td>
</tr>



Expand Down
2 changes: 1 addition & 1 deletion ajax-random-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

mpd('clear', $player1_host, $player1_port);
foreach ($file as $f) {
$mpdCommand = mpd ('add "' . str_ireplace($cfg['media_dir'], '', $f) . '"', $player1_host, $player1_port);
$mpdCommand = mpd ('add "' . mpdEscapeChar(str_ireplace($cfg['media_dir'], '', $f)) . '"', $player1_host, $player1_port);
if ($mpdCommand == 'ACK_ERROR_NO_EXIST') {
//file not found in MPD database - add stream
playTo(0,'',$f,'',$player1_host, $player1_port);
Expand Down
5 changes: 5 additions & 0 deletions browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
// +------------------------------------------------------------------------+
require_once('include/initialize.inc.php');
$cfg['menu'] = 'Library';

// formattedNavigator
$nav = array();
$nav['name'][] = 'Browser';

authenticate('access_playlist');
require_once('include/header.inc.php');
require_once('include/library.inc.php');
Expand Down
82 changes: 41 additions & 41 deletions include/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@




// +------------------------------------------------------------------------+
// | Multi-disc indicators |
// +------------------------------------------------------------------------+
Expand All @@ -85,65 +86,69 @@
$cfg['multidisk_indicator'][] = " Vol.";




// +------------------------------------------------------------------------+
// | Multi-genre separator |
// | Other versions of album |
// +------------------------------------------------------------------------+
// | String separating genres and styles in GENRE and STYLE tags |
// | Show other versions of album in album view |
// +------------------------------------------------------------------------+

$cfg['multigenre_separator'] = ";";
$cfg['show_album_versions'] = true;




// +------------------------------------------------------------------------+
// | Use STYLE tag |
// | Other versions of album indicators |
// +------------------------------------------------------------------------+
// | Add values from STYLE tag to genres |
// | Strings in album title indicating that album may have other versions |
// | e.g. " (" in: |
// | Brothers In Arms (24bit-96kHz) |
// | Brothers In Arms (2013 Remaster, MFSL, 24bit-88.2kHz) |
// +------------------------------------------------------------------------+
unset($cfg['album_versions_indicator']);

$cfg['album_versions_indicator'][] = " (";
$cfg['album_versions_indicator'][] = " [";
$cfg['album_versions_indicator'][] = ", ";

$cfg['style_enable'] = false;



// +------------------------------------------------------------------------+
// | Other versions of album |
// | Multi-genre separator |
// +------------------------------------------------------------------------+
// | Show other versions of album in album view |
// | String separating genres and styles in GENRE and STYLE tags |
// +------------------------------------------------------------------------+

$cfg['show_album_versions'] = true;
$cfg['multigenre_separator'] = "; ";




// +------------------------------------------------------------------------+
// | Allow access to all files |
// | Use STYLE tag |
// +------------------------------------------------------------------------+
// | When set to true, it allows to access to files outside of media |
// | directory in file browser and for download. |
// | WARNING! Can be dangerous - it allows to access all files your web |
// | server has access to - including files with passwords |
// | USE WITH CARE! |
// | Add values from STYLE tag to genres |
// +------------------------------------------------------------------------+

$cfg['allow_access_to_all_files'] = false;
$cfg['style_enable'] = false;




// +------------------------------------------------------------------------+
// | Other versions of album indicators |
// | Allow access to all files |
// +------------------------------------------------------------------------+
// | Strings in album title indicating that album may have other versions |
// | e.g. " (" in: |
// | Brothers In Arms (24bit-96kHz) |
// | Brothers In Arms (2013 Remaster, MFSL, 24bit-88.2kHz) |
// | When set to true, it allows to access to files outside of media |
// | directory in file browser and for download. |
// | WARNING! Can be dangerous - it allows to access all files your web |
// | server has access to - including files with passwords |
// | USE WITH CARE! |
// +------------------------------------------------------------------------+
unset($cfg['album_versions_indicator']);

$cfg['album_versions_indicator'][] = " (";
$cfg['album_versions_indicator'][] = " [";
$cfg['album_versions_indicator'][] = ", ";
$cfg['allow_access_to_all_files'] = false;



Expand All @@ -163,6 +168,7 @@




// +------------------------------------------------------------------------+
// | Timezone Setting |
// +------------------------------------------------------------------------+
Expand All @@ -172,21 +178,11 @@
$cfg['timezone'] = '';



// +------------------- END OF NEW IN O!MPD 1.03 ---------------------------+




// +------------------------------------------------------------------------+
// | Use COMMENT as tags and display it in album view |
// +------------------------------------------------------------------------+

$cfg['show_comments_as_tags'] = true;




// +------------------------------------------------------------------------+
// | MPD password |
// +------------------------------------------------------------------------+
Expand Down Expand Up @@ -328,6 +324,15 @@



// +------------------------------------------------------------------------+
// | Use COMMENT as tags and display it in album view |
// +------------------------------------------------------------------------+

$cfg['show_comments_as_tags'] = true;




// +------------------------------------------------------------------------+
// | Tag separator |
// +------------------------------------------------------------------------+
Expand Down Expand Up @@ -948,12 +953,7 @@
$cfg['offline'] = false;
$cfg['offline_message'] = '[b]This site is temporarily unavailable.[/b][br]We apologize for the inconvenience.';

// +------------------------------------------------------------------------+
// | Timezone Setting |
// +------------------------------------------------------------------------+
// | Comment out this line to use PHP's default |
// +------------------------------------------------------------------------+
$cfg['timezone'] = 'Europe/Warsaw';


// +------------------------------------------------------------------------+
// | Debug |
Expand Down
4 changes: 2 additions & 2 deletions include/header.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// +------------------------------------------------------------------------+
// | O!MPD, Copyright © 2015-2016 Artur Sierzant |
// | http://www.ompd.pl |
// | O!MPD, Copyright © 2015-2016 Artur Sierzant |
// | http://www.ompd.pl |
// | |
// | |
// | netjukebox, Copyright © 2001-2012 Willem Bartels |
Expand Down
2 changes: 1 addition & 1 deletion include/mysqli.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function updateDatabase() {
loadServerSettings();
message(__FILE__, __LINE__, 'ok', '[b]Incremental database upgrade successfuly on ' . $cfg['mysqli_db'] . '@' . $cfg['mysqli_host'] . '[/b][br]'
. 'It is advisable to update the database now.'
. '[list][*]Login with admin rights[*]Than select menu Config > Update[/list]');
. '[list][*]Login with admin rights[*]Then select Config > Update all[/list]');
}
}

Expand Down
1 change: 1 addition & 0 deletions include/play.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ function playTo($insPos, $track_id = '', $filepath = '', $dirpath = '', $player_

elseif ($filepath) {
$filepath = str_replace('ompd_ampersand_ompd','&',$filepath);
$filepath = str_replace('ompd_plus_ompd','+',$filepath);
$url = NJB_HOME_URL . 'stream.php?action=streamTo&stream_id=-1&filepath=' . urlencode($filepath);
$pos = strpos($filepath,$cfg['media_dir']);
if ($pos !== false) {
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2404,8 +2404,8 @@ function viewRandomFile() {
$selectedDir = str_replace('"',"&quot;",$selectedDir); */


$selectedDir = isset($_GET['selectedDir']) ? myHTMLencode($_GET['selectedDir']) : $dir;

$selectedDir = isset($_GET['selectedDir']) ? myHTMLencode($_GET['selectedDir']) : myHTMLencode($dir);
require_once('include/header.inc.php');

?>
Expand Down
22 changes: 16 additions & 6 deletions play.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ function addTracks($mode = 'play', $insPos = '', $playAfterInsert = '') {
$first = true;
if ($filepath){
$filepath = str_replace('ompd_ampersand_ompd','&',$filepath);
$filepath = str_replace('ompd_plus_ompd','+',$filepath);
//$filepath = str_replace('"','\"',$filepath);
$mpdCommand = mpd('addid "' . mpdEscapeChar($filepath) . '" ' . $insPos);
if ($mpdCommand == 'ACK_ERROR_NO_EXIST') {
Expand All @@ -551,10 +552,12 @@ function addTracks($mode = 'play', $insPos = '', $playAfterInsert = '') {
}
elseif ($dirpath){
$dirpath = str_replace('ompd_ampersand_ompd','&',$dirpath);
$dirpath = str_replace('ompd_plus_ompd','+',$dirpath);
$mpdCommand = mpd('add "' . mpdEscapeChar($dirpath) . '"');
if ($mpdCommand == 'ACK_ERROR_NO_EXIST') {
//dir not found in MPD database - add stream
$fulldirpath = str_replace('ompd_ampersand_ompd','&',$fulldirpath);
$fulldirpath = str_replace('ompd_plus_ompd','+',$fulldirpath);
$mediafiles = find_all_files($fulldirpath);
foreach($mediafiles as $val) {
playTo($insPos,'',$val);
Expand Down Expand Up @@ -1488,23 +1491,30 @@ function playlistTrack() {
$audio = explode(':',$status['audio']);

$data['isStream'] = 'false';
if (strpos($currentsong['file'],"://") !== false) $data['isStream'] = (string) 'true';

if (strpos($currentsong['file'],"://") !== false) {
$data['isStream'] = (string) 'true';
if (strpos($currentsong['file'],'filepath=') !== false){
$pos = strpos($currentsong['file'],'filepath=');
$filepath = substr($currentsong['file'],$pos + 9, strlen($currentsong['file']) - $pos);
$filepath = urldecode($filepath);
$relative_file = urlencode(dirname($filepath));
}
}

/* if (isset($currentsong['Artist']))
$artist = $currentsong['Artist'];
else
$$artist = $currentsong['file'];
*/

if (isset($currentsong['Name'])) {
$album = $currentsong['Name'];
}
elseif (isset($currentsong['Album'])) {
$album = $currentsong['Album'];
}
elseif (strpos($currentsong['file'],'filepath=') !== false){
$pos = strpos($currentsong['file'],'filepath=');
$filepath = substr($currentsong['file'],$pos + 9, strlen($currentsong['file']) - $pos);
$filepath = urldecode($filepath);

$title = basename($filepath);
$pos = strpos($filepath, $title);
$album = substr($filepath, 0, $pos);
Expand Down Expand Up @@ -1558,7 +1568,7 @@ function playlistTrack() {
$data['other_track_version'] = (boolean) false;
$data['comment'] = (string) '';
$data['track_id'] = (string) '';
$data['relative_file'] = (string) '';
$data['relative_file'] = (string) $relative_file;
$data['inFavorite'] = (boolean) '';
$data['onBlacklist'] = (boolean) '';
$data['dr'] = (string) '';
Expand Down
16 changes: 13 additions & 3 deletions playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ function evaluateStatus(data) {
$("#trackOptions").hide();
$('#saveCurrentPlaylist i').removeClass("fa-circle-o fa-check-circle-o").addClass("fa-check-circle-o");
$('#saveCurrentTrack i').removeClass("fa-check-circle-o fa-circle-o").addClass("fa-circle-o");
if (data.isStream == 'true') {
/* if (data.isStream == 'true') {
$('#lyrics').html('&nbsp;');
$('#lyrics1').html('&nbsp;');
$('#fileInfoForDbTracks').css('visibility', 'hidden');
}
} */
}
else {
$("#saveCurrentTrack").show();
Expand Down Expand Up @@ -799,7 +799,12 @@ function evaluateTrack(data) {
previous_track_id = data.track_id;
}


if (data.isStream == 'true' && (!data.genre || !data.year)) {
$('#lyrics').html('&nbsp;');
$('#lyrics1').html('&nbsp;');
$('#fileInfoForDbTracks').css('visibility', 'hidden');
}

$("#cover-spinner").show();
var s = Math.floor(data.miliseconds / 1000);
var m = Math.floor(s / 60);
Expand Down Expand Up @@ -834,6 +839,11 @@ function evaluateTrack(data) {
document.getElementById('album1').innerHTML = (data.album == '&nbsp;') ? '&nbsp' : 'from ' + albumLink;
document.getElementById('album').innerHTML = albumLink;
}
else if (data.relative_file) {
var albumLink = '<a href="browser.php?dir=' + data.relative_file + '">' + data.album + '</a>';
document.getElementById('album1').innerHTML = (data.album == '&nbsp;') ? '&nbsp' : 'from ' + albumLink;
document.getElementById('album').innerHTML = albumLink;
}
else {
document.getElementById('album1').innerHTML = (data.album == '&nbsp;') ? '&nbsp' : 'from ' + data.album;
document.getElementById('album').innerHTML = (data.album == '&nbsp;') ? '&nbsp' : data.album;
Expand Down
18 changes: 14 additions & 4 deletions skin/ompd_the_first/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,16 @@ tr.even {
transition: all 300ms linear;
}

tr.artist_list {
height: 2.5em;
background-color: white;
}

tr.artist_list td {
border-bottom: dotted 1px #E3E3E3;
}


tr.year {
height: 2em;
background-color: white;
Expand Down Expand Up @@ -2196,10 +2206,10 @@ iframe.full {
width: 100%;
overflow: hidden;
position: relative;
padding: 0 0 0 2.95em;
border: 1px solid #dedede;


padding: 0 0 0 2.8em;
border-left: 5px solid #e74c3c;
border-bottom: 1px solid #dedede;
border-right: 1px solid #dedede;
border-top: 0px;
}

Expand Down
Loading

0 comments on commit 6206d98

Please sign in to comment.