diff --git a/Cargo.lock b/Cargo.lock index 047a370..a86c48e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2404,7 +2404,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#196b655fca466352e8e1fae2aa190d316207dd76" +source = "git+https://github.com/Stremio/stremio-core?branch=development#43e338448a4d568b7c3d057a166c1f0b0feb8a85" dependencies = [ "anyhow", "base64 0.21.7", @@ -2511,7 +2511,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#196b655fca466352e8e1fae2aa190d316207dd76" +source = "git+https://github.com/Stremio/stremio-core?branch=development#43e338448a4d568b7c3d057a166c1f0b0feb8a85" dependencies = [ "case", "proc-macro-crate", @@ -2545,7 +2545,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#196b655fca466352e8e1fae2aa190d316207dd76" +source = "git+https://github.com/Stremio/stremio-core?branch=development#43e338448a4d568b7c3d057a166c1f0b0feb8a85" dependencies = [ "base64 0.13.1", "flate2", diff --git a/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto index d85bc5c..642a758 100644 --- a/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto +++ b/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto @@ -14,26 +14,27 @@ message ActionCtx { oneof args { stremio.core.types.AuthRequest authenticate = 1; google.protobuf.Empty logout = 2; - stremio.core.types.AddonDescriptor install_addon = 3; - google.protobuf.Empty install_trakt_addon = 4; - google.protobuf.Empty logout_trakt = 5; - stremio.core.types.AddonDescriptor upgrade_addon = 6; - stremio.core.types.AddonDescriptor 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; - LibraryItemMarkAsWatched library_item_mark_as_watched = 12; - LibraryItemToggle toggle_library_item_notifications = 13; - string dismiss_notification_item = 14; - google.protobuf.Empty push_user_to_api = 15; - google.protobuf.Empty pull_user_from_api = 16; - google.protobuf.Empty push_addons_to_api = 17; - google.protobuf.Empty pull_addons_from_api = 18; - google.protobuf.Empty sync_library_with_api = 19; - google.protobuf.Empty pull_notifications = 20; - google.protobuf.Empty get_events = 21; - string dismiss_event = 22; + string delete_account = 3; + stremio.core.types.AddonDescriptor install_addon = 4; + google.protobuf.Empty install_trakt_addon = 5; + google.protobuf.Empty logout_trakt = 6; + stremio.core.types.AddonDescriptor upgrade_addon = 7; + stremio.core.types.AddonDescriptor uninstall_addon = 8; + stremio.core.types.Profile.Settings update_settings = 9; + stremio.core.types.MetaItemPreview add_to_library = 10; + string remove_from_library = 11; + string rewind_library_item = 12; + LibraryItemMarkAsWatched library_item_mark_as_watched = 13; + LibraryItemToggle toggle_library_item_notifications = 14; + string dismiss_notification_item = 15; + google.protobuf.Empty push_user_to_api = 16; + google.protobuf.Empty pull_user_from_api = 17; + google.protobuf.Empty push_addons_to_api = 18; + google.protobuf.Empty pull_addons_from_api = 19; + google.protobuf.Empty sync_library_with_api = 20; + google.protobuf.Empty pull_notifications = 21; + google.protobuf.Empty get_events = 22; + string dismiss_event = 23; } message LibraryItemToggle { diff --git a/stremio-core-protobuf/proto/stremio/core/runtime/event.proto b/stremio-core-protobuf/proto/stremio/core/runtime/event.proto index 0349d51..1def36e 100644 --- a/stremio-core-protobuf/proto/stremio/core/runtime/event.proto +++ b/stremio-core-protobuf/proto/stremio/core/runtime/event.proto @@ -26,30 +26,31 @@ message Event { UserAddonsLocked user_addons_locked = 15; UserLibraryMissing user_library_missing = 16; UserLoggedOut user_logged_out = 17; - SessionDeleted session_deleted = 18; - TraktAddonFetched trakt_addon_fetched = 19; - TraktLoggedOut trakt_logged_out = 20; - AddonInstalled addon_installed = 21; - AddonUpgraded addon_upgraded = 22; - AddonUninstalled addon_uninstalled = 23; - SettingsUpdated settings_updated = 24; - LibraryItemAdded library_item_added = 25; - LibraryItemRemoved library_item_removed = 26; - LibraryItemRewinded library_item_rewinded = 27; - LibraryItemNotificationsToggled library_item_notifications_toggled = 28; - LibraryItemMarkedAsWatched library_item_marked_as_watched = 29; - NotificationsDismissed notifications_dismissed = 30; - PlayerPlaying player_playing = 31; - PlayerStopped player_stopped = 32; - PlayerNextVideo player_next_video = 33; - PlayerEnded player_ended = 34; - TraktPlaying trakt_playing = 35; - TraktPaused trakt_paused = 36; - MagnetParsed magnet_parsed = 37; - TorrentParsed torrent_parsed = 38; - PlayingOnDevice playing_on_device = 39; - StreamingServerUrlsBucketChanged streaming_server_urls_bucket_changed = 40; - StreamingServerUrlsPushedToStorage streaming_server_urls_pushed_to_storage = 41; + UserAccountDeleted user_account_deleted = 18; + SessionDeleted session_deleted = 19; + TraktAddonFetched trakt_addon_fetched = 20; + TraktLoggedOut trakt_logged_out = 21; + AddonInstalled addon_installed = 22; + AddonUpgraded addon_upgraded = 23; + AddonUninstalled addon_uninstalled = 24; + SettingsUpdated settings_updated = 25; + LibraryItemAdded library_item_added = 26; + LibraryItemRemoved library_item_removed = 27; + LibraryItemRewinded library_item_rewinded = 28; + LibraryItemNotificationsToggled library_item_notifications_toggled = 29; + LibraryItemMarkedAsWatched library_item_marked_as_watched = 30; + NotificationsDismissed notifications_dismissed = 31; + PlayerPlaying player_playing = 32; + PlayerStopped player_stopped = 33; + PlayerNextVideo player_next_video = 34; + PlayerEnded player_ended = 35; + TraktPlaying trakt_playing = 36; + TraktPaused trakt_paused = 37; + MagnetParsed magnet_parsed = 38; + TorrentParsed torrent_parsed = 39; + PlayingOnDevice playing_on_device = 40; + StreamingServerUrlsBucketChanged streaming_server_urls_bucket_changed = 41; + StreamingServerUrlsPushedToStorage streaming_server_urls_pushed_to_storage = 42; Error error = 100; } @@ -105,6 +106,9 @@ message Event { message UserLoggedOut { optional string uid = 1; } + message UserAccountDeleted { + optional string uid = 1; + } message SessionDeleted { required string auth_key = 1; } diff --git a/stremio-core-protobuf/src/bridge/action.rs b/stremio-core-protobuf/src/bridge/action.rs index 9971264..e04686a 100644 --- a/stremio-core-protobuf/src/bridge/action.rs +++ b/stremio-core-protobuf/src/bridge/action.rs @@ -26,6 +26,9 @@ impl FromProtobuf for runtime::Action { Action::Ctx(ActionCtx::Authenticate(auth_request.from_protobuf())) } Some(action_ctx::Args::Logout(_args)) => Action::Ctx(ActionCtx::Logout), + Some(action_ctx::Args::DeleteAccount(password)) => { + Action::Ctx(ActionCtx::DeleteAccount(password.from_protobuf())) + } Some(action_ctx::Args::InstallAddon(descriptor)) => { Action::Ctx(ActionCtx::InstallAddon(descriptor.from_protobuf())) } diff --git a/stremio-core-protobuf/src/bridge/event.rs b/stremio-core-protobuf/src/bridge/event.rs index 48f8480..a82da45 100644 --- a/stremio-core-protobuf/src/bridge/event.rs +++ b/stremio-core-protobuf/src/bridge/event.rs @@ -77,6 +77,11 @@ impl ToProtobuf for Event { uid: uid.clone(), }) } + Event::UserAccountDeleted { uid } => { + runtime::event::Type::UserAccountDeleted(runtime::event::UserAccountDeleted { + uid: uid.clone(), + }) + } Event::SessionDeleted { auth_key } => { runtime::event::Type::SessionDeleted(runtime::event::SessionDeleted { auth_key: auth_key.0.to_owned(), diff --git a/stremio-core-protobuf/src/bridge/string.rs b/stremio-core-protobuf/src/bridge/string.rs index 3fc1291..b002d97 100644 --- a/stremio-core-protobuf/src/bridge/string.rs +++ b/stremio-core-protobuf/src/bridge/string.rs @@ -1,4 +1,5 @@ use crate::bridge::{FromProtobuf, ToProtobuf}; +use stremio_core::types::profile::Password; use url::Url; impl FromProtobuf for String { @@ -7,6 +8,12 @@ impl FromProtobuf for String { } } +impl FromProtobuf for String { + fn from_protobuf(&self) -> Password { + Password(self.to_owned()) + } +} + impl ToProtobuf for Url { fn to_protobuf(&self, _args: &()) -> String { self.to_string() diff --git a/stremio-core-protobuf/src/model/fields/addon_detail.rs b/stremio-core-protobuf/src/model/fields/addon_detail.rs index d3adcf6..5ae0eae 100644 --- a/stremio-core-protobuf/src/model/fields/addon_detail.rs +++ b/stremio-core-protobuf/src/model/fields/addon_detail.rs @@ -2,10 +2,11 @@ use crate::bridge::{FromProtobuf, ToProtobuf}; use crate::protobuf::stremio::core::models; use stremio_core::models::addon_details::{AddonDetails, Selected}; use stremio_core::models::ctx::Ctx; +use url::Url; impl FromProtobuf for models::addon_details::Selected { fn from_protobuf(&self) -> Selected { - let transport_url = self.transport_url.from_protobuf(); + let transport_url: Url = self.transport_url.from_protobuf(); Selected { transport_url: if transport_url.scheme() == "stremio" {