diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-19 09:27:06 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-19 09:27:06 +0000 |
commit | 7a0fcdd836d491c288b94383ebc54de2271bb237 (patch) | |
tree | d7a6757e7596d5242c10f1290ea14d19b7d6a623 | |
parent | 7b0bd9d52ed2c198868bcaef17f4f2ecff1ac099 (diff) | |
download | ampache-7a0fcdd836d491c288b94383ebc54de2271bb237.tar.gz ampache-7a0fcdd836d491c288b94383ebc54de2271bb237.tar.bz2 ampache-7a0fcdd836d491c288b94383ebc54de2271bb237.zip |
fixed a few more catalog snafus
-rw-r--r-- | albums.php | 12 | ||||
-rw-r--r-- | bin/catalog_update.php.inc | 26 | ||||
-rw-r--r-- | bin/print_tags.php.inc | 2 | ||||
-rw-r--r-- | lib/artist.lib.php | 1 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 41 | ||||
-rw-r--r-- | modules/init.php | 2 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 3 |
7 files changed, 50 insertions, 37 deletions
@@ -20,13 +20,7 @@ */ -/* - - Do most of the dirty work of displaying the mp3 catalog - -*/ - -require_once("modules/init.php"); +require_once('modules/init.php'); show_template('header'); @@ -41,7 +35,7 @@ if ($_REQUEST['action'] === 'clear_art') { if (!$user->has_access('25')) { access_denied(); } $album = new Album($_REQUEST['album_id']); $album->clear_art(); - show_confirmation(_("Album Art Cleared"),_("Album Art information has been removed from the database"),"/albums.php?action=show&album=" . $album->id); + show_confirmation(_('Album Art Cleared'),_('Album Art information has been removed from the database'),"/albums.php?action=show&album=" . $album->id); } // clear_art // if we have album @@ -69,8 +63,6 @@ elseif ($_REQUEST['action'] === 'find_art') { // She's such a little trouper! // *NOTE* I knocked it up a notch with some more horrible code :S - Vollmer - /* Echo notice if no amazon token is found, but it's enabled */ - if (!conf('amazon_developer_key')) { echo "<br /><div class=\"fatalerror\">" . _("Error") . ": " . _("No Amazon Developer Key set, amazon album art searching will not work") . "</div>"; } diff --git a/bin/catalog_update.php.inc b/bin/catalog_update.php.inc index 8bcc26b6..786aaec2 100644 --- a/bin/catalog_update.php.inc +++ b/bin/catalog_update.php.inc @@ -1,14 +1,38 @@ <?php +/* + + Copyright 2001 - 2006 Ampache.org + All Rights Reserved + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + $no_session='1'; require ("../modules/init.php"); +echo "[catalog_update.php.inc]\nStarting Catalog Clean/Update And Add\n\n"; + $sql = "SELECT id FROM catalog WHERE catalog_type='local'"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_row($db_results)) { - $catalog = new Catalog($r[0]); + $catalog = new Catalog($r[0]); + // Clean out dead files $catalog->clean_catalog(); diff --git a/bin/print_tags.php.inc b/bin/print_tags.php.inc index 4c9adf66..68d84b27 100644 --- a/bin/print_tags.php.inc +++ b/bin/print_tags.php.inc @@ -1,7 +1,7 @@ <?php /* - Copyright 2001 - 2005 Ampache.org + Copyright 2001 - 2006 Ampache.org All Rights Reserved This program is free software; you can redistribute it and/or diff --git a/lib/artist.lib.php b/lib/artist.lib.php index bfd956b6..3e8964c6 100644 --- a/lib/artist.lib.php +++ b/lib/artist.lib.php @@ -66,7 +66,6 @@ function format_artist($artist) { */ function show_artists ($match = '') { - global $settings; $dbh = dbh(); $view = new View(); diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index a6c9ea12..0719ee33 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -248,11 +248,11 @@ class Catalog { $this->insert_local_song($filename,$file_size); } elseif (conf('debug')) { - log_event($_SESSION['userdata']['username'], ' add_file ', "Error: File exists"); + log_event($GLOBALS['user']->username, 'add_file', "Error: File exists",'ampache-catalog'); } } // if valid file elseif (conf('debug')) { - log_event($_SESSION['userdata']['username'], ' add_file ', "Error: File doesn't match pattern"); + log_event($GLOBALS['user']->username, 'add_file', "Error: File doesn't match pattern",'ampache-catalog'); } @@ -267,7 +267,7 @@ class Catalog { @param $path The root path you want to start grabing files from @param $gather_type=0 Determins if we need to check the id3 tags of the file or not */ - function add_files($path,$gather_type=0,$parse_m3u=0) { + function add_files($path,$gather_type='',$parse_m3u='') { /* Strip existing escape slashes and then add them again This is done because we keep adding to the dir (slashed) + (non slashed) and a double addslashes would pooch things @@ -295,13 +295,13 @@ class Catalog { if ($file != "." AND $file != "..") { if (conf('debug')) { - log_event($_SESSION['userdata']['username'],'read',"Starting work on $file inside $path",'ampache-catalog'); + log_event($GLOBALS['user']->username,'read',"Starting work on $file inside $path",'ampache-catalog'); } /* Change the dir so is_dir works correctly */ if (!@chdir(stripslashes($path))) { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],'read',"Unable to chdir $path",'ampache-catalog'); } - echo "<font class=\"error\">" . _("Error: Unable to change to directory") . " $path</font><br />\n"; + if (conf('debug')) { log_event($GLOBALS['user']->username,'read',"Unable to chdir $path",'ampache-catalog'); } + echo "<font class=\"error\">" . _('Error: Unable to change to directory') . " $path</font><br />\n"; } /* Create the new path */ @@ -313,7 +313,10 @@ class Catalog { unset($failed_check); if (conf('no_symlinks')) { - if (is_link($full_file)) { $failed_check = 1; } + if (is_link($full_file)) { + $failed_check = 1; + if (conf('debug')) { log_event($GLOBALS['user']->username,'read',"Skipping Symbolic Link $path",'ampache-catalog'); } + } } /* If it's a dir run this function again! */ @@ -880,13 +883,13 @@ class Catalog { @discussion this function adds new files to an existing catalog */ - function add_to_catalog($type=0) { + function add_to_catalog($type='') { - echo _("Starting New Song Search on") . " <b>[$this->name]</b> " . _("catalog") . "<br /><br />\n"; + echo "\n" . _('Starting New Song Search on') . " <b>[$this->name]</b> " . _('catalog') . "<br /><br />\n"; flush(); if ($this->catalog_type == 'remote') { - echo _("Running Remote Update") . ". . .<br /><br />"; + echo _('Running Remote Update') . ". . .<br /><br />"; flush(); $this->get_remote_catalog($type=0); return true; @@ -901,16 +904,16 @@ class Catalog { foreach ($this->_playlists as $full_file) { if ($this->import_m3u($full_file)) { $file = basename($full_file); - echo " " . _("Added Playlist From") . " $file . . . .<br />\n"; + echo " " . _('Added Playlist From') . " $file . . . .<br />\n"; flush(); } // end if import worked } // end foreach playlist files /* Do a little stats mojo here */ $current_time = time(); - - if ($type != "fast_add") { - echo "<b>" . _("Starting Album Art Search") . ". . .</b><br />\n"; + + if ($type != 'fast_add') { + echo "\n<b>" . _('Starting Album Art Search') . ". . .</b><br />\n"; flush(); $this->get_album_art(); } @@ -1451,7 +1454,7 @@ class Catalog { @discussion This function compares the DB's information with the ID3 tags @param $catalog_id The ID of the catalog to compare */ - function verify_catalog($catalog_id=0,$gather_type=0) { + function verify_catalog($catalog_id=0,$gather_type='') { /* Create and empty song for us to use */ $total_updated = 0; @@ -1492,7 +1495,7 @@ class Catalog { filemtime to make sure the file has actually changed */ - if ($gather_type === "fast_update") { + if ($gather_type == 'fast_update') { $file_date = filemtime($song->file); if ($file_date < $this->last_update) { $skip = true; } } // if gather_type @@ -1508,11 +1511,11 @@ class Catalog { $info = $this->update_song_from_tags($song); $album_id = $song->album; if ($info['change']) { - echo "<dl>\n\t<li>"; + echo "<dl style=\"list-style-type:none;\">\n\t<li>"; echo "<b>$song->file " . _("Updated") . "</b>\n"; echo $info['text']; /* If we aren't doing a fast update re-gather album art */ - if ($gather_type !== "fast_update" AND !isset($searched_albums[$album_id])) { + if ($gather_type != 'fast_update' AND !isset($searched_albums[$album_id])) { $album = new Album($song->album); $searched_albums[$album_id] = 1; $found = $album->get_art(); @@ -1962,7 +1965,7 @@ class Catalog { @param $full_file The full file name that we are checking @param $gather_type=0 If we need to check id3 tags or not */ - function check_local_mp3($full_file, $gather_type=0) { + function check_local_mp3($full_file, $gather_type='') { if ($gather_type == 'fast_add') { $file_date = filemtime($full_file); diff --git a/modules/init.php b/modules/init.php index a72d1b75..6d36ff01 100644 --- a/modules/init.php +++ b/modules/init.php @@ -252,9 +252,7 @@ elseif (!conf('use_auth')) { $user->offset_limit = $auth['offset_limit']; $user->username = $auth['username']; $user->access = $auth['access']; - $_SESSION['userdata']['access'] = $auth['access']; $_SESSION['userdata']['username'] = $auth['username']; - $_SESSION['userdata']['offset_limit'] = $auth['offset_limit']; $user->set_preferences(); init_preferences(); set_theme(); diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index ef2aafea..1a0cfb8e 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -if ($type != 'song') { - echo _('Rating') . ":"; -} /* Create some variables we are going to need */ $web_path = conf('web_path'); |