This commit is contained in:
2026-01-21 19:00:05 -05:00
parent 3ab9c9baf1
commit 5042cc7ff5
5 changed files with 90 additions and 38 deletions

View File

@@ -1,4 +1,6 @@
use chrono::{Datelike, Days, Local};
use dioxus::prelude::*;
use prost_types::Timestamp;
use crate::{
components::playback::{Timeline, Viewport},
@@ -13,9 +15,15 @@ const PLAYER_CSS: Asset = asset!("/assets/styling/player.scss");
pub fn Player() -> Element {
let entries = use_resource(|| async move {
let mut client = get_rpc_client();
let now = Local::now();
let from = Timestamp::date(now.year() as i64, now.month() as u8, now.day() as u8).unwrap();
let tomorrow = now.checked_add_days(Days::new(1)).unwrap();
let to = Timestamp::date(tomorrow.year() as i64, tomorrow.month() as u8, tomorrow.day() as u8).unwrap();
let result = client
.get_media_entries_in_range(MediaRangeRequest {
r#type: MediaType::Video.into(),
r#type: MediaType::Image.into(),
from: Some(from),
to: Some(to),
..Default::default()
})
.await;