diff --git a/Cargo.lock b/Cargo.lock index 8cdac86..b212704 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2329,7 +2329,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=implement-stream-state-management#26593fe6af789505bdfcb64f931e3546ec1e18bc" +source = "git+https://github.com/Stremio/stremio-core?branch=development#109d2cb19a12c668ec338661481c50116514552a" dependencies = [ "anyhow", "base64 0.21.0", @@ -2415,7 +2415,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=implement-stream-state-management#26593fe6af789505bdfcb64f931e3546ec1e18bc" +source = "git+https://github.com/Stremio/stremio-core?branch=development#109d2cb19a12c668ec338661481c50116514552a" dependencies = [ "case", "proc-macro-crate", @@ -2445,7 +2445,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=implement-stream-state-management#26593fe6af789505bdfcb64f931e3546ec1e18bc" +source = "git+https://github.com/Stremio/stremio-core?branch=development#109d2cb19a12c668ec338661481c50116514552a" dependencies = [ "base64 0.13.0", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 3f47c57..95c5484 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,13 +16,13 @@ lto = true opt-level = 3 [dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", branch = "implement-stream-state-management", features = [ +stremio-core = { git = "https://github.com/Stremio/stremio-core", branch = "development", features = [ "derive", "analytics", "env-future-send", ] } -stremio-watched-bitfield = { git = "https://github.com/Stremio/stremio-core", branch = "implement-stream-state-management" } +stremio-watched-bitfield = { git = "https://github.com/Stremio/stremio-core", branch = "development" } serde = "1.0.*" serde_json = "1.0.*" futures = "0.3.*" diff --git a/src/commonMain/rust/bridge/action.rs b/src/commonMain/rust/bridge/action.rs index 7a790e1..1532b55 100644 --- a/src/commonMain/rust/bridge/action.rs +++ b/src/commonMain/rust/bridge/action.rs @@ -31,6 +31,7 @@ impl FromProtobuf for runtime::Action { Some(action_ctx::Args::InstallTraktAddon(_args)) => { Action::Ctx(ActionCtx::InstallTraktAddon) } + Some(action_ctx::Args::LogoutTrakt(_args)) => Action::Ctx(ActionCtx::LogoutTrakt), Some(action_ctx::Args::UpgradeAddon(descriptor)) => { Action::Ctx(ActionCtx::UpgradeAddon(descriptor.from_protobuf())) } @@ -49,6 +50,12 @@ impl FromProtobuf for runtime::Action { Some(action_ctx::Args::RewindLibraryItem(id)) => { Action::Ctx(ActionCtx::RewindLibraryItem(id.to_owned())) } + Some(action_ctx::Args::ToggleLibraryItemNotifications(args)) => Action::Ctx( + ActionCtx::ToggleLibraryItemNotifications(args.id.to_owned(), args.toggle), + ), + Some(action_ctx::Args::DismissNotificationItem(id)) => { + Action::Ctx(ActionCtx::DismissNotificationItem(id.to_owned())) + } Some(action_ctx::Args::PushUserToApi(_args)) => { Action::Ctx(ActionCtx::PushUserToAPI) } @@ -64,6 +71,9 @@ impl FromProtobuf for runtime::Action { Some(action_ctx::Args::SyncLibraryWithApi(_args)) => { Action::Ctx(ActionCtx::SyncLibraryWithAPI) } + Some(action_ctx::Args::PullNotifications(_args)) => { + Action::Ctx(ActionCtx::PullNotifications) + } None => unimplemented!("ActionCtx missing"), }, Some(runtime::action::Type::Link(action_link)) => match &action_link.args { @@ -211,6 +221,10 @@ impl FromProtobuf for runtime::Action { Action::Load(ActionLoad::Player(Box::new(selected.from_protobuf()))) } Some(action_load::Args::Link(_args)) => Action::Load(ActionLoad::Link), + Some(action_load::Args::DataExport(_args)) => Action::Load(ActionLoad::DataExport), + Some(action_load::Args::LocalSearch(_args)) => { + Action::Load(ActionLoad::LocalSearch) + } None => unimplemented!("ActionLoad missing"), }, Some(runtime::action::Type::Unload(_args)) => Action::Unload, diff --git a/src/commonMain/rust/bridge/event.rs b/src/commonMain/rust/bridge/event.rs index 0441b0b..7d821d9 100644 --- a/src/commonMain/rust/bridge/event.rs +++ b/src/commonMain/rust/bridge/event.rs @@ -21,6 +21,11 @@ impl ToProtobuf for Event { Event::StreamsPushedToStorage { uid } => runtime::event::Type::StreamsPushedToStorage( runtime::event::StreamsPushedToStorage { uid: uid.clone() }, ), + Event::SearchHistoryPushedToStorage { uid } => { + runtime::event::Type::SearchHistoryPushedToStorage( + runtime::event::SearchHistoryPushedToStorage { uid: uid.clone() }, + ) + } Event::NotificationsPushedToStorage { ids } => { runtime::event::Type::NotificationsPushedToStorage( runtime::event::NotificationsPushedToStorage { ids: ids.clone() }, diff --git a/src/commonMain/rust/bridge/library_item.rs b/src/commonMain/rust/bridge/library_item.rs index e92aa62..417cd58 100644 --- a/src/commonMain/rust/bridge/library_item.rs +++ b/src/commonMain/rust/bridge/library_item.rs @@ -27,6 +27,7 @@ impl ToProtobuf for LibraryItem { time_offset: self.state.time_offset, duration: self.state.duration, video_id: self.state.video_id.clone(), + no_notif: self.state.no_notif, }, behavior_hints: self.behavior_hints.to_protobuf(&()), deep_links: types::MetaItemDeepLinks { diff --git a/src/commonMain/rust/bridge/loadable.rs b/src/commonMain/rust/bridge/loadable.rs index fbf4be6..fc546f3 100644 --- a/src/commonMain/rust/bridge/loadable.rs +++ b/src/commonMain/rust/bridge/loadable.rs @@ -99,6 +99,40 @@ impl } } +impl + ToProtobuf< + models::loadable_stream::Content, + (&Ctx, &String, &ResourceRequest, Option<&ResourceRequest>), + > for Loadable, ResourceError> +{ + fn to_protobuf( + &self, + (ctx, addon_name, stream_request, meta_request): &( + &Ctx, + &String, + &ResourceRequest, + Option<&ResourceRequest>, + ), + ) -> models::loadable_stream::Content { + match &self { + Loadable::Ready(ready) => { + models::loadable_stream::Content::Ready(models::OptionStream { + stream: ready.to_protobuf(&( + Some(*ctx), + Some(*addon_name), + Some(*stream_request), + *meta_request, + )), + }) + } + Loadable::Err(error) => models::loadable_stream::Content::Error(models::Error { + message: error.to_string(), + }), + Loadable::Loading => models::loadable_stream::Content::Loading(models::Loading {}), + } + } +} + impl ToProtobuf> for Loadable, ResourceError> { diff --git a/src/commonMain/rust/bridge/profile.rs b/src/commonMain/rust/bridge/profile.rs index 878c480..ebb3a79 100644 --- a/src/commonMain/rust/bridge/profile.rs +++ b/src/commonMain/rust/bridge/profile.rs @@ -90,6 +90,7 @@ impl FromProtobuf for types::profile::Settings { seek_short_time_duration: u32::try_from(cmp::max(self.seek_time_duration, 0)) .unwrap_or(u32::MAX), pause_on_minimize: self.pause_on_minimize, + surround_sound: self.surround_sound, streaming_server_warning_dismissed: None, } } @@ -175,6 +176,7 @@ impl ToProtobuf for Settings { player_type: self.player_type.clone(), frame_rate_matching_strategy: self.frame_rate_matching_strategy.to_protobuf(&()) as i32, next_video_notification_duration: self.next_video_notification_duration as i64, + surround_sound: self.surround_sound, } } } diff --git a/src/commonMain/rust/bridge/resource_loadable.rs b/src/commonMain/rust/bridge/resource_loadable.rs index d4c9384..efa9f36 100644 --- a/src/commonMain/rust/bridge/resource_loadable.rs +++ b/src/commonMain/rust/bridge/resource_loadable.rs @@ -5,6 +5,7 @@ use stremio_core::types::addon::{DescriptorPreview, ResourceRequest}; use stremio_core::types::library::LibraryItem; use stremio_core::types::resource::{MetaItem, MetaItemPreview, Stream, Subtitles}; use stremio_watched_bitfield::WatchedBitField; +use url::Url; use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::models; @@ -54,14 +55,7 @@ impl ToProtobuf, Option<&W &self, (ctx, library_item, watched): &(&Ctx, Option<&LibraryItem>, Option<&WatchedBitField>), ) -> models::LoadableMetaItem { - let addon_name = ctx - .profile - .addons - .iter() - .find(|addon| addon.transport_url == self.request.base) - .map(|addon| &addon.manifest.name) - .cloned() - .unwrap_or_default(); + let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableMetaItem { title: addon_name.to_string(), request: self.request.to_protobuf(&()), @@ -82,14 +76,7 @@ impl ToProtobuf)> &self, (ctx, meta_request): &(&Ctx, Option<&ResourceRequest>), ) -> models::LoadableStreams { - let addon_name = ctx - .profile - .addons - .iter() - .find(|addon| addon.transport_url == self.request.base) - .map(|addon| &addon.manifest.name) - .cloned() - .unwrap_or_default(); + let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableStreams { title: addon_name.to_owned(), request: self.request.to_protobuf(&()), @@ -100,16 +87,26 @@ impl ToProtobuf)> } } +impl ToProtobuf)> + for ResourceLoadable> +{ + fn to_protobuf( + &self, + (ctx, meta_request): &(&Ctx, Option<&ResourceRequest>), + ) -> models::LoadableStream { + let addon_name = get_addon_name(ctx, &self.request.base); + models::LoadableStream { + request: self.request.to_protobuf(&()), + content: self + .content + .to_protobuf(&(ctx, &addon_name, &self.request, *meta_request)), + } + } +} + impl ToProtobuf for ResourceLoadable> { fn to_protobuf(&self, ctx: &Ctx) -> models::LoadableSubtitles { - let addon_name = ctx - .profile - .addons - .iter() - .find(|addon| addon.transport_url == self.request.base) - .map(|addon| &addon.manifest.name) - .cloned() - .unwrap_or_default(); + let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableSubtitles { title: addon_name.to_owned(), request: self.request.to_protobuf(&()), @@ -135,3 +132,13 @@ impl ToProtobuf for DescriptorLoadable { } } } + +fn get_addon_name(ctx: &Ctx, addon_url: &Url) -> String { + ctx.profile + .addons + .iter() + .find(|addon| &addon.transport_url == addon_url) + .map(|addon| &addon.manifest.name) + .cloned() + .unwrap_or_default() +} diff --git a/src/commonMain/rust/model/fields/meta_details.rs b/src/commonMain/rust/model/fields/meta_details.rs index 11057ac..d75513a 100644 --- a/src/commonMain/rust/model/fields/meta_details.rs +++ b/src/commonMain/rust/model/fields/meta_details.rs @@ -1,6 +1,5 @@ use boolinator::Boolinator; use stremio_core::deep_links::MetaItemDeepLinks; -use stremio_core::models::common::Loadable; use stremio_core::models::ctx::Ctx; use stremio_core::models::meta_details::{MetaDetails, Selected}; use stremio_core::runtime::Env; @@ -159,6 +158,9 @@ impl } }), in_library: library_item.map(|item| !item.removed).unwrap_or_default(), + receive_notifications: library_item + .map(|item| !item.state.no_notif) + .unwrap_or_default(), } } } @@ -218,23 +220,6 @@ impl ToProtobuf for MetaDetails { }) .unwrap_or_else(|| meta_item.preview.name.to_owned()) }); - let suggested_stream_request = - self.suggested_stream.as_ref().and_then(|suggested_stream| { - streams - .iter() - .find(|resource| match &resource.content { - Some(Loadable::Ready(streams)) => streams.contains(suggested_stream), - _ => false, - }) - .map(|resource| &resource.request) - }); - let suggested_stream_addon_name = suggested_stream_request.and_then(|stream_request| { - ctx.profile - .addons - .iter() - .find(|addon| addon.transport_url == stream_request.base) - .map(|addon| &addon.manifest.name) - }); models::MetaDetails { selected: self.selected.to_protobuf(&()), title, @@ -244,12 +229,7 @@ impl ToProtobuf for MetaDetails { self.watched.as_ref(), )), streams: streams.to_protobuf(&(ctx, meta_request)), - suggested_stream: self.suggested_stream.to_protobuf(&( - Some(ctx), - suggested_stream_addon_name, - suggested_stream_request, - meta_request, - )), + suggested_stream: self.suggested_stream.to_protobuf(&(ctx, meta_request)), } } } diff --git a/src/commonMain/rust/model/fields/player.rs b/src/commonMain/rust/model/fields/player.rs index 4ce92c4..47a9bbc 100644 --- a/src/commonMain/rust/model/fields/player.rs +++ b/src/commonMain/rust/model/fields/player.rs @@ -1,6 +1,6 @@ use stremio_core::models::ctx::Ctx; use stremio_core::models::player::{Player, Selected, VideoParams}; -use stremio_core::types::streams::StreamItemState; +use stremio_core::types::streams::{AudioTrack, StreamItemState, SubtitleTrack}; use crate::bridge::{FromProtobuf, ToProtobuf}; use crate::protobuf::stremio::core::models; @@ -19,11 +19,9 @@ impl FromProtobuf for models::player::Selected { impl FromProtobuf for models::player::StreamState { fn from_protobuf(&self) -> StreamItemState { StreamItemState { - subtitle_track_id: self.subtitle_track_id.to_owned(), - subtitle_language: self.subtitle_language.to_owned(), + subtitle_track: self.subtitle_track.from_protobuf(), subtitle_delay: self.subtitle_delay.to_owned(), - audio_track_id: self.audio_track_id.to_owned(), - audio_language: self.audio_language.to_owned(), + audio_track: self.audio_track.from_protobuf(), audio_delay: self.audio_delay.to_owned(), playback_speed: self.playback_speed.to_owned(), player_type: self.player_type.to_owned(), @@ -31,11 +29,31 @@ impl FromProtobuf for models::player::StreamState { } } +impl FromProtobuf for models::player::SubtitleTrack { + fn from_protobuf(&self) -> SubtitleTrack { + SubtitleTrack { + id: self.id.to_owned(), + embedded: self.embedded, + language: self.language.to_owned(), + } + } +} + +impl FromProtobuf for models::player::AudioTrack { + fn from_protobuf(&self) -> AudioTrack { + AudioTrack { + id: self.id.to_owned(), + language: self.language.to_owned(), + } + } +} + impl FromProtobuf for models::player::VideoParams { fn from_protobuf(&self) -> VideoParams { VideoParams { hash: self.hash.to_owned(), size: self.size.map(|x| x as u64).to_owned(), + filename: self.filename.to_owned(), } } } @@ -45,6 +63,7 @@ impl ToProtobuf for VideoParams { models::player::VideoParams { hash: self.hash.to_owned(), size: self.size.map(|x| x as i64).to_owned(), + filename: self.filename.to_owned(), } } } @@ -52,11 +71,9 @@ impl ToProtobuf for VideoParams { impl ToProtobuf for StreamItemState { fn to_protobuf(&self, _args: &()) -> models::player::StreamState { models::player::StreamState { - subtitle_track_id: self.subtitle_track_id.to_owned(), - subtitle_language: self.subtitle_language.to_owned(), + subtitle_track: self.subtitle_track.to_protobuf(&()), subtitle_delay: self.subtitle_delay.to_owned(), - audio_track_id: self.audio_track_id.to_owned(), - audio_language: self.audio_language.to_owned(), + audio_track: self.audio_track.to_protobuf(&()), audio_delay: self.audio_delay.to_owned(), playback_speed: self.playback_speed.to_owned(), player_type: self.player_type.to_owned(), @@ -64,6 +81,25 @@ impl ToProtobuf for StreamItemState { } } +impl ToProtobuf for SubtitleTrack { + fn to_protobuf(&self, _args: &()) -> models::player::SubtitleTrack { + models::player::SubtitleTrack { + id: self.id.to_owned(), + embedded: self.embedded, + language: self.language.to_owned(), + } + } +} + +impl ToProtobuf for AudioTrack { + fn to_protobuf(&self, _args: &()) -> models::player::AudioTrack { + models::player::AudioTrack { + id: self.id.to_owned(), + language: self.language.to_owned(), + } + } +} + impl ToProtobuf for Selected { fn to_protobuf(&self, ctx: &Ctx) -> models::player::Selected { let addon_name = self.stream_request.as_ref().and_then(|request| { diff --git a/src/commonMain/rust/model/model.rs b/src/commonMain/rust/model/model.rs index e2eec01..7e2e30e 100644 --- a/src/commonMain/rust/model/model.rs +++ b/src/commonMain/rust/model/model.rs @@ -16,6 +16,7 @@ use stremio_core::types::library::LibraryBucket; use stremio_core::types::notifications::NotificationsBucket; use stremio_core::types::profile::Profile; use stremio_core::types::resource::MetaItemPreview; +use stremio_core::types::search_history::SearchHistoryBucket; use stremio_core::types::streams::StreamsBucket; use stremio_core::Model; @@ -47,11 +48,12 @@ impl AndroidModel { library: LibraryBucket, streams: StreamsBucket, notifications: NotificationsBucket, + search_history: SearchHistoryBucket, ) -> (AndroidModel, Effects) { let (continue_watching_preview, continue_watching_preview_effects) = ContinueWatchingPreview::new(&library, ¬ifications); - let ctx = Ctx::new(profile, library, streams, notifications); + let ctx = Ctx::new(profile, library, streams, notifications, search_history); let (discover, discover_effects) = CatalogWithFilters::::new(&ctx.profile); let (library_, library_effects) = diff --git a/src/commonMain/rust/stremio_core_android.rs b/src/commonMain/rust/stremio_core_android.rs index 051cff5..2567231 100644 --- a/src/commonMain/rust/stremio_core_android.rs +++ b/src/commonMain/rust/stremio_core_android.rs @@ -21,6 +21,7 @@ use stremio_core::types::library::LibraryBucket; use stremio_core::types::notifications::NotificationsBucket; use stremio_core::types::profile::Profile; use stremio_core::types::resource::Stream; +use stremio_core::types::search_history::SearchHistoryBucket; use stremio_core::types::streams::StreamsBucket; use crate::bridge::{FromProtobuf, ToJNIByteArray, ToProtobuf}; @@ -81,8 +82,9 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_initializeNative( >( profile.uid(), vec![] )); + let search_history = SearchHistoryBucket::new(profile.uid()); let (model, effects) = - AndroidModel::new(profile, library, streams, notifications); + AndroidModel::new(profile, library, streams, notifications, search_history); let (runtime, rx) = Runtime::::new( model, effects.into_iter().collect::>(), diff --git a/src/main/proto/stremio/core/models/meta_details.proto b/src/main/proto/stremio/core/models/meta_details.proto index 9d32aee..9136b99 100644 --- a/src/main/proto/stremio/core/models/meta_details.proto +++ b/src/main/proto/stremio/core/models/meta_details.proto @@ -14,7 +14,7 @@ message MetaDetails { optional string title = 2; optional LoadableMetaItem meta_item = 3; repeated LoadableStreams streams = 4; - optional stremio.core.types.Stream suggested_stream = 5; + optional LoadableStream suggested_stream = 5; message Selected { required stremio.core.types.ResourcePath meta_path = 1; @@ -45,4 +45,17 @@ message LoadableStreams { message Streams { repeated stremio.core.types.Stream streams = 1; +} + +message LoadableStream { + required stremio.core.types.ResourceRequest request = 1; + oneof content { + Loading loading = 2; + Error error = 3; + OptionStream ready = 4; + } +} + +message OptionStream { + optional stremio.core.types.Stream stream = 1; } \ No newline at end of file diff --git a/src/main/proto/stremio/core/models/player.proto b/src/main/proto/stremio/core/models/player.proto index b97bbab..aee36f9 100644 --- a/src/main/proto/stremio/core/models/player.proto +++ b/src/main/proto/stremio/core/models/player.proto @@ -26,16 +26,24 @@ message Player { message VideoParams { optional string hash = 1; optional int64 size = 2; + optional string filename = 3; } message StreamState { - optional string subtitle_track_id = 1; - optional string subtitle_language = 2; - optional int64 subtitle_delay = 3; - optional string audio_track_id = 4; - optional string audio_language = 5; - optional int64 audio_delay = 6; - optional float playback_speed = 7; - optional string player_type = 8; + optional SubtitleTrack subtitle_track = 1; + optional int64 subtitle_delay = 2; + optional AudioTrack audio_track = 3; + optional int64 audio_delay = 4; + optional float playback_speed = 5; + optional string player_type = 6; + } + message SubtitleTrack { + required string id = 1; + required bool embedded = 2; + optional string language = 3; + } + message AudioTrack { + required string id = 1; + optional string language = 2; } message Selected { required stremio.core.types.Stream stream = 1; diff --git a/src/main/proto/stremio/core/runtime/action_ctx.proto b/src/main/proto/stremio/core/runtime/action_ctx.proto index bf2b650..45b3027 100644 --- a/src/main/proto/stremio/core/runtime/action_ctx.proto +++ b/src/main/proto/stremio/core/runtime/action_ctx.proto @@ -16,16 +16,25 @@ message ActionCtx { google.protobuf.Empty logout = 2; stremio.core.types.Descriptor install_addon = 3; google.protobuf.Empty install_trakt_addon = 4; - stremio.core.types.Descriptor upgrade_addon = 5; - stremio.core.types.Descriptor uninstall_addon = 6; - stremio.core.types.Profile.Settings update_settings = 7; - stremio.core.types.MetaItemPreview add_to_library = 8; - string remove_from_library = 9; - string rewind_library_item = 10; - google.protobuf.Empty push_user_to_api = 11; - google.protobuf.Empty pull_user_from_api = 12; - google.protobuf.Empty push_addons_to_api = 13; - google.protobuf.Empty pull_addons_from_api = 14; - google.protobuf.Empty sync_library_with_api = 15; + google.protobuf.Empty logout_trakt = 5; + stremio.core.types.Descriptor upgrade_addon = 6; + stremio.core.types.Descriptor uninstall_addon = 7; + stremio.core.types.Profile.Settings update_settings = 8; + stremio.core.types.MetaItemPreview add_to_library = 9; + string remove_from_library = 10; + string rewind_library_item = 11; + LibraryItemToggle toggle_library_item_notifications = 12; + string dismiss_notification_item = 13; + google.protobuf.Empty push_user_to_api = 14; + google.protobuf.Empty pull_user_from_api = 15; + google.protobuf.Empty push_addons_to_api = 16; + google.protobuf.Empty pull_addons_from_api = 17; + google.protobuf.Empty sync_library_with_api = 18; + google.protobuf.Empty pull_notifications = 19; + } + + message LibraryItemToggle { + required string id = 1; + required bool toggle = 2; } } \ No newline at end of file diff --git a/src/main/proto/stremio/core/runtime/action_load.proto b/src/main/proto/stremio/core/runtime/action_load.proto index af882a1..22b9124 100644 --- a/src/main/proto/stremio/core/runtime/action_load.proto +++ b/src/main/proto/stremio/core/runtime/action_load.proto @@ -25,5 +25,7 @@ message ActionLoad { stremio.core.models.MetaDetails.Selected meta_details = 7; stremio.core.models.Player.Selected player = 8; google.protobuf.Empty link = 9; + google.protobuf.Empty data_export = 10; + google.protobuf.Empty local_search = 11; } } \ No newline at end of file diff --git a/src/main/proto/stremio/core/runtime/event.proto b/src/main/proto/stremio/core/runtime/event.proto index 55f1ab3..e76ba90 100644 --- a/src/main/proto/stremio/core/runtime/event.proto +++ b/src/main/proto/stremio/core/runtime/event.proto @@ -12,36 +12,37 @@ message Event { ProfilePushedToStorage profile_pushed_to_storage = 1; LibraryItemsPushedToStorage library_items_pushed_to_storage = 2; StreamsPushedToStorage streams_pushed_to_storage = 3; - NotificationsPushedToStorage notifications_pushed_to_storage = 4; - UserPulledFromAPI user_pulled_from_api = 5; - UserPushedToAPI user_pushed_to_api = 6; - AddonsPulledFromAPI addons_pulled_from_api = 7; - AddonsPushedToAPI addons_pushed_to_api = 8; - LibrarySyncWithAPIPlanned library_sync_with_api_planned = 9; - LibraryItemsPushedToAPI library_items_pushed_to_api = 10; - LibraryItemsPulledFromAPI library_items_pulled_from_api = 11; - UserAuthenticated user_authenticated = 12; - UserLoggedOut user_logged_out = 13; - SessionDeleted session_deleted = 14; - TraktAddonFetched trakt_addon_fetched = 15; - TraktLoggedOut trakt_logged_out = 16; - AddonInstalled addon_installed = 17; - AddonUpgraded addon_upgraded = 18; - AddonUninstalled addon_uninstalled = 19; - SettingsUpdated settings_updated = 20; - LibraryItemAdded library_item_added = 21; - LibraryItemRemoved library_item_removed = 22; - LibraryItemRewinded library_item_rewinded = 23; - LibraryItemNotificationsToggled library_item_notifications_toggled = 24; - NotificationsDismissed notifications_dismissed = 25; - PlayerPlaying player_playing = 26; - PlayerStopped player_stopped = 27; - PlayerEnded player_ended = 28; - TraktPlaying trakt_playing = 29; - TraktPaused trakt_paused = 30; - MagnetParsed magnet_parsed = 31; - TorrentParsed torrent_parsed = 32; - PlayingOnDevice playing_on_device = 33; + SearchHistoryPushedToStorage search_history_pushed_to_storage = 4; + NotificationsPushedToStorage notifications_pushed_to_storage = 5; + UserPulledFromAPI user_pulled_from_api = 6; + UserPushedToAPI user_pushed_to_api = 7; + AddonsPulledFromAPI addons_pulled_from_api = 8; + AddonsPushedToAPI addons_pushed_to_api = 9; + LibrarySyncWithAPIPlanned library_sync_with_api_planned = 10; + LibraryItemsPushedToAPI library_items_pushed_to_api = 11; + LibraryItemsPulledFromAPI library_items_pulled_from_api = 12; + UserAuthenticated user_authenticated = 13; + UserLoggedOut user_logged_out = 14; + SessionDeleted session_deleted = 15; + TraktAddonFetched trakt_addon_fetched = 16; + TraktLoggedOut trakt_logged_out = 17; + AddonInstalled addon_installed = 18; + AddonUpgraded addon_upgraded = 19; + AddonUninstalled addon_uninstalled = 20; + SettingsUpdated settings_updated = 21; + LibraryItemAdded library_item_added = 22; + LibraryItemRemoved library_item_removed = 23; + LibraryItemRewinded library_item_rewinded = 24; + LibraryItemNotificationsToggled library_item_notifications_toggled = 25; + NotificationsDismissed notifications_dismissed = 26; + PlayerPlaying player_playing = 27; + PlayerStopped player_stopped = 28; + PlayerEnded player_ended = 29; + TraktPlaying trakt_playing = 30; + TraktPaused trakt_paused = 31; + MagnetParsed magnet_parsed = 32; + TorrentParsed torrent_parsed = 33; + PlayingOnDevice playing_on_device = 34; Error error = 100; } @@ -54,6 +55,9 @@ message Event { message StreamsPushedToStorage { optional string uid = 1; } + message SearchHistoryPushedToStorage { + optional string uid = 1; + } message NotificationsPushedToStorage { repeated string ids = 1; } diff --git a/src/main/proto/stremio/core/types/library.proto b/src/main/proto/stremio/core/types/library.proto index 469248b..a8ad3d8 100644 --- a/src/main/proto/stremio/core/types/library.proto +++ b/src/main/proto/stremio/core/types/library.proto @@ -24,4 +24,5 @@ message LibraryItemState { required uint64 time_offset = 1; required uint64 duration = 2; optional string video_id = 3; + required bool no_notif = 4; } diff --git a/src/main/proto/stremio/core/types/meta_item.proto b/src/main/proto/stremio/core/types/meta_item.proto index 7931ca7..b5f05cb 100644 --- a/src/main/proto/stremio/core/types/meta_item.proto +++ b/src/main/proto/stremio/core/types/meta_item.proto @@ -27,6 +27,7 @@ message MetaItem { required MetaItemDeepLinks deep_links = 16; optional double progress = 17; required bool in_library = 18; + required bool receive_notifications = 19; } enum PosterShape { diff --git a/src/main/proto/stremio/core/types/profile.proto b/src/main/proto/stremio/core/types/profile.proto index 19ccd09..b4b8893 100644 --- a/src/main/proto/stremio/core/types/profile.proto +++ b/src/main/proto/stremio/core/types/profile.proto @@ -36,6 +36,7 @@ message Profile { optional string player_type = 23; required FrameRateMatchingStrategy frame_rate_matching_strategy = 24; required int64 next_video_notification_duration = 25; + required bool surround_sound = 26; } enum FrameRateMatchingStrategy {