Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Database schema v19 adds a nullable, indexed `files.motion_score` for the
derived video motion metric. No value is computed yet: the column and its
plumbing ship first so scoring can follow without another migration. Existing
rows report `NULL`, which means "not measured" rather than "still", and a
rescan preserves a score that has been written instead of clearing it.
- Filter videos by pixel width and height (with SD / HD / FHD+ / 4K+ presets in
the filter drawer) and by codec (`h264`, `hevc`, `vp8`, `vp9`, `av1`). The
`width:`, `height:` and `codec:` query tokens share the existing range syntax,
Expand Down
7 changes: 7 additions & 0 deletions crates/omera-domain/src/image_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ pub struct ImageFile {
pub rating: Option<u8>,
/// Calculated or extracted aesthetic score, if available.
pub aesthetic_score: Option<f64>,
/// Derived motion score for video assets, on a 0–100 scale.
///
/// `None` means the clip has not been measured, which is distinct from a
/// clip that measured as still. Only videos carry this value; see
/// [MOTION_SCORE_DESIGN.md](../../docs/MOTION_SCORE_DESIGN.md).
#[serde(default)]
pub motion_score: Option<f64>,
/// Whether this file is marked as a favorite.
#[serde(default)]
pub is_favorite: bool,
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/benches/large_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fn generate_mock_files(folder_id: i64, start_index: usize, count: usize) -> Vec<
None
},
aesthetic_score: Some(6.0 + ((i % 40) as f64) * 0.1),
motion_score: None,
is_favorite: i % 10 == 0,
is_nsfw: false,
stack_id: if i % 20 == 0 {
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/src/cloud_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
10 changes: 10 additions & 0 deletions crates/omera-scan/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -887,6 +888,7 @@ mod tests {
metadata: None,
rating: Some(5),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -949,6 +951,7 @@ mod tests {
metadata: Some(metadata),
rating: Some(4),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1019,6 +1022,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1066,6 +1070,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1132,6 +1137,7 @@ mod tests {
metadata: None, // Intentionally None to test extraction from bytes
rating: Some(4),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1212,6 +1218,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1279,6 +1286,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1335,6 +1343,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1401,6 +1410,7 @@ mod tests {
metadata: Some(metadata),
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
3 changes: 3 additions & 0 deletions crates/omera-scan/src/file_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -276,6 +277,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -344,6 +346,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
6 changes: 6 additions & 0 deletions crates/omera-scan/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ fn harvest_selected(
metadata,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1566,6 +1567,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1624,6 +1626,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1652,6 +1655,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1697,6 +1701,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1811,6 +1816,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
2 changes: 2 additions & 0 deletions crates/omera-scan/src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ impl Scanner {
metadata,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw,
stack_id: None,
Expand Down Expand Up @@ -425,6 +426,7 @@ impl Scanner {
metadata,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw,
stack_id: None,
Expand Down
7 changes: 7 additions & 0 deletions crates/omera-scan/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ fn publish_managed_import_item_with_sidecars(
metadata,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw,
stack_id: None,
Expand Down Expand Up @@ -1409,6 +1410,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1686,6 +1688,7 @@ mod tests {
metadata: None,
rating: Some(4),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand All @@ -1703,6 +1706,7 @@ mod tests {
metadata: None,
rating: Some(5),
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -1773,6 +1777,7 @@ mod tests {
metadata: None,
rating: Some(5),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -2196,6 +2201,7 @@ mod tests {
metadata: None,
rating: Some(4),
aesthetic_score: None,
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: None,
Expand Down Expand Up @@ -2286,6 +2292,7 @@ mod tests {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/tests/avif_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn exported_fixture() -> (TempDir, Database, PathBuf, PathBuf, i64) {
metadata: None,
rating: None,
aesthetic_score: None,
motion_score: None,
is_favorite: false,
is_nsfw: false,
stack_id: None,
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/tests/avif_export_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ fn fixture() -> (TempDir, Database, i64, i64) {
metadata: None,
rating: Some(8),
aesthetic_score: Some(6.0),
motion_score: None,
is_favorite: true,
is_nsfw: false,
stack_id: Some("curated".into()),
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/tests/batch_transform_dimensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fn decoded_dimensions_survive_batch_transform_gallery_query_and_restart() {
metadata: omera_metadata::extract_metadata(Container::Png, &source),
rating: Some(8),
aesthetic_score: Some(7.5),
motion_score: None,
is_favorite: true,
is_nsfw: true,
stack_id: Some("same-stack".into()),
Expand Down
1 change: 1 addition & 0 deletions crates/omera-scan/tests/batch_transform_privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn fixture() -> (TempDir, Database, i64) {
metadata: omera_metadata::extract_metadata(Container::Png, &source),
rating: Some(8),
aesthetic_score: Some(6.5),
motion_score: None,
is_favorite: true,
is_nsfw: true,
stack_id: Some("curated-stack".into()),
Expand Down
Loading
Loading