summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-10 07:14:38 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-10 07:14:38 +0000
commitdfcd869f3748132755de63db9e7eabb6dee41af1 (patch)
treebe3dd469962b3b40a7b0462492a44e6586e12e5f
parent9393b2afdf8e6222f06aec019f872c02c0a2c19f (diff)
downloadampache-dfcd869f3748132755de63db9e7eabb6dee41af1.tar.gz
ampache-dfcd869f3748132755de63db9e7eabb6dee41af1.tar.bz2
ampache-dfcd869f3748132755de63db9e7eabb6dee41af1.zip
tweaks the db updates and adds a few more charset translations to the db charset reset function
-rw-r--r--bin/migrate_config.inc2
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/catalog.class.php5
-rw-r--r--lib/class/dba.class.php19
-rw-r--r--lib/class/update.class.php34
5 files changed, 50 insertions, 12 deletions
diff --git a/bin/migrate_config.inc b/bin/migrate_config.inc
index 4559f9c4..80d95bc8 100644
--- a/bin/migrate_config.inc
+++ b/bin/migrate_config.inc
@@ -1,7 +1,7 @@
<?php
/*
- Copyright 2001 - 2007 Ampache.org
+ Copyright Ampache.org
All Rights Reserved
This program is free software; you can redistribute it and/or
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 09c14751..ca4f8704 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.4
+ - Fixed an issue where the prefixes on albums were not being included
+ when checking for an existing album.
- Fixed get recently played not correctly limiting to specified user
(Thx Xgizzmo)
- Fixed lack of refresh of controls when switching between localplay
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index c6d3e1a0..72a24b5f 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1915,11 +1915,8 @@ class Catalog {
/* If not found create */
elseif (!$readonly) {
- $prefix_txt = 'NULL';
- if ($prefix) {
- $prefix_txt = "'$prefix'";
- }
+ $prefix_txt = $prefix ? "'$prefix'" : 'NULL';
$sql = "INSERT INTO `album` (`name`, `prefix`,`year`,`disk`) VALUES ('$album',$prefix_txt,'$album_year','$album_disk')";
$db_results = Dba::query($sql);
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php
index 6ead8b8b..62df46fe 100644
--- a/lib/class/dba.class.php
+++ b/lib/class/dba.class.php
@@ -262,6 +262,21 @@ class Dba {
// MySQL translte real charset names into fancy smancy MySQL land names
switch (strtoupper(Config::get('site_charset'))) {
+ case 'CP1250':
+ case 'WINDOWS-1250':
+ case 'WINDOWS-1252':
+ $target_charset = 'cp1250';
+ $target_collation = 'cp1250_general_ci';
+ break;
+ case 'ISO-8859':
+ case 'ISO-8859-2':
+ $target_charset = 'latin2';
+ $target_collation = 'latin2_general_ci';
+ break;
+ case 'ISO-8859-1':
+ $target_charset = 'latin1';
+ $target_charset = 'latin1_general_ci';
+ break;
case 'EUC-KR':
$target_charset = 'euckr';
$target_collation = 'euckr_korean_ci';
@@ -278,10 +293,6 @@ class Dba {
$target_charset = 'koi8r';
$target_collation = 'koi8r_general_ci';
break;
- case 'ISO-8859':
- $target_charset = 'latin2';
- $target_collation = 'latin2_general_ci';
- break;
default;
case 'UTF-8':
$target_charset = 'utf8';
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 1a96b978..23fac871 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -269,10 +269,11 @@ class Update {
$version[] = array('version' => '340016','description'=>$update_string);
- $update_string = '- Attempt to correct the charset of all columns in the database.<br />';
+ $update_string = '- Fix Tables for new Democratic Play methodology.<br />';
$version[] = array('version' => '340017','description'=>$update_string);
+
return $version;
} // populate_version
@@ -1206,9 +1207,36 @@ class Update {
$sql = "TRUNCATE `democratic`";
$db_results = Dba::query($sql);
+
+ self::set_version('db_version','340017');
+
+ } // update_340017
+
+ /**
+ * update_340018
+ * This attempts to correct the charset on your database, it does some checking
+ * to make sure that if we do this it will actually will work. We will fail this update
+ * if it would cause problems
+ */
+ public static function update_340018() {
// MySQL translte real charset names into fancy smancy MySQL land names
switch (strtoupper(Config::get('site_charset'))) {
+ case 'CP1250':
+ case 'WINDOWS-1250':
+ case 'WINDOWS-1252':
+ $target_charset = 'cp1250';
+ $target_collation = 'cp1250_general_ci';
+ break;
+ case 'ISO-8859':
+ case 'ISO-8859-2':
+ $target_charset = 'latin2';
+ $target_collation = 'latin2_general_ci';
+ break;
+ case 'ISO-8859-1':
+ $target_charset = 'latin1';
+ $target_charset = 'latin1_general_ci';
+ break;
case 'EUC-KR':
$target_charset = 'euckr';
$target_collation = 'euckr_korean_ci';
@@ -1265,9 +1293,9 @@ class Update {
} // end tables
- self::set_version('db_version','340017');
+ //self::set_version('db_version','340018');
- } // update_340017
+ } // update_340018
} // end update class
?>