diff --git a/admin/catalog.php b/admin/catalog.php
index 7716a0b4..c6d7f322 100644
--- a/admin/catalog.php
+++ b/admin/catalog.php
@@ -1,7 +1,7 @@
has_access(100)) {
+if (!$GLOBALS['user']->has_access(100)) {
access_denied();
}
@@ -40,244 +40,229 @@ show_template('header');
/* Big switch statement to handle various actions */
switch ($_REQUEST['action']) {
- case 'fixed':
- delete_flagged($flag);
- $type = 'show_flagged_songs';
- include(conf('prefix') . '/templates/flag.inc');
+ case 'fixed':
+ delete_flagged($flag);
+ $type = 'show_flagged_songs';
+ include(conf('prefix') . '/templates/flag.inc');
break;
-
- case _("Add to Catalog(s)"):
- if (conf('demo_mode')) { break; }
- if ($_REQUEST['catalogs'] ) {
- foreach ($_REQUEST['catalogs'] as $catalog_id) {
- $catalog = new Catalog($catalog_id);
- $catalog->add_to_catalog($_REQUEST['update_type']);
- }
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case _("Add to all Catalogs"):
- if (conf('demo_mode')) { break; }
-
- /* If they are using the file MPD type, and it's currently enabled lets do a DBRefresh for em */
- if (conf('mpd_method') == 'file' AND conf('allow_mpd_playback')) {
- // Connect to the MPD
- if (!class_exists('mpd')) { require_once(conf('prefix') . "/modules/mpd/mpd.class.php"); }
- if (!is_object($myMpd)) { $myMpd = new mpd(conf('mpd_host'),conf('mpd_port')); }
- if (!$myMpd->connected) {
- echo "" . _("Error Connecting") . ": " . $myMpd->errStr . "\n";
- log_event($_SESSION['userdata']['username'],' connection_failed ',"Error: Unable able to connect to MPD, " . $myMpd->errStr);
- } // MPD connect failed
-
- $myMpd->DBRefresh();
- } // if MPD enabled
- $catalogs = $catalog->get_catalogs();
-
- foreach ($catalogs as $data) {
- $data->add_to_catalog($_REQUEST['update_type']);
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case _("Update Catalog(s)"):
- if (conf('demo_mode')) { break; }
- if (isset($_REQUEST['catalogs'])) {
- foreach ($_REQUEST['catalogs'] as $catalog_id) {
- $catalog = new Catalog($catalog_id);
- $catalog->verify_catalog($catalog_id->id,$_REQUEST['update_type']);
- }
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case _("Update All Catalogs"):
- if (conf('demo_mode')) { break; }
- $catalogs = $catalog->get_catalogs();
-
- foreach ($catalogs as $data) {
- $data->verify_catalog($data->id,$_REQUEST['update_type']);
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case 'delete_catalog':
- if (conf('demo_mode')) { break; }
- if ($_REQUEST['confirm'] === 'Yes') {
- $catalog = new Catalog($_REQUEST['catalog_id']);
- $catalog->delete_catalog();
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case 'remove_disabled':
- if (conf('demo_mode')) { break; }
- $song = $_REQUEST['song'];
- if (count($song)) {
- $catalog->remove_songs($song);
- echo "
Songs Removed...
";
- }
- else {
- echo "No Songs Removed...
";
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case _("Clean Catalog(s)"):
- if (conf('demo_mode')) { break; }
-
- // Make sure they checked something
- if (isset($_REQUEST['catalogs'])) {
- foreach($_REQUEST['catalogs'] as $catalog_id) {
- $catalog = new Catalog($catalog_id);
- $catalog->clean_catalog(0,$_REQUEST['update_type']);
- } // end foreach catalogs
- }
- include(conf('prefix') . '/templates/catalog.inc');
- break;
- case 'update_catalog_settings':
- if (conf('demo_mode')) { break; }
- $id = strip_tags($_REQUEST['catalog_id']);
- $name = strip_tags($_REQUEST['name']);
- $id3cmd = strip_tags($_REQUEST['id3_set_command']);
- $rename = strip_tags($_REQUEST['rename_pattern']);
- $sort = strip_tags($_REQUEST['sort_pattern']);
- /* Setup SQL */
- $sql = "UPDATE catalog SET " .
- " name = '$name'," .
- " id3_set_command = '$id3cmd'," .
- " rename_pattern = '$rename'," .
- " sort_pattern = '$sort'" .
- " WHERE id = '$id'";
- $result = mysql_query($sql, dbh());
- include(conf('prefix') . '/templates/catalog.inc');
- break;
-
- case _("Clean All Catalogs"):
- if (conf('demo_mode')) { break; }
- $catalogs = $catalog->get_catalogs();
- $dead_files = array();
-
- foreach ($catalogs as $catalog) {
- $catalog->clean_catalog(0,$_REQUEST['update_type']);
- }
-
- include(conf('prefix') . '/templates/catalog.inc');
- break;
- case 'add_catalog':
- if (conf('demo_mode')) { break; }
- if ($_REQUEST['path'] AND $_REQUEST['name']) {
- /* Throw all of the album art types into an array */
- $art = array('id3'=>$_REQUEST['art_id3v2'],'amazon'=>$_REQUEST['art_amazon'],'folder'=>$_REQUEST['art_folder']);
- /* Create the Catalog */
- $catalog->new_catalog($_REQUEST['path'],
- $_REQUEST['name'],
- $_REQUEST['id3set_command'],
- $_REQUEST['rename_pattern'],
- $_REQUEST['sort_pattern'],
- $_REQUEST['type'],
- $_REQUEST['gather_art'],
- $_REQUEST['parse_m3u'],
- $art);
+ case _("Add to Catalog(s)"):
+ case 'add_to_catalog':
+ if (conf('demo_mode')) { break; }
+ if ($_REQUEST['catalogs'] ) {
+ foreach ($_REQUEST['catalogs'] as $catalog_id) {
+ $catalog = new Catalog($catalog_id);
+ $catalog->add_to_catalog($_REQUEST['update_type']);
+ }
+ }
include(conf('prefix') . '/templates/catalog.inc');
- }
- else {
- $error = "Please complete the form.";
+ break;
+ case _("Add to all Catalogs"):
+ if (conf('demo_mode')) { break; }
+
+ /* If they are using the file MPD type, and it's currently enabled lets do a DBRefresh for em */
+ if (conf('mpd_method') == 'file' AND conf('allow_mpd_playback')) {
+ // Connect to the MPD
+ if (!class_exists('mpd')) { require_once(conf('prefix') . "/modules/mpd/mpd.class.php"); }
+ if (!is_object($myMpd)) { $myMpd = new mpd(conf('mpd_host'),conf('mpd_port')); }
+ if (!$myMpd->connected) {
+ echo "" . _("Error Connecting") . ": " . $myMpd->errStr . "\n";
+ log_event($_SESSION['userdata']['username'],' connection_failed ',"Error: Unable able to connect to MPD, " . $myMpd->errStr);
+ } // MPD connect failed
+
+ $myMpd->DBRefresh();
+ } // if MPD enabled
+ $catalogs = $catalog->get_catalogs();
+
+ foreach ($catalogs as $data) {
+ $data->add_to_catalog($_REQUEST['update_type']);
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case _("Update Catalog(s)"):
+ case 'update_catalog':
+ /* If they are in demo mode stop here */
+ if (conf('demo_mode')) { break; }
+
+ if (isset($_REQUEST['catalogs'])) {
+ foreach ($_REQUEST['catalogs'] as $catalog_id) {
+ $catalog = new Catalog($catalog_id);
+ $catalog->verify_catalog($catalog_id->id,$_REQUEST['update_type']);
+ }
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case _("Update All Catalogs"):
+ if (conf('demo_mode')) { break; }
+ $catalogs = $catalog->get_catalogs();
+
+ foreach ($catalogs as $data) {
+ $data->verify_catalog($data->id,$_REQUEST['update_type']);
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case 'full_service':
+ /* Make sure they aren't in demo mode */
+ if (conf('demo_mode')) { break; }
+
+ /* This runs the clean/verify/add in that order */
+ foreach ($_REQUEST['catalogs'] as $catalog_id) {
+ $catalog = new Catalog($catalog_id);
+ $catalog->clean_catalog();
+ $catalog->count = 0;
+ $catalog->update_catalog();
+ $catalog->count = 0;
+ $catalog->add_to_catalog();
+ }
+ break;
+ case 'delete_catalog':
+ if (conf('demo_mode')) { break; }
+ if ($_REQUEST['confirm'] === 'Yes') {
+ $catalog = new Catalog($_REQUEST['catalog_id']);
+ $catalog->delete_catalog();
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case 'remove_disabled':
+ if (conf('demo_mode')) { break; }
+ $song = $_REQUEST['song'];
+ if (count($song)) {
+ $catalog->remove_songs($song);
+ echo "Songs Removed...
";
+ }
+ else {
+ echo "No Songs Removed...
";
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case _('Clean Catalog(s)'):
+ case 'clean_catalog':
+ /* If they are in demo mode stop them here */
+ if (conf('demo_mode')) { break; }
+
+ // Make sure they checked something
+ if (isset($_REQUEST['catalogs'])) {
+ foreach($_REQUEST['catalogs'] as $catalog_id) {
+ $catalog = new Catalog($catalog_id);
+ $catalog->clean_catalog(0,1);
+ } // end foreach catalogs
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case 'update_catalog_settings':
+ if (conf('demo_mode')) { break; }
+ $id = strip_tags($_REQUEST['catalog_id']);
+ $name = strip_tags($_REQUEST['name']);
+ $id3cmd = strip_tags($_REQUEST['id3_set_command']);
+ $rename = strip_tags($_REQUEST['rename_pattern']);
+ $sort = strip_tags($_REQUEST['sort_pattern']);
+ /* Setup SQL */
+ $sql = "UPDATE catalog SET " .
+ " name = '$name'," .
+ " id3_set_command = '$id3cmd'," .
+ " rename_pattern = '$rename'," .
+ " sort_pattern = '$sort'" .
+ " WHERE id = '$id'";
+ $result = mysql_query($sql, dbh());
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case _("Clean All Catalogs"):
+ if (conf('demo_mode')) { break; }
+ $catalogs = $catalog->get_catalogs();
+ $dead_files = array();
+
+ foreach ($catalogs as $catalog) {
+ $catalog->clean_catalog(0,$_REQUEST['update_type']);
+ }
+
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case 'add_catalog':
+ if (conf('demo_mode')) { break; }
+ if ($_REQUEST['path'] AND $_REQUEST['name']) {
+ /* Throw all of the album art types into an array */
+ $art = array('id3'=>$_REQUEST['art_id3v2'],'amazon'=>$_REQUEST['art_amazon'],'folder'=>$_REQUEST['art_folder']);
+ /* Create the Catalog */
+ $catalog->new_catalog($_REQUEST['path'],
+ $_REQUEST['name'],
+ $_REQUEST['id3set_command'],
+ $_REQUEST['rename_pattern'],
+ $_REQUEST['sort_pattern'],
+ $_REQUEST['type'],
+ $_REQUEST['gather_art'],
+ $_REQUEST['parse_m3u'],
+ $art);
+ include(conf('prefix') . '/templates/catalog.inc');
+ }
+ else {
+ $error = "Please complete the form.";
+ include(conf('prefix') . '/templates/add_catalog.inc');
+ }
+ break;
+ case 'really_clear_stats':
+ if (conf('demo_mode')) { break; }
+ if ($_REQUEST['confirm'] == 'Yes') {
+ clear_catalog_stats();
+ }
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
+ case 'show_add_catalog':
include(conf('prefix') . '/templates/add_catalog.inc');
- }
break;
-
- case 'really_clear_stats':
-
- if (conf('demo_mode')) { break; }
- if ($_REQUEST['confirm'] == 'Yes') {
- clear_catalog_stats();
- }
- include(conf('prefix') . '/templates/catalog.inc');
+ case 'clear_now_playing':
+ if (conf('demo_mode')) { break; }
+ clear_now_playing();
+ show_confirmation(_("Now Playing Cleared"),_("All now playing data has been cleared"),"/admin/catalog.php");
break;
-
- case 'show_add_catalog':
- include(conf('prefix') . '/templates/add_catalog.inc');
+ case 'Clear Catalog':
+ if (conf('demo_mode')) { break; }
+ show_confirm_action(_("Do you really want to clear your catalog?"),
+ "admin/catalog.php", "action=really_clear_catalog");
+ print("
\n");
break;
-
- case 'clear_now_playing':
- if (conf('demo_mode')) { break; }
- clear_now_playing();
- show_confirmation(_("Now Playing Cleared"),_("All now playing data has been cleared"),"/admin/catalog.php");
-
+ case 'clear_stats':
+ if (conf('demo_mode')) { break; }
+ show_confirm_action(_("Do you really want to clear the statistics for this catalog?"),
+ "admin/catalog.php", "action=really_clear_stats");
break;
- case 'Clear Catalog':
- if (conf('demo_mode')) { break; }
- show_confirm_action(_("Do you really want to clear your catalog?"),
- "admin/catalog.php", "action=really_clear_catalog");
- print("
\n");
+ case 'show_disabled':
+ if (conf('demo_mode')) { break; }
+ $songs = $catalog->get_disabled();
+ if (count($songs)) {
+ require (conf('prefix') . '/templates/show_disabled_songs.inc');
+ }
+ else {
+ echo "No Disabled songs found
";
+ }
break;
-
- case 'clear_stats':
- if (conf('demo_mode')) { break; }
- show_confirm_action(_("Do you really want to clear the statistics for this catalog?"),
- "admin/catalog.php", "action=really_clear_stats");
+ case 'show_delete_catalog':
+ if (conf('demo_mode')) { break; }
+ show_confirm_action(_("Do you really want to delete this catalog?"),
+ "admin/catalog.php",
+ "catalog_id=" . $_REQUEST['catalog_id'] . "&action=delete_catalog");
break;
-
- case 'show_disabled':
- if (conf('demo_mode')) { break; }
- $songs = $catalog->get_disabled();
- if (count($songs)) {
- require (conf('prefix') . '/templates/show_disabled_songs.inc');
- }
- else {
- echo "No Disabled songs found
";
- }
+ case 'show_flagged_songs':
+ if (conf('demo_mode')) { break; }
+ $type = $_REQUEST['action'];
+ include (conf('prefix') . '/templates/flag.inc');
break;
-
- case 'show_delete_catalog':
- if (conf('demo_mode')) { break; }
- show_confirm_action(_("Do you really want to delete this catalog?"),
- "admin/catalog.php",
- "catalog_id=" . $_REQUEST['catalog_id'] . "&action=delete_catalog");
+ case 'show_customize_catalog':
+ include(conf('prefix') . '/templates/customize_catalog.inc');
break;
+ case 'gather_album_art':
+ echo "" . _("Starting Album Art Search") . ". . .
\n";
+ flush();
- case 'show_flagged_songs':
- if (conf('demo_mode')) { break; }
- $type = $_REQUEST['action'];
- include (conf('prefix') . '/templates/flag.inc');
- break;
+ $catalogs = $catalog->get_catalogs();
+ foreach ($catalogs as $data) {
+ $data->get_album_art();
+ }
- case 'Update Flags':
- if (conf('demo_mode')) { break; }
- echo "";
- print_r($_REQUEST);
- echo "
";
- break;
-
- case 'show_customize_catalog':
- include(conf('prefix') . '/templates/customize_catalog.inc');
- break;
- case 'gather_album_art':
-
- echo "" . _("Starting Album Art Search") . ". . .
\n";
- flush();
-
- $catalogs = $catalog->get_catalogs();
- foreach ($catalogs as $data) {
- $data->get_album_art();
- }
-
- echo "" . _("Album Art Search Finished") . ". . .
\n";
+ echo "" . _("Album Art Search Finished") . ". . .
\n";
break;
- // (Added by Cucumber 20050216)
- case 'dump_album_art':
- $catalogs = $catalog->get_catalogs();
-
- foreach ($catalogs as $data) {
- $data->dump_album_art();
- }
- break;
-
- default:
- include(conf('prefix') . '/templates/catalog.inc');
-
+ default:
+ include(conf('prefix') . '/templates/catalog.inc');
+ break;
} // end switch
/* Show the Footer */
diff --git a/admin/index.php b/admin/index.php
index dfc682b3..70540c49 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -1,7 +1,7 @@
has_access(100)) {
- header ("Location: " . conf('web_path') . "/index.php?access=denied");
+if (!$GLOBALS['user']->has_access(100)) {
+ access_denied();
exit();
}
-// let's set the preferences here so that they take affect on the fly
-if ( $action == 'Update Preferences' ) {
- update_site_preferences($preferences_id, 'true', $new_m_host, $new_w_host,
- $new_site_title, $new_login_message, $new_session_lifetime, $new_font,
- $new_background_color, $new_primary_color, $new_secondary_color,
- $new_primary_font_color, $new_secondary_font_color,
- $new_error_color, $new_popular_threshold);
- // reload the preferences now
- set_preferences();
-}
-
show_template('header');
-
-if ( $action == 'Update Preferences' ) {
- $action = 'show_preferences';
-}
-elseif ( $action == 'show_update_catalog' ) {
- show_update_catalog();
-}
-elseif ( $action == 'show_file_manager' ) {
- show_file_manager();
-}
-elseif ( $action == 'show_site_preferences' ) {
- $user = new User(0);
- require (conf('prefix') . "/templates/show_preferences.inc");
-}
-elseif ( $action == 'show_preferences' ) {
- $user = new User($_REQUEST['user_id']);
- require (conf('prefix') . "/templates/show_preferences.inc");
-}
-elseif ( $action == 'show_orphaned_files' ) {
- show_orphaned_files();
-}
-else {
- show_clear();
- require (conf('prefix') . "/templates/show_admin_index.inc");
-} // if they didn't pick anything
-
-show_footer();
?>
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+
diff --git a/bin/catalog_update.php.inc b/bin/catalog_update.php.inc
index 786aaec2..d03270b9 100644
--- a/bin/catalog_update.php.inc
+++ b/bin/catalog_update.php.inc
@@ -34,12 +34,12 @@ while ($r = mysql_fetch_row($db_results)) {
$catalog = new Catalog($r[0]);
// Clean out dead files
- $catalog->clean_catalog();
+ $catalog->clean_catalog(0,0);
$catalog->count = 0;
// Verify Existing
- $catalog->verify_catalog();
+ $catalog->verify_catalog(0,0,0);
$catalog->count = 0;
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index e74ab9fe..1dec252c 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.3.2-Beta2
+ - Added dump album art command line script and tweaked catalog
+ build display.
- Tweaked preferences adding tab'd views rather then all on one
page, also added account page back in.
- Fixed popen in downsample, forcing binary mode, so that windows
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 5a229092..fc78971d 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -266,8 +266,9 @@ class Catalog {
information against the db.
@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
+ @param $parse_m3u Tells Ampache to look at m3us
*/
- function add_files($path,$gather_type='',$parse_m3u='') {
+ function add_files($path,$gather_type='',$parse_m3u='',$verbose=1) {
/* 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
@@ -380,7 +381,9 @@ class Catalog {
/* Stupid little cutesie thing */
$this->count++;
if ( !($this->count%conf('catalog_echo_count')) ) {
- echo _("Added") . " $this->count. . . .
\n";
+ echo "\n";
flush();
} //echos song count
@@ -736,16 +739,17 @@ class Catalog {
/* Fluf */
echo _("Starting Catalog Build") . " [$name]
\n";
- flush();
if ($this->catalog_type == 'remote') {
echo _("Running Remote Sync") . ". . .
";
- flush();
$this->get_remote_catalog($type=0);
return true;
}
+ echo _('Found') . ": " . _('None') . "
\n";
+ flush();
+
/* Get the songs and then insert them into the db */
$this->add_files($this->path,$type,$parse_m3u);
@@ -890,29 +894,34 @@ class Catalog {
@discussion this function adds new files to an
existing catalog
*/
- function add_to_catalog($type='') {
+ function add_to_catalog($type='',$verbose=1) {
- echo "\n" . _('Starting New Song Search on') . " [$this->name] " . _('catalog') . "
\n";
- flush();
+ if ($verbose) {
+ echo "\n" . _('Starting New Song Search on') . " [$this->name] " . _('catalog') . "
\n";
+ }
if ($this->catalog_type == 'remote') {
- echo _('Running Remote Update') . ". . .
";
- flush();
+ echo _('Running Remote Update') . ". . .
";
$this->get_remote_catalog($type=0);
return true;
}
+
+ echo _('Found') . ": " . _('None') . "
\n";
+ flush();
/* Set the Start time */
$start_time = time();
/* Get the songs and then insert them into the db */
- $this->add_files($this->path,$type);
+ $this->add_files($this->path,$type,1,$verbose);
foreach ($this->_playlists as $full_file) {
if ($this->import_m3u($full_file)) {
$file = basename($full_file);
- echo " " . _('Added Playlist From') . " $file . . . .
\n";
- flush();
+ if ($verbose) {
+ echo " " . _('Added Playlist From') . " $file . . . .
\n";
+ flush();
+ }
} // end if import worked
} // end foreach playlist files
@@ -920,8 +929,10 @@ class Catalog {
$current_time = time();
if ($type != 'fast_add') {
- echo "\n" . _('Starting Album Art Search') . ". . .
\n";
- flush();
+ if ($verbose) {
+ echo "\n" . _('Starting Album Art Search') . ". . .
\n";
+ flush();
+ }
$this->get_album_art();
}
@@ -1118,17 +1129,19 @@ class Catalog {
@discussion Cleans the Catalog of files that no longer exist grabs from $this->id or $id passed
Doesn't actually delete anything, disables errored files, and returns them in an array
@param $catalog_id=0 Take the ID of the catalog you want to clean
- @param $action=0 Delete/Disable, default is disable
*/
- function clean_catalog($catalog_id=0,$action=0) {
+ function clean_catalog($catalog_id=0,$verbose=1) {
/* Define the Arrays we will need */
$dead_files = array();
if (!$catalog_id) { $catalog_id = $this->id; }
- echo "\nCleaning the [" . $this->name . "] Catalog...
\n";
- flush();
+ if ($verbose) {
+ echo "\n" . _('Cleaning the') . " [" . $this->name . "] " . _('Catalog') . "...
\n";
+ echo _('Checking') . ": \n
";
+ flush();
+ }
/* Get all songs in this catalog */
$sql = "SELECT id,file FROM song WHERE catalog='$catalog_id' AND enabled='1'";
@@ -1142,8 +1155,10 @@ class Catalog {
/* Stupid little cutesie thing */
$this->count++;
- if ( !($this->count%conf('catalog_echo_count')) ) {
- echo _('Checking') . " $this->count. . . .
\n";
+ if ( !($this->count%conf('catalog_echo_count')) && $verbose) {
+ echo "\n";
flush();
} //echos song count
@@ -1154,8 +1169,10 @@ class Catalog {
if (!file_exists($results->file) OR $file_info < 1) {
/* Add Error */
- echo "Error File Not Found or 0 Bytes: " . $results->file . "
";
- flush();
+ if ($verbose) {
+ echo "Error File Not Found or 0 Bytes: " . $results->file . "
";
+ flush();
+ }
/* Add this file to the list for removal from the db */
$dead_files[] = $results;
@@ -1169,22 +1186,9 @@ class Catalog {
if (count($dead_files)) {
foreach ($dead_files as $data) {
- //FIXME: Until I fix the form, assume delete
- //if ($action === 'delete_dead') {
- $sql = "DELETE FROM song WHERE id='$data->id'";
- //}
- //
- //else {
- // $sql = "UPDATE song SET status='disabled' WHERE id='$data->id'";
- //}
-
+ $sql = "DELETE FROM song WHERE id='$data->id'";
$db_results = mysql_query($sql, dbh());
- /* DB Error occured */
- if (!$db_results) {
- /* Add Error */
- } //if error
-
} //end foreach
} // end if dead files
@@ -1198,11 +1202,13 @@ class Catalog {
$this->clean_stats();
$this->clean_playlists();
$this->clean_flagged();
- ;$this->clean_genres();
+ $this->clean_genres();
/* Return dead files, so they can be listed */
- echo "" . _("Catalog Clean Done") . " [" . count($dead_files) . "] " . _("files removed") . "
\n";
- flush();
+ if ($verbose) {
+ echo "" . _("Catalog Clean Done") . " [" . count($dead_files) . "] " . _("files removed") . "
\n";
+ flush();
+ }
return $dead_files;
$this->count = 0;
@@ -1461,7 +1467,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='') {
+ function verify_catalog($catalog_id=0,$gather_type='',$verbose=1) {
/* Create and empty song for us to use */
$total_updated = 0;
@@ -1476,9 +1482,12 @@ class Catalog {
$db_results = mysql_query($sql, dbh());
$number = mysql_num_rows($db_results);
- echo _("Updating the") . " [ $this->name ] " . _("Catalog") . "
\n";
- echo $number . " " . _("songs found checking tag information.") . "
\n\n";
- flush();
+ if ($verbose) {
+ echo _("Updating the") . " [ $this->name ] " . _("Catalog") . "
\n";
+ echo $number . " " . _("songs found checking tag information.") . "
\n\n";
+ echo _('Verifed') . ": None
\n";
+ flush();
+ }
/* Magical Fix so we don't run out of time */
set_time_limit(0);
@@ -1550,7 +1559,9 @@ class Catalog {
/* Stupid little cutesie thing */
$this->count++;
if ( !($this->count%conf('catalog_echo_count')) ) {
- echo "Checked $this->count. . . .
\n";
+ echo "\n";
flush();
} //echos song count
diff --git a/lib/general.js b/lib/general.js
index e4611cd6..21db395e 100644
--- a/lib/general.js
+++ b/lib/general.js
@@ -265,6 +265,10 @@ function selectField(element)
}
}
+// function for the catalog mojo fluf
+function update_txt(value,field) {
+ document.getElementById(field).innerHTML=value;
+}
function popup_art(url) {
var newwindow;
diff --git a/lib/log.lib.php b/lib/log.lib.php
index d8e68014..d187fa60 100644
--- a/lib/log.lib.php
+++ b/lib/log.lib.php
@@ -30,6 +30,9 @@ function log_event($username='Unknown',$event_name,$event_description,$log_name=
/* Set it up here to make sure it's _always_ the same */
$log_time = time();
+ /* must have some name */
+ if (!strlen($log_name)) { $log_name = 'ampache'; }
+
$log_filename = conf('log_path') . "/$log_name." . date("Ymd",$log_time) . ".log";
$log_line = date("Y-m-d H:i:s",$log_time) . " { $username } ( $event_name ) - $event_description \n";
diff --git a/modules/init.php b/modules/init.php
index e94f3ba5..fe440eb3 100644
--- a/modules/init.php
+++ b/modules/init.php
@@ -80,7 +80,7 @@ if (!$results['allow_stream_playback']) {
/** This is the version.... fluf nothing more... **/
-$results['version'] = '3.3.2-Beta2 (Build 008)';
+$results['version'] = '3.3.2-Beta2 (Build 009)';
diff --git a/templates/header.inc b/templates/header.inc
index 0e8185f0..20118ea4 100644
--- a/templates/header.inc
+++ b/templates/header.inc
@@ -61,5 +61,5 @@ if (conf('use_rss')) { ?>
-
+
diff --git a/templates/show_admin_catalog.inc.php b/templates/show_admin_catalog.inc.php
new file mode 100644
index 00000000..43c11c56
--- /dev/null
+++ b/templates/show_admin_catalog.inc.php
@@ -0,0 +1,54 @@
+
+
diff --git a/templates/show_admin_index.inc b/templates/show_admin_index.inc
deleted file mode 100644
index 057aa9c1..00000000
--- a/templates/show_admin_index.inc
+++ /dev/null
@@ -1,46 +0,0 @@
- $web_path . "/admin/users.php",
- _("E-mail Management") => $web_path . "/admin/mail.php",
- _("Catalog Managment") => $web_path . "/admin/catalog.php",
- _("Admin Preferences") => $web_path . "/admin/preferences.php",
- _("Access Lists") => $web_path . "/admin/access.php");
-
-$common = array(_("Add a catalog") => $web_path . "/admin/catalog.php?action=show_add_catalog",
- _("Add a new user") => $web_path . "/admin/users.php?action=show_add_user",
- _("Clear Now Playing") => $web_path . "/admin/catalog.php?action=clear_now_playing",
- _("Add Access List Entry") => $web_path . "/admin/access.php?action=show_add_host");
-?>
-
-
diff --git a/templates/show_admin_user.inc.php b/templates/show_admin_user.inc.php
new file mode 100644
index 00000000..8269eb06
--- /dev/null
+++ b/templates/show_admin_user.inc.php
@@ -0,0 +1,27 @@
+
+
+
+
|