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

Commit cb4167c1 authored by mattl's avatar mattl

add despamified track name function

parent 25ee5cdd
......@@ -76,6 +76,8 @@ function createAlbumIfNew($artist, $album) {
function createTrackIfNew($artist, $album, $track, $mbid) {
global $mdb2;
$track = NoSpamTracks($track);
$res = $mdb2->query("SELECT name FROM Track WHERE name = " . ($track) . " AND artist = " . ($artist));
if(PEAR::isError($res)) {
die("FAILED " . $res->getMessage());
......@@ -93,4 +95,16 @@ function createTrackIfNew($artist, $album, $track, $mbid) {
}
}
}
function NoSpamTracks ($track) {
// This function exists to remove things like '(PREVIEW: buy it at www.magnatune.com)' from track names.
$track = str_replace("(PREVIEW: buy it at www.magnatune.com)", "", $track);
return $track;
}
?>
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