1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

Added missing artist results

Searching for missing artists now returns a simple list of artist names,
and a link to view their missing albums.
This commit is contained in:
Jason Bray 2014-12-22 00:05:49 -05:00
parent ed70ccffbc
commit 8f88c10f01
3 changed files with 58 additions and 1 deletions

View file

@ -111,6 +111,10 @@ require_once $prefix . '/modules/musicbrainz/MusicBrainz.php';
require_once $prefix . '/modules/musicbrainz/Exception.php';
require_once $prefix . '/modules/musicbrainz/Clients/MbClient.php';
require_once $prefix . '/modules/musicbrainz/Clients/RequestsMbClient.php';
require_once $prefix . '/modules/musicbrainz/Artist.php';
require_once $prefix . '/modules/musicbrainz/Filters/AbstractFilter.php';
require_once $prefix . '/modules/musicbrainz/Filters/FilterInterface.php';
require_once $prefix . '/modules/musicbrainz/Filters/ArtistFilter.php';
require_once $prefix . '/modules/ampacheapi/AmpacheApi.lib.php';
require_once $prefix . '/modules/EchoNest/Autoloader.php';

View file

@ -38,7 +38,9 @@ switch ($_REQUEST['action']) {
$browse->show_objects($results);
$browse->store();
} else {
echo '<a href="http://musicbrainz.org/search?query=' . rawurlencode($_REQUEST['rule_1_input']) . '&type=artist&method=indexed" target="_blank">' . T_('Search on MusicBrainz') . '</a><br />';
$wartists = Wanted::search_missing_artists($_REQUEST['rule_1_input']);
require_once AmpConfig::get('prefix') . '/templates/show_missing_artists.inc.php';
echo '<a href="http://musicbrainz.org/search?query=' . rawurlencode($_REQUEST['rule_1_input']) . '&type=artist&method=indexed" target="_blank">' . T_('View on MusicBrainz') . '</a><br />';
}
break;
case 'save_as_track':

View file

@ -0,0 +1,51 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
?>
<?php UI::show_box_top(T_('Missing Artists'), 'info-box'); ?>
<table class="tabledata" cellpadding="0" cellspacing="0">
<thead>
<tr class="th-top">
<th class="cel_artist"><?php echo T_('Artist'); ?></th>
</tr>
</thead>
<tbody>
<?php
if ($wartists) {
foreach ($wartists as $libitem) {
?>
<tr id="wartist_<?php echo $libitem['mbid']; ?>" class="<?php echo UI::flip_class(); ?>">
<td class="cel_artist">
<a href="<?php echo $web_path; ?>/artists.php?action=show_missing&amp;mbid=<?php echo $libitem['mbid']; ?>"><?php echo $libitem['name']; ?></a>
</td>
</tr>
<?php
}
}
?>
<?php if (!$wartists || !count($wartists)) { ?>
<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="<?php echo $thcount; ?>"><span class="nodata"><?php echo T_('No missing artists found'); ?></span></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php UI::show_box_bottom(); ?>