pub struct MetadataSimilarity {
pub filename_similarity: f64,
pub title_fuzzy_score: f64,
pub duration_match: f64,
pub resolution_match: f64,
pub codec_match: f64,
pub size_similarity: f64,
pub container_match: f64,
}Expand description
Metadata similarity result.
Fields§
§filename_similarity: f64Filename similarity (0.0-1.0): multi-signal comparison of the file stem using edit distance, token Jaccard, and bigram Dice coefficient.
title_fuzzy_score: f64Title fuzzy score (0.0-1.0): similarity of the embedded media title tag
(if present) using the media-aware crate::fuzzy_match::FilenameMatcher.
Falls back to 0.0 when either file lacks an embedded title.
duration_match: f64Duration match (0.0-1.0)
resolution_match: f64Resolution match (0.0-1.0)
codec_match: f64Codec match (0.0-1.0)
size_similarity: f64Size similarity (0.0-1.0)
container_match: f64Container match (0.0 or 1.0)
Implementations§
Source§impl MetadataSimilarity
impl MetadataSimilarity
Sourcepub fn overall_score(&self) -> f64
pub fn overall_score(&self) -> f64
Calculate overall similarity score.
Weights (sum to 1.0):
| Signal | Weight |
|---|---|
| name_score | 0.30 |
| duration_match | 0.20 |
| resolution_match | 0.20 |
| codec_match | 0.15 |
| size_similarity | 0.10 |
| container_match | 0.05 |
name_score is the maximum of filename_similarity and
title_fuzzy_score. When both embedded title tags are present,
title_fuzzy_score can lift the name signal above what the filename
alone would contribute (e.g., "Movie (1080p)" vs "Movie (720p)").
When title_fuzzy_score is 0.0 (no title tags), the formula is
identical to the original 6-signal formula.
Sourcepub fn is_similar(&self, threshold: f64) -> bool
pub fn is_similar(&self, threshold: f64) -> bool
Check if metadata is similar above threshold.
Trait Implementations§
Source§impl Clone for MetadataSimilarity
impl Clone for MetadataSimilarity
Source§fn clone(&self) -> MetadataSimilarity
fn clone(&self) -> MetadataSimilarity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MetadataSimilarity
impl RefUnwindSafe for MetadataSimilarity
impl Send for MetadataSimilarity
impl Sync for MetadataSimilarity
impl Unpin for MetadataSimilarity
impl UnsafeUnpin for MetadataSimilarity
impl UnwindSafe for MetadataSimilarity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more