diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-09 17:56:34 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-09 17:56:34 +0000 |
commit | 4b5713c9b0b897afbdc2c29110d948bd62244569 (patch) | |
tree | 4d23bc189011795db07c8eea4df784e2cd8166b4 /albums.php | |
parent | 2b12112868cce750e83a015cb581d376f08a873b (diff) | |
download | ampache-4b5713c9b0b897afbdc2c29110d948bd62244569.tar.gz ampache-4b5713c9b0b897afbdc2c29110d948bd62244569.tar.bz2 ampache-4b5713c9b0b897afbdc2c29110d948bd62244569.zip |
added ability to specify custom album art search options
Diffstat (limited to 'albums.php')
-rw-r--r-- | albums.php | 44 |
1 files changed, 25 insertions, 19 deletions
@@ -66,36 +66,42 @@ elseif (isset($album)) { elseif ($_REQUEST['action'] === 'find_art') { if (!$user->has_access('25')) { access_denied(); } + + // csammis: In response to https://ampache.bountysource.com/Task.View?task_id=86, + // adding retry to album art searching. I hope my PHP style doesn't make vollmer cry, + // because that would make me cry...then my girlfriend would cry...then my cat would laugh. + // She's such a little trouper! + /* Echo notice if no amazon token is found, but it's enabled */ if (in_array('amazon',conf('album_art_order')) AND !conf('amazon_developer_key')) { - echo "<br /><div class=\"fatalerror\">Error: No Amazon Developer Key set, amazon album art searching will not work</div>"; + echo "<br /><div class=\"fatalerror\">" . _("Error") . ": " . _("No Amazon Developer Key set, amazon album art searching will not work") . "</div>"; } + // get the Album information $album = new Album($_REQUEST['album_id']); - $result = $album->find_art($_REQUEST['cover']); + + // Attempt to find the art with what we've got + $result = $album->find_art($_REQUEST['cover'], $_REQUEST['artist_name'], $_REQUEST['album_name']); + if ($result) { show_confirmation(_("Album Art Located"),_("Album Art information has been located in Amazon. If incorrect, click \"Reset Album Art\" below to remove the artwork."),"/albums.php?action=show&album=" . $album->id); echo " [ <a href=\"" . conf('web_path') . "/albums.php?action=clear_art&album_id=" . $album->id . "\">Reset Album Art</a> ]"; echo "<p align=left><img src=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "\" /></p>"; - echo "<form name=\"coverart\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">"; - echo "Enter URL to album art "; - echo "<input type=\"text\" size=\"40\" id=\"cover\" name=\"cover\" value=\"\" />\n"; - echo "<input type=\"hidden\" name=\"action\" value=\"find_art\" />\n"; - echo "<input type=\"hidden\" name=\"album_id\" value=\"$album->id\" />\n"; - echo "<input type=\"submit\" value=\"" . _("Get Art") . "\" />\n"; - echo "</form>"; - } - else { - show_confirmation(_("Album Art Not Located"),_("Album Art could not be located at this time. This may be due to Amazon being busy, or the album not being present in their collection."),"/albums.php?action=show&album=" . $album->id); - echo "<form name=\"coverart\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">"; - echo "Enter URL to album art "; - echo "<input type=\"text\" size=\"40\" id=\"cover\" name=\"cover\" value=\"\" />"; - echo "<input type=\"hidden\" name=\"action\" value=\"find_art\" />"; - echo "<input type=\"hidden\" name=\"album_id\" value=\"$album->id\" /> "; - echo "<input type=\"submit\" value=\"" . _("Get Art") . "\" />\n"; - echo "</form>"; } + else { + show_confirmation(_("Album Art Not Located"),_("Album Art could not be located at this time. This may be due to Amazon being busy, or the album not being present in their collection."),"/albums.php?action=show&album=" . $album->id); + } + + $albumname = $album->name; + $artistname = $album->artist; + + // Remember the last typed entry, if there was one + if (isset($_REQUEST['album_name'])) { $albumname = scrub_in($_REQUEST['album_name']); } + if (isset($_REQUEST['artist_name'])) { $artistname = scrub_in($_REQUEST['artist_name']); } + + include(conf('prefix') . '/templates/show_get_albumart.inc.php'); + } // find_art // Updates Album from tags |