Add overlay command

This commit is contained in:
joeyahines committed 2025-06-24 16:12:53 -06:00
1 parent e5d3cedf66
commit fe99a6f768
8 files changed
+137 -28

No files matched your search

+3 -6
View File
@@ -58,11 +58,9 @@ impl Movie {
.next()
.ok_or(JDbError::NotFound)?)
}
pub fn get_movies(db: &Database) -> Result<Vec<Self>, Error> {
Ok(db
.filter(|_, _movie: &Movie| true)?
.collect())
Ok(db.filter(|_, _movie: &Movie| true)?.collect())
}
pub fn remove_movie(db: &Database, name: &str) -> Result<Self, Error> {
@@ -86,8 +84,7 @@ impl Movie {
pub fn calculate_rating(&self) -> f32 {
if self.ratings.is_empty() {
0.0
}
else {
} else {
self.ratings.values().copied().sum::<f32>() / self.ratings.len() as f32
}
}