various: add links_extracted_at field to track markdown link extraction time
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id13c6243de4c0f4fa5a87a13402379906a6a6964
This commit is contained in:
parent
b09b405a5d
commit
d741e8d585
5 changed files with 64 additions and 13 deletions
|
|
@ -727,7 +727,11 @@ impl StorageBackend for SqliteBackend {
|
|||
let mut stmt = db.prepare(
|
||||
"SELECT id, path, file_name, media_type, content_hash, file_size, \
|
||||
title, artist, album, genre, year, duration_secs, description, \
|
||||
thumbnail_path, file_mtime, created_at, updated_at FROM media_items WHERE id = ?1",
|
||||
thumbnail_path, file_mtime, date_taken, latitude, longitude, \
|
||||
camera_make, camera_model, rating, perceptual_hash, \
|
||||
storage_mode, original_filename, uploaded_at, storage_key, \
|
||||
created_at, updated_at, deleted_at, links_extracted_at \
|
||||
FROM media_items WHERE id = ?1",
|
||||
)?;
|
||||
let mut item = stmt
|
||||
.query_row(params![id.0.to_string()], row_to_media_item)
|
||||
|
|
@ -754,7 +758,11 @@ impl StorageBackend for SqliteBackend {
|
|||
let mut stmt = db.prepare(
|
||||
"SELECT id, path, file_name, media_type, content_hash, file_size, \
|
||||
title, artist, album, genre, year, duration_secs, description, \
|
||||
thumbnail_path, file_mtime, created_at, updated_at FROM media_items WHERE content_hash = ?1",
|
||||
thumbnail_path, file_mtime, date_taken, latitude, longitude, \
|
||||
camera_make, camera_model, rating, perceptual_hash, \
|
||||
storage_mode, original_filename, uploaded_at, storage_key, \
|
||||
created_at, updated_at, deleted_at, links_extracted_at \
|
||||
FROM media_items WHERE content_hash = ?1",
|
||||
)?;
|
||||
let result = stmt
|
||||
.query_row(params![hash.0], row_to_media_item)
|
||||
|
|
@ -780,7 +788,11 @@ impl StorageBackend for SqliteBackend {
|
|||
let mut stmt = db.prepare(
|
||||
"SELECT id, path, file_name, media_type, content_hash, file_size, \
|
||||
title, artist, album, genre, year, duration_secs, description, \
|
||||
thumbnail_path, file_mtime, created_at, updated_at FROM media_items WHERE path = ?1",
|
||||
thumbnail_path, file_mtime, date_taken, latitude, longitude, \
|
||||
camera_make, camera_model, rating, perceptual_hash, \
|
||||
storage_mode, original_filename, uploaded_at, storage_key, \
|
||||
created_at, updated_at, deleted_at, links_extracted_at \
|
||||
FROM media_items WHERE path = ?1",
|
||||
)?;
|
||||
let result = stmt
|
||||
.query_row(params![path_str], row_to_media_item)
|
||||
|
|
@ -817,7 +829,11 @@ impl StorageBackend for SqliteBackend {
|
|||
let sql = format!(
|
||||
"SELECT id, path, file_name, media_type, content_hash, file_size, \
|
||||
title, artist, album, genre, year, duration_secs, description, \
|
||||
thumbnail_path, file_mtime, created_at, updated_at FROM media_items \
|
||||
thumbnail_path, file_mtime, date_taken, latitude, longitude, \
|
||||
camera_make, camera_model, rating, perceptual_hash, \
|
||||
storage_mode, original_filename, uploaded_at, storage_key, \
|
||||
created_at, updated_at, deleted_at, links_extracted_at \
|
||||
FROM media_items \
|
||||
WHERE deleted_at IS NULL \
|
||||
ORDER BY {order_by} LIMIT ?1 OFFSET ?2"
|
||||
);
|
||||
|
|
@ -1239,7 +1255,10 @@ impl StorageBackend for SqliteBackend {
|
|||
let mut stmt = db.prepare(
|
||||
"SELECT m.id, m.path, m.file_name, m.media_type, m.content_hash, m.file_size, \
|
||||
m.title, m.artist, m.album, m.genre, m.year, m.duration_secs, m.description, \
|
||||
m.thumbnail_path, m.created_at, m.updated_at \
|
||||
m.thumbnail_path, m.file_mtime, m.date_taken, m.latitude, m.longitude, \
|
||||
m.camera_make, m.camera_model, m.rating, m.perceptual_hash, \
|
||||
m.storage_mode, m.original_filename, m.uploaded_at, m.storage_key, \
|
||||
m.created_at, m.updated_at, m.deleted_at, m.links_extracted_at \
|
||||
FROM media_items m \
|
||||
JOIN collection_members cm ON cm.media_id = m.id \
|
||||
WHERE cm.collection_id = ?1 \
|
||||
|
|
@ -1275,7 +1294,11 @@ impl StorageBackend for SqliteBackend {
|
|||
let mut sql = String::from(
|
||||
"SELECT m.id, m.path, m.file_name, m.media_type, m.content_hash, m.file_size, \
|
||||
m.title, m.artist, m.album, m.genre, m.year, m.duration_secs, m.description, \
|
||||
m.thumbnail_path, m.created_at, m.updated_at FROM media_items m ",
|
||||
m.thumbnail_path, m.file_mtime, m.date_taken, m.latitude, m.longitude, \
|
||||
m.camera_make, m.camera_model, m.rating, m.perceptual_hash, \
|
||||
m.storage_mode, m.original_filename, m.uploaded_at, m.storage_key, \
|
||||
m.created_at, m.updated_at, m.deleted_at, m.links_extracted_at \
|
||||
FROM media_items m ",
|
||||
);
|
||||
|
||||
if use_fts {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue