Project

General

Profile

0001-Fixed-calculated-image-count-in-a-collection.patch

Petr Synek, 01/02/2016 08:33 PM

View differences:

src/common/collection.c
415 415

  
416 416
  gchar *fq = g_strstr_len(query, strlen(query), "from");
417 417
  if((collection->params.query_flags & COLLECTION_QUERY_USE_ONLY_WHERE_EXT))
418
    count_query = dt_util_dstrcat(NULL, "select count(images.id) from images %s", collection->where_ext);
418
    count_query = dt_util_dstrcat(NULL, "select count(distinct images.id) from images %s", collection->where_ext);
419 419
  else
420
    count_query = dt_util_dstrcat(count_query, "select count(id) %s", fq);
420
    count_query = dt_util_dstrcat(count_query, "select count(distinct id) %s", fq);
421 421

  
422 422
  DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db), count_query, -1, &stmt, NULL);
423 423
  if((collection->params.query_flags & COLLECTION_QUERY_USE_LIMIT)
424
- 
Go to top