Watch selected folders and reconcile bounded changes with media freshness guards
This commit is contained in:
1 parent
99748bd99f
commit
657de3de86
22 files changed
+2022
-149
No files matched your search
@@ -141,6 +141,11 @@ impl HybridSearch {
|
||||
task: &SourceTask,
|
||||
work: &mut BuildWork,
|
||||
) -> Result<()> {
|
||||
let change_revision = self.lexical.media_change_revision(
|
||||
&path.to_string_lossy(),
|
||||
identity.bytes,
|
||||
identity.modified_ns,
|
||||
)?;
|
||||
if let Some(count) = self
|
||||
.store
|
||||
.reuse_media_source(generation, task, id, identity)?
|
||||
@@ -152,7 +157,7 @@ impl HybridSearch {
|
||||
if kind != MediaKind::Image {
|
||||
// Metadata remains part of music search after path remapping.
|
||||
let metadata = probe(tools, path, limits)?;
|
||||
self.refresh_media_metadata(path, identity, &metadata)?;
|
||||
self.refresh_media_metadata(path, identity, &metadata, change_revision)?;
|
||||
}
|
||||
identity.ensure_unchanged()?;
|
||||
work.report.chunks += count;
|
||||
@@ -169,6 +174,7 @@ impl HybridSearch {
|
||||
tools,
|
||||
limits,
|
||||
identity,
|
||||
change_revision,
|
||||
&mut work.report,
|
||||
)?;
|
||||
self.store
|
||||
@@ -182,6 +188,7 @@ impl HybridSearch {
|
||||
path: &Path,
|
||||
identity: &MediaIdentity,
|
||||
metadata: &MediaProbe,
|
||||
change_revision: i64,
|
||||
) -> Result<()> {
|
||||
let tags = metadata
|
||||
.tags
|
||||
@@ -189,12 +196,13 @@ impl HybridSearch {
|
||||
.map(|(k, v)| format!("{k}: {v}"))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
self.lexical.set_media_metadata(
|
||||
self.lexical.set_media_metadata_at_revision(
|
||||
&path.to_string_lossy(),
|
||||
&tags,
|
||||
metadata.duration_ms,
|
||||
identity.bytes,
|
||||
identity.modified_ns,
|
||||
change_revision,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -208,6 +216,7 @@ impl HybridSearch {
|
||||
tools: &FfmpegTools,
|
||||
limits: &MediaLimits,
|
||||
identity: &MediaIdentity,
|
||||
change_revision: i64,
|
||||
report: &mut EmbeddingReport,
|
||||
) -> Result<()> {
|
||||
let mut ordinal = 0;
|
||||
@@ -228,7 +237,7 @@ impl HybridSearch {
|
||||
report.chunks += 1;
|
||||
} else {
|
||||
let metadata = probe(tools, path, limits)?;
|
||||
self.refresh_media_metadata(path, identity, &metadata)?;
|
||||
self.refresh_media_metadata(path, identity, &metadata, change_revision)?;
|
||||
if metadata.has_video && kind == MediaKind::Video {
|
||||
let mut seen = std::collections::HashSet::new();
|
||||
let mut scenes = 0;
|
||||
|
||||
Reference in new issue
Block a user