summaryrefslogtreecommitdiffstats
path: root/lib/song.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/song.php')
-rw-r--r--lib/song.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/song.php b/lib/song.php
index 81095cc1..5156ca88 100644
--- a/lib/song.php
+++ b/lib/song.php
@@ -96,17 +96,11 @@ function get_song_id_from_file($filename) {
$filename = sql_escape($filename);
- $sql = "SELECT id FROM song WHERE file='$filename'";
+ $sql = "SELECT id FROM song WHERE file LIKE '%$filename'";
$db_results = mysql_query($sql, dbh());
$results = mysql_fetch_assoc($db_results);
- if (!$results['id']) {
- $sql = "SELECT id FROM song WHERE file='%$filename%'";
- $db_results = mysql_query($sql, dbh());
- $results = mysql_fetch_assoc($db_results);
- }
-
return $results['id'];
} // get_song_id_from_file