refactor: move DateRange validation to value object, add delete/cleanup
Some checks failed
CI / Check / Test (push) Failing after 40s
Some checks failed
CI / Check / Test (push) Failing after 40s
This commit is contained in:
@@ -282,7 +282,7 @@ impl WrapUpStatsQuery for PostgresWrapUpStatsQuery {
|
||||
ORDER BY r.watched_at ASC"
|
||||
);
|
||||
|
||||
let mut q = sqlx::query(&sql).bind(range.start).bind(range.end);
|
||||
let mut q = sqlx::query(&sql).bind(range.start()).bind(range.end());
|
||||
if let Some(ref uid) = scope_bind {
|
||||
q = q.bind(uid);
|
||||
}
|
||||
|
||||
@@ -274,8 +274,8 @@ impl WrapUpStatsQuery for SqliteWrapUpStatsQuery {
|
||||
scope: &WrapUpScope,
|
||||
range: &DateRange,
|
||||
) -> Result<Vec<WrapUpMovieRow>, DomainError> {
|
||||
let start_str = range.start.format("%Y-%m-%d").to_string();
|
||||
let end_str = range.end.format("%Y-%m-%d").to_string();
|
||||
let start_str = range.start().format("%Y-%m-%d").to_string();
|
||||
let end_str = range.end().format("%Y-%m-%d").to_string();
|
||||
|
||||
// 1) Main query
|
||||
let (scope_clause, scope_bind) = match scope {
|
||||
|
||||
@@ -277,8 +277,8 @@ impl SlideRenderer {
|
||||
|
||||
let year_label = format!(
|
||||
"{} - {}",
|
||||
report.date_range.start.format("%b %Y"),
|
||||
report.date_range.end.format("%b %Y")
|
||||
report.date_range.start().format("%b %Y"),
|
||||
report.date_range.end().format("%b %Y")
|
||||
);
|
||||
self.draw_centered(&mut img, &year_label, (h / 6) as i32, 48.0, DIM);
|
||||
self.draw_centered(
|
||||
|
||||
Reference in New Issue
Block a user