aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2011-10-18 22:41:25 +0200
committerBrice Maron <brice@bmaron.net>2011-10-18 22:41:25 +0200
commitb15d8878b7f2084dc5bc441911a86799379a6cbd (patch)
tree9c7b4fa0795f9b5ed2281b544aa6d67dc2b91c6e
parent29368d1c58d1c52420f46cf41a1b975a23751814 (diff)
downloadnextcloud-server-b15d8878b7f2084dc5bc441911a86799379a6cbd.tar.gz
nextcloud-server-b15d8878b7f2084dc5bc441911a86799379a6cbd.zip
Correct use of null for not null columns in media scanner
-rw-r--r--apps/media/lib_collection.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php
index 82c4afedd0a..54e317df930 100644
--- a/apps/media/lib_collection.php
+++ b/apps/media/lib_collection.php
@@ -43,7 +43,7 @@ class OC_MEDIA_COLLECTION{
if(isset(self::$artistIdCache[$name])){
return self::$artistIdCache[$name];
}else{
- $query=OC_DB::prepare("SELECT artist_id FROM *PREFIX*media_artists WHERE artist_name LIKE ?");
+ $query=OC_DB::prepare("SELECT artist_id FROM *PREFIX*media_artists WHERE lower(artist_name) LIKE ?");
$artists=$query->execute(array($name))->fetchAll();
if(is_array($artists) and isset($artists[0])){
self::$artistIdCache[$name]=$artists[0]['artist_id'];
@@ -146,7 +146,7 @@ class OC_MEDIA_COLLECTION{
if($artistId!=0){
return $artistId;
}else{
- $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_artists` (`artist_id` ,`artist_name`) VALUES (NULL , ?)");
+ $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_artists` (`artist_name`) VALUES (?)");
$result=$query->execute(array($name));
return self::getArtistId($name);;
}
@@ -193,7 +193,7 @@ class OC_MEDIA_COLLECTION{
if($albumId!=0){
return $albumId;
}else{
- $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_albums` (`album_id` ,`album_name` ,`album_artist`) VALUES (NULL , ?, ?)");
+ $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_albums` (`album_name` ,`album_artist`) VALUES ( ?, ?)");
$query->execute(array($name,$artist));
return self::getAlbumId($name,$artist);
}