summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-10 09:11:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-10 09:11:22 +0000
commit65912668d225fd72a8efb9f73520609523be400b (patch)
treef90972e0bf112b21e460d5d870ecf7d4af486b98 /lib/class
parentdfcd869f3748132755de63db9e7eabb6dee41af1 (diff)
downloadampache-65912668d225fd72a8efb9f73520609523be400b.tar.gz
ampache-65912668d225fd72a8efb9f73520609523be400b.tar.bz2
ampache-65912668d225fd72a8efb9f73520609523be400b.zip
decided to not try to detect the charset, its just such a pain in the ass and I have no figured out a way to actually get it right, reduced frequency of prune calls to speed up login
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/error.class.php34
-rw-r--r--lib/class/tmpplaylist.class.php9
-rw-r--r--lib/class/update.class.php41
3 files changed, 60 insertions, 24 deletions
diff --git a/lib/class/error.class.php b/lib/class/error.class.php
index 61202532..13f96882 100644
--- a/lib/class/error.class.php
+++ b/lib/class/error.class.php
@@ -1,21 +1,23 @@
<?php
/*
-Copyright (c) 2001 - 2007 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 v2
-as published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANT ABILITY 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.
+
+ Copyright (c) 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 v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANT ABILITY 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.
+
*/
/**
diff --git a/lib/class/tmpplaylist.class.php b/lib/class/tmpplaylist.class.php
index 050d6211..a0654a2a 100644
--- a/lib/class/tmpplaylist.class.php
+++ b/lib/class/tmpplaylist.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 Ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -213,8 +213,11 @@ class tmpPlaylist {
$id = Dba::insert_id();
- /* Prune dead tmp_playlists */
- self::prune_playlists();
+ $do_prune = rand(0,4);
+ if ($do_prune%2) {
+ self::prune_playlists();
+ self::prune_tracks();
+ }
/* Clean any other playlists assoicated with this session */
self::delete($sessid,$id);
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 23fac871..6e846c44 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -273,6 +273,10 @@ class Update {
$version[] = array('version' => '340017','description'=>$update_string);
+ $update_string = '- Attempt to detect and correct charset issues between filesystem and database.<br />';
+
+ $version[] = array('version' => '340018','description'=>$update_string);
+
return $version;
@@ -324,8 +328,6 @@ class Update {
// Prevent the script from timing out, which could be bad
set_time_limit(0);
-
-
/* Verify that there are no plugins installed
//FIXME: provide a link to remove all plugins, otherwise this could turn into a catch 22
if (!$self::plugins_installed()) {
@@ -359,7 +361,13 @@ class Update {
if ($version['version'] > $current_version) {
$update_function = "update_" . $version['version'];
if (in_array($update_function,$methods)) {
- call_user_func(array('Update',$update_function));
+ $success = call_user_func(array('Update',$update_function));
+
+ // If the update fails drop out
+ if (!$success) {
+ Error::display('update');
+ return false;
+ }
}
}
@@ -721,6 +729,8 @@ class Update {
self::set_version('db_version','340003');
+ return true;
+
} // update_340003
/**
@@ -959,6 +969,8 @@ class Update {
self::set_version('db_version','340008');
+ return true;
+
} // update_340008
/**
@@ -988,6 +1000,8 @@ class Update {
self::set_version('db_version','340009');
+ return true;
+
} // update_340009
/**
@@ -1023,6 +1037,8 @@ class Update {
self::set_version('db_version','340010');
+ return true;
+
} // update_340010
/**
@@ -1045,9 +1061,10 @@ class Update {
") ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
$db_results = Dba::query($sql);
-
self::set_version('db_version','340011');
+ return true;
+
} // 340011
/**
@@ -1077,6 +1094,8 @@ class Update {
self::set_version('db_version','340012');
+ return true;
+
} // update_340012
/**
@@ -1107,6 +1126,8 @@ class Update {
self::set_version('db_version','340013');
+ return true;
+
} // update_340013
/**
@@ -1132,6 +1153,8 @@ class Update {
self::set_version('db_version','340014');
+ return true;
+
} // update_340014
/**
@@ -1172,6 +1195,8 @@ class Update {
}
self::set_version('db_version','340015');
+
+ return true;
} // update_340015
@@ -1187,6 +1212,8 @@ class Update {
self::set_version('db_version','340016');
+ return true;
+
} // update_340016
/**
@@ -1210,6 +1237,8 @@ class Update {
self::set_version('db_version','340017');
+ return true;
+
} // update_340017
/**
@@ -1293,7 +1322,9 @@ class Update {
} // end tables
- //self::set_version('db_version','340018');
+ self::set_version('db_version','340018');
+
+ return true;
} // update_340018