Skip to content

Commit

Permalink
export tags: roll back darktable-org#9963 taking care darktable-org#9949
Browse files Browse the repository at this point in the history
 is still fixed

fixes darktable-org#10696
  • Loading branch information
phweyland authored and TurboGit committed Dec 27, 2021
1 parent e48d8a6 commit 576b84e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/common/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,18 @@ static uint32_t _tag_get_attached_export(const gint imgid, GList **result)

sqlite3_stmt *stmt;
DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db),
"SELECT DISTINCT TI.tagid, T.name, T.flags, T.synonyms"
" FROM main.tagged_images AS TI"
" JOIN data.tags AS T ON T.id = TI.tagid"
" WHERE TI.imgid = ?1 AND TI.tagid NOT IN memory.darktable_tags",
"SELECT DISTINCT T.id, T.name, T.flags, T.synonyms"
" FROM data.tags AS T"
// tags attached to image(s), not dt tag, ordered by name
" JOIN (SELECT DISTINCT I.tagid, T.name"
" FROM main.tagged_images AS I"
" JOIN data.tags AS T ON T.id = I.tagid"
" WHERE I.imgid = ?1 AND T.id NOT IN memory.darktable_tags"
" ORDER by T.name) AS T1"
// keep also tags in the path to be able to check category in path
" ON T.id = T1.tagid"
" OR (T.name = SUBSTR(T1.name, 1, LENGTH(T.name))"
" AND SUBSTR(T1.name, LENGTH(T.name) + 1, 1) = '|')",
-1, &stmt, NULL);
DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, imgid);
// Create result
Expand Down

0 comments on commit 576b84e

Please sign in to comment.