diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-05-01 07:22:07 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-05-01 07:22:07 +0000 |
commit | a02b8ce20746ef5449e661ac8ffdb4e1974e65c2 (patch) | |
tree | db1e0b2a6ef1b9fa7bfaa65e2fdb8eb22286f063 /lib | |
parent | af554e6296eff9ee08ad59597f27378e4b2a8db8 (diff) | |
download | ampache-a02b8ce20746ef5449e661ac8ffdb4e1974e65c2.tar.gz ampache-a02b8ce20746ef5449e661ac8ffdb4e1974e65c2.tar.bz2 ampache-a02b8ce20746ef5449e661ac8ffdb4e1974e65c2.zip |
fixed clean, added lang to installer (thx ros) and cleaned up catalog display a bit and mojoed lang list
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/catalog.class.php | 49 | ||||
-rw-r--r-- | lib/class/localplay.class.php | 21 | ||||
-rw-r--r-- | lib/general.lib.php | 17 |
3 files changed, 69 insertions, 18 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 57186865..35ac600e 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -493,7 +493,7 @@ class Catalog { echo "</script>\n"; flush(); } //echos song count - + // Prevent the script from timing out set_time_limit(0); @@ -501,8 +501,7 @@ class Catalog { unset($found); } // foreach albums - - echo "$art_found album's with art. . .<br />\n"; + echo "<br />$art_found " . _('album\'s with art') . ". . .<br />\n"; flush(); } // get_album_art @@ -649,7 +648,7 @@ class Catalog { // Get all of the albums in this catalog $albums = $this->get_catalog_albums($catalog_id); - echo "<br /><b>" . _("Starting Dump Album Art") . ". . .</b><br /><br />\n"; + echo "<br /><b>" . _('Starting Dump Album Art') . ". . .</b><br /><br />\n"; // Run through them an get the art! foreach ($albums as $album) { @@ -789,6 +788,12 @@ class Catalog { /* Get the songs and then insert them into the db */ $this->add_files($this->path,$type,$parse_m3u); + echo "<script language=\"JavaScript\">"; + echo "update_txt('" . $this->count . "','count_add_" . $this->id ."');"; + echo "</script>\n"; + flush(); + + foreach ($this->_playlists as $full_file) { if ($this->import_m3u($full_file)) { $file = basename($full_file); @@ -799,7 +804,7 @@ class Catalog { /* Now Adding Album Art? */ if ($gather_art) { - echo "<br />\n<b>" . _("Starting Album Art Search") . ". . .</b><br />\n"; + echo "<br />\n<b>" . _('Starting Album Art Search') . ". . .</b><br />\n"; echo _('Searched') . ": <span id=\"count_art_" . $this->id . "\">" . _('None') . "</span>"; flush(); $this->get_album_art(0,$art); @@ -952,6 +957,11 @@ class Catalog { /* Get the songs and then insert them into the db */ $this->add_files($this->path,$type,1,$verbose); + echo "<script language=\"JavaScript\">"; + echo "update_txt('" . $this->count . "','count_add_" . $this->id ."');"; + echo "</script>\n"; + flush(); + foreach ($this->_playlists as $full_file) { if ($this->import_m3u($full_file)) { $file = basename($full_file); @@ -1212,12 +1222,25 @@ class Catalog { flush(); } - $sql = "DELETE FROM song WHERE id='" . $results->id . "'"; - $db_results = mysql_query($sql, dbh()); - + /* Add this file to the list for removal from the db */ + $dead_files[] = $results; } //if error } //while gettings songs + + /* Unfortuantly it has to be done this way + * you can't delete a row at the same time you're + * doing a select on said table + */ + if (count($dead_files)) { + foreach ($dead_files as $data) { + + $sql = "DELETE FROM song WHERE id='$data->id'"; + $db_results = mysql_query($sql, dbh()); + + } //end foreach + + } // end if dead files /* Step two find orphaned Arists/Albums * This finds artists and albums that no @@ -1232,6 +1255,9 @@ class Catalog { /* Return dead files, so they can be listed */ if ($verbose) { + echo "<script language=\"JavaScript\">"; + echo "update_txt('" . $this->count ."','count_clean_" . $this->id . "');"; + echo "</script>\n"; echo "<b>" . _("Catalog Clean Done") . " [" . count($dead_files) . "] " . _("files removed") . "</b><br />\n"; flush(); } @@ -1659,6 +1685,13 @@ class Catalog { // Update the last_update $this->update_last_update(); + if ($verbose) { + echo "<script language=\"JavaScript\">"; + echo "update_txt('" . $this->count . "','count_verify_" . $this->id . "');"; + echo "</script>\n"; + flush(); + } + echo _('Update Finished.') . _('Checked') . " $this->count. $total_updated " . _('songs updated.') . "<br /><br />"; $this->count = 0; diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index 1cc9eccb..a3492ff3 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -23,7 +23,7 @@ class Localplay { /* Base Variables */ - + var $type; @@ -327,6 +327,25 @@ class Localplay { } // delete + /** + * delete_all + * This removes every song from the players playlist as defined by the delete_all function + * map + */ + function delete_all() { + + + $function = $this->_function_map['delete_all']; + + if (!$this->_player->$function($songs)) { + debug_event('localplay','Error: Unable to delete entire playlist, check ' . $this->type . ' controller','1'); + return false; + } + + return true; + + } // delete_all + } //end localplay class ?> diff --git a/lib/general.lib.php b/lib/general.lib.php index a1a83c95..cd7757c4 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -877,9 +877,7 @@ function get_languages() { $handle = @opendir(conf('prefix') . '/locale'); if (!is_resource($handle)) { - if (conf('debug')) { - log_event($GLOBALS['user']->username,'language',"Error unable to open locale directory"); - } + debug_event('language','Error unable to open locale directory','1'); } $results = array(); @@ -895,15 +893,16 @@ function get_languages() { if (is_dir($full_file) AND substr($file,0,1) != '.' AND $file != 'base') { switch($file) { - case 'de_DE'; $name = _('German'); break; + case 'de_DE'; $name = 'Deutsch'; break; case 'en_US'; $name = _('English'); break; case 'en_GB'; $name = _('British English'); break; - case 'es_ES'; $name = _('Spanish'); break; - case 'fr_FR'; $name = _('French'); break; - case 'it_IT'; $name = _('Italian'); break; - case 'nl_NL'; $name = _('Dutch'); break; + case 'es_ES'; $name = 'Español'; break; + case 'fr_FR'; $name = 'Français'; break; + case 'it_IT'; $name = 'Italiano'; break; + case 'nl_NL'; $name = 'Nederlands'; break; case 'tr_TR'; $name = _('Turkish'); break; - case 'zh_CN'; $name = _('Simplified Chinese'); break; + case 'zh_CN'; $name = _('Simplified Chinese') . " (简体中文)"; break; + case 'ru_RU'; $name = 'Russian (Русский)'; break; default: $name = _('Unknown'); break; } // end switch |