From c96f637446f00c92b5bb978c1340ed3c80d43246 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 2 Jan 2024 18:48:59 +0200 Subject: [PATCH 01/15] chore: bump core to branch Signed-off-by: Lachezar Lechev --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9487d55..5d65311 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -944,7 +944,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#93c3e66841156635206fd371249b0bcced1e38fb" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" dependencies = [ "anyhow", "base64 0.21.2", @@ -1020,7 +1020,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#93c3e66841156635206fd371249b0bcced1e38fb" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" dependencies = [ "case", "proc-macro-crate", @@ -1050,7 +1050,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#93c3e66841156635206fd371249b0bcced1e38fb" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" dependencies = [ "base64 0.13.1", "flate2", diff --git a/Cargo.toml b/Cargo.toml index a409f47..ccdfd52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ lto = true opt-level = 's' [dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "development" } +stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "feat/player-intro-outro" } serde = { version = "1.0.*", features = ["derive"] } serde_json = "1.0.*" futures = "0.3.*" From c1e505cb0ea835c55684622bda1dd8fc346d6c35 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 2 Jan 2024 18:49:18 +0200 Subject: [PATCH 02/15] feat: player serialize additions Signed-off-by: Lachezar Lechev --- src/model/serialize_player.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/model/serialize_player.rs b/src/model/serialize_player.rs index 53c6db3..eef63f7 100644 --- a/src/model/serialize_player.rs +++ b/src/model/serialize_player.rs @@ -99,6 +99,8 @@ mod model { pub series_info: Option<&'a stremio_core::types::resource::SeriesInfo>, pub library_item: Option>, pub stream_state: Option<&'a StreamItemState>, + #[serde(skip_serializing_if = "Option::is_none")] + pub into_outro: Option<&'a stremio_core::types::player::IntroOutro>, pub title: Option, pub addon: Option>, } @@ -242,6 +244,7 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming }, }), stream_state: player.stream_state.as_ref(), + into_outro: player.intro_outro.as_ref(), title: player.selected.as_ref().and_then(|selected| { player .meta_item From 5540a6fda865d14edc720915b5cee1777f18a42f Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Wed, 3 Jan 2024 12:40:48 +0200 Subject: [PATCH 03/15] chore: update core Signed-off-by: Lachezar Lechev --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d65311..c176211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -944,7 +944,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" dependencies = [ "anyhow", "base64 0.21.2", @@ -1020,7 +1020,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" dependencies = [ "case", "proc-macro-crate", @@ -1050,7 +1050,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#3b93a7416bad61095f4092fd3e5a5a723982c613" +source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" dependencies = [ "base64 0.13.1", "flate2", From 1c51cab172a444354754ac6efb4fc45c2f794ab0 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 1 Feb 2024 13:34:04 +0100 Subject: [PATCH 04/15] feat: add notifications count for library items --- src/model/model.rs | 6 ++---- src/model/serialize_library.rs | 17 +++++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/model/model.rs b/src/model/model.rs index 0abd825..2c9841e 100644 --- a/src/model/model.rs +++ b/src/model/model.rs @@ -140,16 +140,14 @@ impl WebModel { } WebModelField::Library => serialize_library( &self.library, - &self.ctx.streams, + &self.ctx, self.streaming_server.base_url.as_ref(), - &self.ctx.profile.settings, "library".to_owned(), ), WebModelField::ContinueWatching => serialize_library( &self.continue_watching, - &self.ctx.streams, + &self.ctx, self.streaming_server.base_url.as_ref(), - &self.ctx.profile.settings, "continuewatching".to_owned(), ), WebModelField::Search => serialize_catalogs_with_extra(&self.search, &self.ctx), diff --git a/src/model/serialize_library.rs b/src/model/serialize_library.rs index 7f45179..d0a260e 100644 --- a/src/model/serialize_library.rs +++ b/src/model/serialize_library.rs @@ -2,10 +2,10 @@ use crate::model::deep_links_ext::DeepLinksExt; use gloo_utils::format::JsValueSerdeExt; use serde::Serialize; use stremio_core::deep_links::{LibraryDeepLinks, LibraryItemDeepLinks}; +use stremio_core::models::ctx::Ctx; use stremio_core::models::library_with_filters::{LibraryWithFilters, Selected, Sort}; -use stremio_core::types::profile::Settings; use stremio_core::types::resource::PosterShape; -use stremio_core::types::streams::{StreamsBucket, StreamsItemKey}; +use stremio_core::types::streams::StreamsItemKey; use url::Url; use wasm_bindgen::JsValue; @@ -20,6 +20,7 @@ mod model { pub r#type: &'a String, pub poster: &'a Option, pub poster_shape: &'a PosterShape, + pub notifications: u8, pub progress: f64, pub watched: bool, pub deep_links: LibraryItemDeepLinks, @@ -61,9 +62,8 @@ mod model { pub fn serialize_library( library: &LibraryWithFilters, - streams_bucket: &StreamsBucket, + ctx: &Ctx, streaming_server_url: Option<&Url>, - settings: &Settings, root: String, ) -> JsValue { ::from_serde(&model::LibraryWithFilters { @@ -111,7 +111,7 @@ pub fn serialize_library( // Try to get the stream from the StreamBucket // given that we have a video_id in the LibraryItemState! let streams_item = library_item.state.video_id.as_ref().and_then(|video_id| { - streams_bucket.items.get(&StreamsItemKey { + ctx.streams.items.get(&StreamsItemKey { meta_id: library_item.id.to_owned(), video_id: video_id.to_owned(), }) @@ -127,13 +127,18 @@ pub fn serialize_library( } else { &library_item.poster_shape }, + notifications: ctx + .notifications + .items + .get(&library_item.id) + .map_or(0, |item| item.len() as u8), progress: library_item.progress(), watched: library_item.watched(), deep_links: LibraryItemDeepLinks::from(( library_item, streams_item, streaming_server_url, - settings, + &ctx.profile.settings, )) .into_web_deep_links(), } From 366bebdcdc72a241a068ea88f6b76ecd9730d9e9 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 1 Feb 2024 13:50:54 +0100 Subject: [PATCH 05/15] chore: update stremio-core --- Cargo.lock | 107 ++++++++++++++++++++++++++++++++++++++++++----------- Cargo.toml | 2 +- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c176211..b40d160 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,7 @@ dependencies = [ "js-sys", "num-traits", "serde", - "time", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -204,27 +204,36 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.28", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "serde", ] [[package]] @@ -431,6 +440,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.0" @@ -499,6 +514,17 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.0.0" @@ -506,7 +532,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.0", + "serde", ] [[package]] @@ -871,25 +898,31 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.14.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" dependencies = [ + "base64 0.21.2", "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.0.0", "serde", + "serde_json", "serde_with_macros", + "time 0.3.25", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] @@ -944,7 +977,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "anyhow", "base64 0.21.2", @@ -1020,7 +1053,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "case", "proc-macro-crate", @@ -1032,9 +1065,13 @@ dependencies = [ [[package]] name = "stremio-official-addons" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e078e462526ca579a7a6e46bcb0106457006abec0ecb97a643b4d6257613db6" +checksum = "5b03b5836f294463f2ad0eeebac3bcde05dcbecfefa4fc6da2029c5e15d17ad9" +dependencies = [ + "once_cell", + "serde_json", +] [[package]] name = "stremio-serde-hex" @@ -1050,7 +1087,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=feat/player-intro-outro#57b7b70680d44659cc0a9f30bd2ff4143e2ba054" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "base64 0.13.1", "flate2", @@ -1148,6 +1185,34 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +dependencies = [ + "deranged", + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +dependencies = [ + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1175,7 +1240,7 @@ version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] diff --git a/Cargo.toml b/Cargo.toml index ccdfd52..a409f47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ lto = true opt-level = 's' [dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "feat/player-intro-outro" } +stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "development" } serde = { version = "1.0.*", features = ["derive"] } serde_json = "1.0.*" futures = "0.3.*" From ad95e50d110460445a2b251e7d531dbb5a6e34a0 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 1 Feb 2024 14:00:04 +0100 Subject: [PATCH 06/15] chore: update stremio-core --- Cargo.lock | 115 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 742ac1d..2c84f75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,7 @@ dependencies = [ "js-sys", "num-traits", "serde", - "time", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -204,27 +204,37 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.48", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", ] [[package]] @@ -444,6 +454,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.0" @@ -512,6 +528,17 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.0.0" @@ -519,7 +546,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.0", + "serde", ] [[package]] @@ -649,6 +677,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -714,6 +748,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -884,25 +924,31 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.14.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" dependencies = [ + "base64 0.21.2", "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.0.0", "serde", + "serde_json", "serde_with_macros", + "time 0.3.32", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -957,7 +1003,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#78c11a606341d477ce8eb4bc5d99c42e54f4b2b9" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "anyhow", "base64 0.21.2", @@ -1034,7 +1080,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#78c11a606341d477ce8eb4bc5d99c42e54f4b2b9" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "case", "proc-macro-crate", @@ -1068,7 +1114,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#78c11a606341d477ce8eb4bc5d99c42e54f4b2b9" +source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" dependencies = [ "base64 0.13.1", "flate2", @@ -1166,6 +1212,37 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1193,7 +1270,7 @@ version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] From 3bdc6cc48b170f355a8147e8420acab6e522b745 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 2 Feb 2024 06:55:40 +0100 Subject: [PATCH 07/15] fix(serialize_player): use usize for notifications --- src/model/serialize_library.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/serialize_library.rs b/src/model/serialize_library.rs index d0a260e..349526e 100644 --- a/src/model/serialize_library.rs +++ b/src/model/serialize_library.rs @@ -20,7 +20,7 @@ mod model { pub r#type: &'a String, pub poster: &'a Option, pub poster_shape: &'a PosterShape, - pub notifications: u8, + pub notifications: usize, pub progress: f64, pub watched: bool, pub deep_links: LibraryItemDeepLinks, @@ -131,7 +131,7 @@ pub fn serialize_library( .notifications .items .get(&library_item.id) - .map_or(0, |item| item.len() as u8), + .map_or(0, |item| item.len()), progress: library_item.progress(), watched: library_item.watched(), deep_links: LibraryItemDeepLinks::from(( From 4dd5bc8378b576d37be734739a78a60bf55584b6 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 2 Feb 2024 14:19:01 +0100 Subject: [PATCH 08/15] 0.46.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c84f75..8cddbe9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1046,7 +1046,7 @@ dependencies = [ [[package]] name = "stremio-core-web" -version = "0.46.1" +version = "0.46.2" dependencies = [ "Inflector", "boolinator", diff --git a/Cargo.toml b/Cargo.toml index a70dc07..bc72ea5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stremio-core-web" -version = "0.46.1" +version = "0.46.2" authors = ["Smart Code OOD"] edition = "2021" diff --git a/package-lock.json b/package-lock.json index 20f0a9a..6b50258 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stremio/stremio-core-web", - "version": "0.46.1", + "version": "0.46.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stremio/stremio-core-web", - "version": "0.46.1", + "version": "0.46.2", "license": "MIT", "dependencies": { "@babel/runtime": "7.16.0" diff --git a/package.json b/package.json index d40d951..d8e5901 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stremio/stremio-core-web", - "version": "0.46.1", + "version": "0.46.2", "description": "Bridge between stremio-core and stremio-web", "author": "Smart Code OOD", "main": "stremio_core_web.js", From 43f8bf380b5d050db3a96e1c81b15bc319b52541 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Fri, 2 Feb 2024 17:10:08 +0200 Subject: [PATCH 09/15] chore: bump core Signed-off-by: Lachezar Lechev --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cddbe9..e75c161 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1003,7 +1003,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" +source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" dependencies = [ "anyhow", "base64 0.21.2", @@ -1080,7 +1080,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" +source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" dependencies = [ "case", "proc-macro-crate", @@ -1114,7 +1114,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#19ff6d61936debc6cc91581783044599933dbd5c" +source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" dependencies = [ "base64 0.13.1", "flate2", From 606f777589b66d3ab04798cd6f15b1c6905f84c2 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Fri, 2 Feb 2024 17:20:31 +0200 Subject: [PATCH 10/15] 0.46.3 Signed-off-by: Lachezar Lechev --- Cargo.lock | 2 +- Cargo.toml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e75c161..96a718f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1046,7 +1046,7 @@ dependencies = [ [[package]] name = "stremio-core-web" -version = "0.46.2" +version = "0.46.3" dependencies = [ "Inflector", "boolinator", diff --git a/Cargo.toml b/Cargo.toml index bc72ea5..2e9c0c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stremio-core-web" -version = "0.46.2" +version = "0.46.3" authors = ["Smart Code OOD"] edition = "2021" diff --git a/package-lock.json b/package-lock.json index 6b50258..2deba2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stremio/stremio-core-web", - "version": "0.46.2", + "version": "0.46.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stremio/stremio-core-web", - "version": "0.46.2", + "version": "0.46.3", "license": "MIT", "dependencies": { "@babel/runtime": "7.16.0" diff --git a/package.json b/package.json index d8e5901..2f670cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stremio/stremio-core-web", - "version": "0.46.2", + "version": "0.46.3", "description": "Bridge between stremio-core and stremio-web", "author": "Smart Code OOD", "main": "stremio_core_web.js", From ae4d1b87e89910f00615ee433be96cab1896d3b9 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 7 Feb 2024 11:09:10 +0100 Subject: [PATCH 11/15] fix(serialize_player): typo --- src/model/serialize_player.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/serialize_player.rs b/src/model/serialize_player.rs index 1bfcd5f..da9181f 100644 --- a/src/model/serialize_player.rs +++ b/src/model/serialize_player.rs @@ -101,7 +101,7 @@ mod model { pub library_item: Option>, pub stream_state: Option<&'a StreamItemState>, #[serde(skip_serializing_if = "Option::is_none")] - pub into_outro: Option<&'a stremio_core::types::player::IntroOutro>, + pub intro_outro: Option<&'a stremio_core::types::player::IntroOutro>, pub title: Option, pub addon: Option>, } @@ -245,7 +245,7 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming }, }), stream_state: player.stream_state.as_ref(), - into_outro: player.intro_outro.as_ref(), + intro_outro: player.intro_outro.as_ref(), title: player.selected.as_ref().and_then(|selected| { player .meta_item From 15e9257531915f41532375615020d69cbb66c386 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 27 Feb 2024 10:22:15 +0100 Subject: [PATCH 12/15] refactor!(serialize_library): update pagination logic --- src/model/serialize_library.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/model/serialize_library.rs b/src/model/serialize_library.rs index 349526e..44e7e88 100644 --- a/src/model/serialize_library.rs +++ b/src/model/serialize_library.rs @@ -49,8 +49,7 @@ mod model { pub struct Selectable<'a> { pub types: Vec>, pub sorts: Vec>, - pub prev_page: Option, - pub next_page: Option, + pub next_page: bool, } #[derive(Serialize)] pub struct LibraryWithFilters<'a> { @@ -91,18 +90,7 @@ pub fn serialize_library( .into_web_deep_links(), }) .collect(), - prev_page: library.selectable.prev_page.as_ref().map(|prev_page| { - model::SelectablePage { - deep_links: LibraryDeepLinks::from((&root, &prev_page.request)) - .into_web_deep_links(), - } - }), - next_page: library.selectable.next_page.as_ref().map(|next_page| { - model::SelectablePage { - deep_links: LibraryDeepLinks::from((&root, &next_page.request)) - .into_web_deep_links(), - } - }), + next_page: library.selectable.next_page.is_some(), }, catalog: library .catalog From ef1e45959bce86568149d5677edcd8ad5457b742 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 27 Feb 2024 10:23:46 +0100 Subject: [PATCH 13/15] chore: use stremio-core refactor/library-with-filters-load-next-page branch --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96a718f..15733b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1003,7 +1003,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" +source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" dependencies = [ "anyhow", "base64 0.21.2", @@ -1080,7 +1080,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" +source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" dependencies = [ "case", "proc-macro-crate", @@ -1114,7 +1114,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#fde8815ac1fba4fad3ae9b77feba1dac96401211" +source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" dependencies = [ "base64 0.13.1", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 2e9c0c7..84c7a05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ lto = true opt-level = 's' [dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "development" } +stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "refactor/library-with-filters-load-next-page" } serde = { version = "1.0.*", features = ["derive"] } serde_json = "1.0.*" futures = "0.3.*" From d9c02c67f382c27c7b5c4ca642d2fa8de4cf5306 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 27 Feb 2024 12:25:08 +0100 Subject: [PATCH 14/15] refactor(serialize_continue_watching_preview): use library item progress function --- src/model/serialize_continue_watching_preview.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/model/serialize_continue_watching_preview.rs b/src/model/serialize_continue_watching_preview.rs index c1d4696..59286b2 100644 --- a/src/model/serialize_continue_watching_preview.rs +++ b/src/model/serialize_continue_watching_preview.rs @@ -169,11 +169,7 @@ mod model { // else use the provided shape _ => &library_item.poster_shape, }, - progress: if library_item.state.time_offset > 0 && library_item.state.duration > 0 { - library_item.state.time_offset as f64 / library_item.state.duration as f64 - } else { - 0.0 - }, + progress: library_item.progress(), deep_links: LibraryItemDeepLinks::from(( library_item, streams_item, From 07ccc14758f4ba915f6c3166bc5680a1e593dc04 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 29 Feb 2024 09:32:00 +0200 Subject: [PATCH 15/15] chore: revert core to development and update revision Signed-off-by: Lachezar Lechev --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15733b7..31df4c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1003,7 +1003,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" +source = "git+https://github.com/Stremio/stremio-core?branch=development#895d418552d315807d08f0d668d313f76126c4b9" dependencies = [ "anyhow", "base64 0.21.2", @@ -1080,7 +1080,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" +source = "git+https://github.com/Stremio/stremio-core?branch=development#895d418552d315807d08f0d668d313f76126c4b9" dependencies = [ "case", "proc-macro-crate", @@ -1114,7 +1114,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=refactor/library-with-filters-load-next-page#8ade441890aeb88f83976c8269274f252d6c7ce6" +source = "git+https://github.com/Stremio/stremio-core?branch=development#895d418552d315807d08f0d668d313f76126c4b9" dependencies = [ "base64 0.13.1", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 84c7a05..2e9c0c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ lto = true opt-level = 's' [dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "refactor/library-with-filters-load-next-page" } +stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "development" } serde = { version = "1.0.*", features = ["derive"] } serde_json = "1.0.*" futures = "0.3.*"