We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 846c6d24 authored by P. J. McDermott's avatar P. J. McDermott

Catch one last Exception from Artist::__construct().

Instead of returning a white screen of death with an uncaught exception
message, omit artist information from the XML document when the artist
of a loved or banned track can't be found. This should also resolve
issue #209, though a more thorough analysis of the cause should be done.
parent 0f997f1b
......@@ -232,16 +232,18 @@ class UserXML {
private static function _addLBTrackDetails($track_node, $row) {
$track = new Track($row['track'], $row['artist']);
$artist = new Artist($row['artist']);
$track_node->addChild('name', repamp($track->name));
$track_node->addChild('mbid', $track->mbid);
$track_node->addChild('url', $track->getURL());
$date = $track_node->addChild('date', gmdate("d M Y H:i",$row['time']) . " GMT");
$date->addAttribute('uts', $row['time']);
$artist_node = $track_node->addChild('artist', null);
$artist_node->addChild('name', repamp($artist->name));
$artist_node->addChild('mbid', $artist->mbid);
$artist_node->addChild('url', $artist->getURL());
try {
$artist = new Artist($row['artist']);
$artist_node = $track_node->addChild('artist', null);
$artist_node->addChild('name', repamp($artist->name));
$artist_node->addChild('mbid', $artist->mbid);
$artist_node->addChild('url', $artist->getURL());
} catch (Exception $e) {}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment