diff --git a/Cargo.lock b/Cargo.lock index 308f54f4b..e7c76886d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,12 +101,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "boolinator" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" - [[package]] name = "bumpalo" version = "3.16.0" @@ -1107,7 +1101,6 @@ dependencies = [ "anyhow", "assert_matches", "base64 0.22.1", - "boolinator", "chrono", "data-encoding", "derivative", @@ -1154,7 +1147,6 @@ dependencies = [ name = "stremio-core-web" version = "0.51.1" dependencies = [ - "boolinator", "chrono", "console_error_panic_hook", "either", diff --git a/Cargo.toml b/Cargo.toml index 7b267ac97..2c3f51ec9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,6 @@ either = "1.6" enclose = "1.1" derivative = "2.2" derive_more = { version = "2", features = ["from", "into", "into_iterator", "try_into", "deref"] } -boolinator = "2.4" strum = { version = "0.27", features = ["derive"] } lazysort = "0.2" diff --git a/src/models/catalog_with_filters.rs b/src/models/catalog_with_filters.rs index 8a252786c..f7627946c 100644 --- a/src/models/catalog_with_filters.rs +++ b/src/models/catalog_with_filters.rs @@ -12,7 +12,6 @@ use crate::types::addon::{ }; use crate::types::profile::Profile; use crate::types::resource::MetaItemPreview; -use boolinator::Boolinator; use derivative::Derivative; use itertools::Itertools; use serde::{Deserialize, Serialize}; @@ -417,32 +416,29 @@ fn selectable_update( extra_prop.name != SKIP_EXTRA_PROP.name && !extra_prop.options.is_empty() }) .map(|extra_prop| { - let none_option = - (!extra_prop.is_required) - .as_option() - .map(|_| SelectableExtraOption { - value: None, - selected: selected + let none_option = (!extra_prop.is_required).then(|| SelectableExtraOption { + value: None, + selected: selected + .request + .path + .extra + .iter() + .all(|extra_value| extra_value.name != extra_prop.name), + request: ResourceRequest { + base: selected.request.base.to_owned(), + path: ResourcePath { + id: manifest_catalog.id.to_owned(), + r#type: manifest_catalog.r#type.to_owned(), + resource: selected.request.path.resource.to_owned(), + extra: selected .request .path .extra - .iter() - .all(|extra_value| extra_value.name != extra_prop.name), - request: ResourceRequest { - base: selected.request.base.to_owned(), - path: ResourcePath { - id: manifest_catalog.id.to_owned(), - r#type: manifest_catalog.r#type.to_owned(), - resource: selected.request.path.resource.to_owned(), - extra: selected - .request - .path - .extra - .to_owned() - .extend_one(&extra_prop, None), - }, - }, - }); + .to_owned() + .extend_one(&extra_prop, None), + }, + }, + }); let options = extra_prop .options .iter() diff --git a/src/types/resource/stream.rs b/src/types/resource/stream.rs index c3bc1e7c6..7718ba806 100644 --- a/src/types/resource/stream.rs +++ b/src/types/resource/stream.rs @@ -4,7 +4,6 @@ use std::{collections::HashMap, io::Write}; use tracing::trace; use base64::Engine; -use boolinator::Boolinator; use flate2::{ write::{ZlibDecoder, ZlibEncoder}, Compression, @@ -117,9 +116,9 @@ impl Stream { pub fn youtube(video_id: &str) -> Option { video_id .starts_with(YOUTUBE_ADDON_ID_PREFIX) - .as_option() // video id is in format: yt_id:YT_CHANNEL_ID:YT_VIDEO_ID - .and_then(|_| video_id.split(':').nth(2)) + .then(|| video_id.split(':').nth(2)) + .flatten() .map(|yt_id| Self { source: StreamSource::YouTube { yt_id: yt_id.to_owned(), diff --git a/stremio-core-web/Cargo.toml b/stremio-core-web/Cargo.toml index aebac989d..25d1f3f75 100644 --- a/stremio-core-web/Cargo.toml +++ b/stremio-core-web/Cargo.toml @@ -40,7 +40,6 @@ hex = { version = "0.4", optional = true } either = "1.6.*" enclose = "1.1.*" itertools = "0.14.*" -boolinator = "2.4.*" # WASM wasm-bindgen = { version = "=0.2.78", features = ["serde-serialize"], optional = true } diff --git a/stremio-core-web/src/model/serialize_discover.rs b/stremio-core-web/src/model/serialize_discover.rs index ed42894ae..7c8db0d21 100644 --- a/stremio-core-web/src/model/serialize_discover.rs +++ b/stremio-core-web/src/model/serialize_discover.rs @@ -1,7 +1,6 @@ #[cfg(feature = "wasm")] use { crate::model::deep_links_ext::DeepLinksExt, - boolinator::Boolinator, gloo_utils::format::JsValueSerdeExt, itertools::Itertools, stremio_core::deep_links::{DiscoverDeepLinks, MetaItemDeepLinks, StreamDeepLinks}, @@ -171,7 +170,7 @@ pub fn serialize_discover( .collect(), next_page: discover.selectable.next_page.is_some(), }, - catalog: (!discover.catalog.is_empty()).as_option().map(|_| { + catalog: (!discover.catalog.is_empty()).then(|| { let first_page = discover .catalog .first()