[vlc-commits] sql_ml: wrong album update predicate.

Francois Cartegnie git at videolan.org
Tue Sep 4 21:14:59 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep  4 21:10:55 2012 +0200| [720f0f1bae9572f45984febde729849f6f30e822] | committer: Francois Cartegnie

sql_ml: wrong album update predicate.

If psz_album is NULL you have no data to insert.
If you have an id then the value is already in database and only empty
string can erase it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=720f0f1bae9572f45984febde729849f6f30e822
---

 modules/media_library/sql_update.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/media_library/sql_update.c b/modules/media_library/sql_update.c
index 724ac6e..b75f919 100644
--- a/modules/media_library/sql_update.c
+++ b/modules/media_library/sql_update.c
@@ -446,7 +446,7 @@ int BuildUpdate( media_library_t *p_ml,
 exitfor:
 
     /* TODO: Album artist. Verify albumart */
-    if( i_album_id <= 0 || ( psz_album && *psz_album ) )
+    if( i_album_id <= 0 && psz_album )
     {
         i_album_id = ml_GetAlbumId( p_ml, psz_album );
         if( i_album_id < 0 ) //0 is Unknown



More information about the vlc-commits mailing list