fix CORS
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user