Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
Merge branch 'development' into fix/bubble-up-serde-errors
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Apr 5, 2024
2 parents 37e18af + c715b3a commit ee84185
Show file tree
Hide file tree
Showing 7 changed files with 1,911 additions and 2,072 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stremio-core-web"
version = "0.47.1"
version = "0.47.2"
authors = ["Smart Code OOD"]
edition = "2021"
resolver = "2"
Expand Down
3,943 changes: 1,886 additions & 2,057 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stremio/stremio-core-web",
"version": "0.47.1",
"version": "0.47.2",
"description": "Bridge between stremio-core and stremio-web",
"author": "Smart Code OOD",
"main": "stremio_core_web.js",
Expand All @@ -13,13 +13,13 @@
"build": "./scripts/build.sh"
},
"dependencies": {
"@babel/runtime": "7.16.0"
"@babel/runtime": "7.24.1"
},
"devDependencies": {
"@babel/cli": "7.16.8",
"@babel/core": "7.16.0",
"@babel/plugin-transform-runtime": "7.16.10",
"@babel/preset-env": "7.16.0",
"@babel/cli": "7.24.1",
"@babel/core": "7.24.3",
"@babel/plugin-transform-runtime": "7.24.3",
"@babel/preset-env": "7.24.3",
"babel-plugin-bundled-import-meta": "0.3.2"
}
}
2 changes: 2 additions & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ impl WebEnv {
StreamSource::Url { .. } => "Url",
StreamSource::YouTube { .. } => "YouTube",
StreamSource::Torrent { .. } => "Torrent",
StreamSource::Rar { .. } => "Rar",
StreamSource::Zip { .. } => "Zip",
StreamSource::External { .. } => "External",
StreamSource::PlayerFrame { .. } => "PlayerFrame"
}
Expand Down
12 changes: 9 additions & 3 deletions src/model/serialize_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming
next_video: player
.selected
.as_ref()
.and_then(|selected| selected.meta_request.as_ref())
.and_then(|selected| {
selected
.meta_request
.as_ref()
.zip(selected.stream_request.as_ref())
})
.zip(player.next_video.as_ref())
.map(|(request, video)| model::Video {
.map(|((meta_request, stream_request), video)| model::Video {
video,
upcoming: player
.meta_item
Expand Down Expand Up @@ -219,7 +224,8 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming
.unwrap_or_default(),
deep_links: VideoDeepLinks::from((
video,
request,
stream_request,
meta_request,
&streaming_server.base_url,
&ctx.profile.settings,
))
Expand Down
4 changes: 3 additions & 1 deletion src/model/serialize_streaming_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use stremio_core::models::common::Loadable;
use stremio_core::models::streaming_server::{PlaybackDevice, Selected, StreamingServer};
use stremio_core::runtime::EnvError;
use stremio_core::types::addon::ResourcePath;
use stremio_core::types::streaming_server::{NetworkInfo, Settings, Statistics};
use stremio_core::types::streaming_server::{DeviceInfo, NetworkInfo, Settings, Statistics};
use url::Url;
use wasm_bindgen::JsValue;

Expand All @@ -22,6 +22,7 @@ mod model {
pub remote_url: &'a Option<Url>,
pub playback_devices: &'a Loadable<Vec<PlaybackDevice>, EnvError>,
pub network_info: &'a Loadable<NetworkInfo, EnvError>,
pub device_info: &'a Loadable<DeviceInfo, EnvError>,
pub torrent: Option<(&'a String, TorrentLoadable<'a>)>,
pub statistics: Option<&'a Loadable<Statistics, EnvError>>,
}
Expand All @@ -35,6 +36,7 @@ pub fn serialize_streaming_server(streaming_server: &StreamingServer) -> JsValue
remote_url: &streaming_server.remote_url,
playback_devices: &streaming_server.playback_devices,
network_info: &streaming_server.network_info,
device_info: &streaming_server.device_info,
torrent: streaming_server
.torrent
.as_ref()
Expand Down

0 comments on commit ee84185

Please sign in to comment.