From b7436c2fba721bdb0f1cccd85c0331df4fe6fab1 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 4 Nov 2005 06:57:01 +0000 Subject: added debug to catalog update process --- lib/class/catalog.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 11085bf8..7b96b9df 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -797,6 +797,9 @@ class Catalog { */ function update_song_from_tags($song) { + + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' update-check ',"Starting work on $song->file",'ampache-catalog'); } + $info = new Audioinfo(); $results = $info->Info($song->file); @@ -843,8 +846,12 @@ class Catalog { $info = $song->compare_song_information($song,$new_song); if ($info['change']) { + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' update ',"$song->file difference found, updating database",'ampache-catalog'); } $song->update_song($song->id,$new_song); } + else { + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' update ',"$song->file no difference found returning",'ampache-catalog'); } + } return $info; @@ -1447,8 +1454,11 @@ class Catalog { */ while ($results = mysql_fetch_object($db_results)) { + /* Create the object from the existing database information */ $song = new Song($results->id); + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' verify ',"Starting work on $song->file",'ampache-catalog'); } + if (is_readable($song->file)) { unset($skip); @@ -1497,6 +1507,10 @@ class Catalog { } // end skip + if ($skip) { + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' skip ',"$song->file has been skipped due to newer local update or file mod time",'ampache-catalog'); } + } + /* Stupid little cutesie thing */ $this->count++; if ( !($this->count%conf('catalog_echo_count')) ) { @@ -1510,6 +1524,9 @@ class Catalog { echo "
\n
  • "; echo "$song->file does not exist or is not readable\n"; echo "
  • \n
    \n
    \n"; + + if (conf('debug')) { log_event($_SESSION['userdata']['username'],' read-error ',"$song->file does not exist or is not readable",'ampache-catalog'); } + // Should we remove it from catalog? } -- cgit