Skip to content

Commit

Permalink
chore: use derive Model and analytics from core
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
  • Loading branch information
elpiel committed Aug 7, 2023
1 parent cd394e5 commit 4978429
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
37 changes: 21 additions & 16 deletions src/env.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
use crate::event::{UIEvent, WebEvent};
use crate::model::WebModel;
use chrono::offset::TimeZone;
use chrono::{DateTime, Utc};
use futures::future::Either;
use futures::{future, Future, FutureExt, TryFutureExt};
use std::{collections::HashMap, sync::RwLock};

use chrono::{offset::TimeZone, DateTime, Utc};
use futures::{
future::{self, Either},
Future, FutureExt, TryFutureExt,
};
use http::{Method, Request};
use lazy_static::lazy_static;
use regex::Regex;
use serde::{Deserialize, Serialize};
use serde_json::json;

use std::collections::HashMap;
use std::sync::RwLock;

use stremio_analytics::Analytics;
use stremio_core::models::ctx::Ctx;
use stremio_core::models::streaming_server::StreamingServer;
use stremio_core::runtime::msg::{Action, ActionCtx, Event};
use stremio_core::runtime::{Env, EnvError, EnvFuture, EnvFutureExt, TryEnvFuture};
use stremio_core::types::api::AuthRequest;
use stremio_core::types::resource::StreamSource;
use stremio_core::{
analytics::Analytics,
models::{ctx::Ctx, streaming_server::StreamingServer},
runtime::{
msg::{Action, ActionCtx, Event},
Env, EnvError, EnvFuture, EnvFutureExt, TryEnvFuture,
},
types::{api::AuthRequest, resource::StreamSource},
};

use tracing::trace;
use url::Url;
Expand All @@ -30,6 +30,11 @@ use wasm_bindgen::{JsCast, JsValue};
use wasm_bindgen_futures::{spawn_local, JsFuture};
use web_sys::WorkerGlobalScope;

use crate::{
event::{UIEvent, WebEvent},
model::WebModel,
};

const UNKNOWN_ERROR: &str = "Unknown Error";
const INSTALLATION_ID_STORAGE_KEY: &str = "installation_id";

Expand Down
2 changes: 1 addition & 1 deletion src/model/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use stremio_core::{
notifications::NotificationsBucket, profile::Profile, resource::MetaItemPreview,
streams::StreamsBucket,
},
Model,
};
use stremio_derive::Model;

use crate::{
env::WebEnv,
Expand Down

0 comments on commit 4978429

Please sign in to comment.