diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-03 05:26:24 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-03 05:26:24 +0000 |
commit | 98fef66fec24524e308add41e9af1177238981ed (patch) | |
tree | b7bf683dd1add65d5b0f30f180511d07e2300e59 | |
parent | 7bd22a36da9ae7ac654874bde0ac7f4327d96beb (diff) | |
download | ampache-98fef66fec24524e308add41e9af1177238981ed.tar.gz ampache-98fef66fec24524e308add41e9af1177238981ed.tar.bz2 ampache-98fef66fec24524e308add41e9af1177238981ed.zip |
fixed some album art issues and an issue with downloads if no catalog pattern
-rwxr-xr-x | docs/CHANGELOG | 4 | ||||
-rw-r--r-- | lib/class/album.class.php | 13 | ||||
-rw-r--r-- | lib/class/song.class.php | 9 | ||||
-rw-r--r-- | lib/init.php | 2 |
4 files changed, 21 insertions, 7 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 17543d55..5f65fd4c 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,10 @@ -------------------------------------------------------------------------- v.3.4 + - Fixed album art thumbs never saving due to incorrect table reference + - Fixed download having no filename if no catalog pattern + - Fixed issue where 0 sized images could be inserted into the database + artifically inflating its size - Added Playlist and Genre Counts to the XMLAPI Handshake - Added ability to Add Search Results to playlist, or download if batch download is enabled diff --git a/lib/class/album.class.php b/lib/class/album.class.php index ae96e61e..5c810ca6 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -758,13 +758,16 @@ class Album { // Check for PHP:GD and if we have it make sure this image is of some size if (function_exists('ImageCreateFromString')) { - $im = @ImageCreateFromString($image); - if (@imagesx($im) == 1 || @imagesy($im) == 1 && $im) { + $im = ImageCreateFromString($image); + if (imagesx($im) <= 5 || imagesy($im) <= 5 || !$im) { return false; } } // if we have PHP:GD + elseif (strlen($image) < 5) { + return false; + } - // Default to image/jpg as a guess if there is no passed mime type + // Default to image/jpeg as a guess if there is no passed mime type $mime = $mime ? $mime : 'image/jpeg'; // Push the image into the database @@ -791,8 +794,8 @@ class Album { $mime = Dba::escape($mime); $album = Dba::escape($album); - $sql = "UPDATE `album` SET `thumb`='$data',`thumb_mime`='$mime' " . - "WHERE `album`.`id`='$album'"; + $sql = "UPDATE `album_data` SET `thumb`='$data',`thumb_mime`='$mime' " . + "WHERE `album_data`.`album_id`='$album'"; $db_results = Dba::query($sql); } // save_resized_art diff --git a/lib/class/song.class.php b/lib/class/song.class.php index ae3e8c08..4a5b5258 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -728,10 +728,17 @@ class Song { * rename patterns */ public function format_pattern() { + + $extension = ltrim(substr($this->file,strlen($this->file)-4,4),"."); $catalog = new Catalog($this->catalog); - $extension = ltrim(substr($this->file,strlen($this->file)-4,4),"."); + // If we don't have a rename pattern then just return it + if (!trim($catalog->rename_pattern)) { + $this->f_pattern = $this->title; + $this->f_file = $this->title . '.' . $extension; + return; + } /* Create the filename that this file should have */ $album = $this->f_album_full; diff --git a/lib/init.php b/lib/init.php index f68c3eb7..f53b81ec 100644 --- a/lib/init.php +++ b/lib/init.php @@ -81,7 +81,7 @@ if (!count($results)) { } /** This is the version.... fluf nothing more... **/ -$results['version'] = '3.4-Beta3'; +$results['version'] = '3.4-RC1'; $results['int_config_version'] = '6'; $results['raw_web_path'] = $results['web_path']; |