summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-03-06 04:55:19 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-03-06 04:55:19 +0000
commit84b483c99a32452dc53b9b77fdf818c710bcd5d3 (patch)
tree62aa6939acb5434bb530d327f78ba3329b146fb7
parent2c337852cff31297d681fb87d3098cc3d9041101 (diff)
downloadampache-84b483c99a32452dc53b9b77fdf818c710bcd5d3.tar.gz
ampache-84b483c99a32452dc53b9b77fdf818c710bcd5d3.tar.bz2
ampache-84b483c99a32452dc53b9b77fdf818c710bcd5d3.zip
fixed playlist update on full strict of mysql5.x and jpg mime type
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--image.php2
-rw-r--r--lib/class/album.class.php6
-rw-r--r--lib/class/update.class.php11
-rw-r--r--lib/class/user.class.php2
-rw-r--r--lib/init.php1
-rw-r--r--server/playlist.ajax.php1
-rw-r--r--util.php1
8 files changed, 16 insertions, 11 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 57ebdd43..00f91a9b 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,9 @@
--------------------------------------------------------------------------
v.3.4-Beta2
+ - DB Update, fixes the playlist create issue with full strict on
+ MySQL 5.x
+ - Corrected mime type for JPG (Thx CoF)
- Added Catalog Last Update and Last Add times to API Handshake.
- Fixed Remember Me Cookie so it's actually set
- Removed some invalid queries that were not needed, tweaked logic
diff --git a/image.php b/image.php
index 1120329d..55444ee4 100644
--- a/image.php
+++ b/image.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 Ampache.org
+ Copyright (c) 2001 - 2008 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index a4c9601b..c74bd800 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -453,6 +453,8 @@ class Album {
/* If it's an image file */
if ($extension == "jpg" || $extension == "gif" || $extension == "png" || $extension == "jp2") {
+ if ($extension == 'jpg') { $extension = 'jpeg'; }
+
// HACK ALERT this is to prevent duplicate filenames
$full_filename = $dir . '/' . $file;
$index = md5($full_filename);
@@ -633,7 +635,7 @@ class Album {
// Rudimentary image type detection, only JPG and GIF allowed.
if (substr($result[$key], -4 == '.jpg')) {
- $mime = "image/jpg";
+ $mime = "image/jpeg";
}
elseif (substr($result[$key], -4 == '.gif')) {
$mime = "image/gif";
@@ -763,7 +765,7 @@ class Album {
} // if we have PHP:GD
// Default to image/jpg as a guess if there is no passed mime type
- $mime = $mime ? $mime : 'image/jpg';
+ $mime = $mime ? $mime : 'image/jpeg';
// Push the image into the database
$sql = "REPLACE INTO `album_data` SET `art` = '" . Dba::escape($image) . "'," .
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 9e902d52..66322cd7 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -259,10 +259,9 @@ class Update {
$version[] = array('version' => '340014','description'=>$update_string);
$update_string = '- Alter Playlist Date Field to fix issues with some MySQL configurations.<br />' .
- '- Add Index to Album_Data to improve album art random performance.<br />' .
'- Alter Rating type to correct AVG issue on searching.<br />';
- //$version[] = array('version' => '340015','description'=>$update_string);
+ $version[] = array('version' => '340015','description'=>$update_string);
return $version;
@@ -1132,15 +1131,15 @@ class Update {
*/
public static function update_340015() {
- $sql = "ALTER TABLE `playlist` CHANGE `date` `date` INT ( 11 ) UNSIGNED NOT NULL";
+ $sql = "ALTER TABLE `playlist` DROP `date`";
+ $db_results = Dba::query($sql);
+
+ $sql = "ALTER TABLE `playlist` ADD `date` INT ( 11 ) UNSIGNED NOT NULL";
$db_results = Dba::query($sql);
$sql = "ALTER TABLE `rating` CHANGE `rating` TINYINT ( 4 ) NOT NULL";
$db_results = Dba::query($sql);
-// $sql = "ALTER TABLE `user` CHANGE `validation` VARCHAR ( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL";
-// $db_results = Dba::query($sql);
-
self::set_version('db_version','340015');
} // update_340015
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 817f81ba..ad5c20f3 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -522,6 +522,8 @@ class User {
return false;
}
+ $this->set_preferences();
+
// Check if lastfm is loaded, if so run the update
if (Plugin::is_installed('Last.FM')) {
$lastfm = new Plugin('Lastfm');
diff --git a/lib/init.php b/lib/init.php
index f63c3add..5fe7448e 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -144,7 +144,6 @@ require_once $prefix . '/modules/infotools/openstrands.class.php';
$results = Preference::fix_preferences($results);
Config::set_by_array($results,1);
-debug_event('ZZWANG IS',$wang,'1');
// Modules (These are conditionaly included depending upon config values)
if (Config::get('ratings')) {
diff --git a/server/playlist.ajax.php b/server/playlist.ajax.php
index f5904bd6..bfd32967 100644
--- a/server/playlist.ajax.php
+++ b/server/playlist.ajax.php
@@ -50,6 +50,7 @@ switch ($_REQUEST['action']) {
// generate the new playlist
$playlist_id = Playlist::create($name,'public');
+ if (!$playlist_id) { break; }
$playlist = new Playlist($playlist_id);
// Itterate through and add them to our new playlist
diff --git a/util.php b/util.php
index 2066babe..28bbabaf 100644
--- a/util.php
+++ b/util.php
@@ -18,7 +18,6 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-$wang = 'util';
require_once 'lib/init.php';
header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT");