Commits

mackx committed 4098dd0 Draft

Missing part for negative filtering

  • Participants
  • Parent commits 177b7fe

Comments (0)

Files changed (1)

File libs/ermetadb/src/ermetadb_file.c

             }
             else if (strlen(tag_array[i]) >= 2)
             {
-                sprintf(tag_query, "tag LIKE '%%%s%%'", tag_array[i]);
+                const gchar *tag = tag_array[i];
+                const gchar *strnot = NULL;
+                
+                if (tag[0] == '!')
+                {
+                    strnot = "NOT";
+                }
+                else
+                {
+                    strnot = "";
+                }
+                sprintf(tag_query, "tag %s LIKE '%%%s%%'", strnot, tag_array[i]);
                 strcat(sql, tag_query);
             }
             i++;