diff --git a/controllers/PushServer.php b/controllers/PushServer.php index 8ef5a321..97a32d25 100644 --- a/controllers/PushServer.php +++ b/controllers/PushServer.php @@ -228,6 +228,7 @@ public function onOpen(ConnectionInterface $conn) { * @returns false iff communications error, result otherwise (can be empty) */ protected function queryDiscogs($artist, $album = null) { + $artist = preg_replace('/(^The\s)|(,\sThe$)/', '', $artist); $success = true; $retval = new \stdClass(); $retval->imageUrl = $retval->infoUrl = $retval->resourceUrl = null; @@ -331,6 +332,7 @@ protected function queryDiscogsArtistByAlbum($artist, $album) { if($json) { $artists = $json->artists ?? null; + $artist = preg_replace('/(^The\s)|(,\sThe$)/', '', $artist); if($artists && count($artists)) { foreach($artists as $candidate) { if(self::testArtist($candidate->name, $artist)) {