|
|
|
@ -9,6 +9,7 @@ export function escape_regex(s) { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export function do_image_query(query, database, collection_path, collection_thumbs_path) { |
|
|
|
|
const category_video = 2; |
|
|
|
|
return new Promise(function (resolve, reject) { |
|
|
|
|
var queries = []; |
|
|
|
|
queries.push(query); |
|
|
|
@ -28,7 +29,8 @@ export function do_image_query(query, database, collection_path, collection_thum |
|
|
|
|
imagepath, |
|
|
|
|
thumbpath, |
|
|
|
|
[row[cols.indexOf("width")], |
|
|
|
|
row[cols.indexOf("height")]] |
|
|
|
|
row[cols.indexOf("height")]], |
|
|
|
|
row[cols.indexOf("category")] == category_video, |
|
|
|
|
)); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -347,7 +349,7 @@ export class UserQuery { |
|
|
|
|
// This query will return database entries with the fields "id", "uniqueHash", "relativePath" (of the album) and "name" for each matching image.
|
|
|
|
|
export function image_query_with_where(maybe_where) { |
|
|
|
|
return "SELECT Images.id, Images.name, Images.uniqueHash, Albums.relativePath, " |
|
|
|
|
+ "ImageInformation.width, ImageInformation.height " |
|
|
|
|
+ "ImageInformation.width, ImageInformation.height, Images.category " |
|
|
|
|
+ "FROM Images INNER JOIN Albums ON Images.album=Albums.id " |
|
|
|
|
+ "LEFT JOIN ImageTags ON Images.id=ImageTags.imageid " |
|
|
|
|
+ "LEFT JOIN ImageInformation ON Images.id=ImageInformation.imageid " |
|
|
|
|