summaryrefslogtreecommitdiffstats
path: root/albums.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-07 20:35:49 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-07 20:35:49 +0000
commitb6cfe134badb2d4393e9081b13b2dfca011ed736 (patch)
tree4f6213e626fa90b4b280b5e663e791559c4a7f8f /albums.php
parent90d2acbc54b24b6e8207e12f1cabcbc7541ca447 (diff)
downloadampache-b6cfe134badb2d4393e9081b13b2dfca011ed736.tar.gz
ampache-b6cfe134badb2d4393e9081b13b2dfca011ed736.tar.bz2
ampache-b6cfe134badb2d4393e9081b13b2dfca011ed736.zip
* Re-worked Main page of Ampache, adding Album of the moment.
* Moved stats to /stats.php page * Fixed logic error in resize that could cause nothign to display if resize was on, but it still failed * Fixed Upload Album art from Find Album Art * Added Menu to the TV page * Fixed logic error that showed localplay if user had access regardless of global config * Changed default action of browse.php to song browse
Diffstat (limited to 'albums.php')
-rw-r--r--albums.php31
1 files changed, 27 insertions, 4 deletions
diff --git a/albums.php b/albums.php
index 266ab9aa..69396bc3 100644
--- a/albums.php
+++ b/albums.php
@@ -85,12 +85,29 @@ switch ($action) {
break;
case 'find_art':
-
+
+ // If not a user then kick em out
if (!$GLOBALS['user']->has_access('25')) { access_denied(); exit; }
-
+
// get the Album information
$album = new Album($_REQUEST['album_id']);
+ // If we've got an upload ignore the rest and just insert it
+ if (!empty($_FILES['file']['tmp_name'])) {
+ $path_info = pathinfo($_FILES['file']['name']);
+ $upload['file'] = $_FILES['file']['tmp_name'];
+ $upload['mime'] = 'image/' . $path_info['extension'];
+ $image_data = get_image_from_source($upload);
+
+ if ($image_data) {
+ $album->insert_art($image_data,$upload['0']['mime']);
+ show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=" . $_REQUEST['album_id']);
+ break;
+
+ } // if image data
+
+ } // if it's an upload
+
// Build the options for our search
if (isset($_REQUEST['artist_name'])) {
$artist = scrub_in($_REQUEST['artist_name']);
@@ -108,13 +125,19 @@ switch ($action) {
$options['artist'] = $artist;
$options['album_name'] = $album_name;
$options['keyword'] = $artist . " " . $album_name;
- $options['url'] = $_REQUEST['cover'];
// HACK that makes baby jesus cry...
$options['skip_id3'] = true;
// Attempt to find the art.
$images = $album->find_art($options,'6');
+ if (isset($_REQUEST['cover'])) {
+ $path_info = pathinfo($_REQUEST['cover']);
+ $cover_url[0]['url'] = scrub_in($_REQUEST['cover']);
+ $cover_url[0]['mime'] = 'image/' . $path_info['extension'];
+ }
+ $images = array_merge($cover_url,$images);
+
// We don't want to store raw's in here so we need to strip them out into a seperate array
foreach ($images as $index=>$image) {
if (isset($image['raw'])) {
@@ -155,8 +178,8 @@ switch ($action) {
$album = new Album($album_id);
$album->insert_art($image,$mime);
- show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=$album_id");
+ show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=$album_id");
break;
case 'update_from_tags':