Skip to content

Commit

Permalink
Merge pull request #44 from Stremio/bump-core
Browse files Browse the repository at this point in the history
bump core
  • Loading branch information
TheBeastLT committed Mar 25, 2024
2 parents 2a53a78 + 3c2a393 commit 9a149fe
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 76 deletions.
79 changes: 55 additions & 24 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions src/commonMain/rust/bridge/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ impl FromProtobuf<Action> for runtime::Action {
Some(action_ctx::Args::RewindLibraryItem(id)) => {
Action::Ctx(ActionCtx::RewindLibraryItem(id.to_owned()))
}
Some(action_ctx::Args::LibraryItemMarkAsWatched(args)) => {
Action::Ctx(ActionCtx::LibraryItemMarkAsWatched {
id: args.id.to_owned(),
is_watched: args.is_watched,
})
}
Some(action_ctx::Args::ToggleLibraryItemNotifications(args)) => Action::Ctx(
ActionCtx::ToggleLibraryItemNotifications(args.id.to_owned(), args.toggle),
),
Expand Down
18 changes: 18 additions & 0 deletions src/commonMain/rust/bridge/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ impl ToProtobuf<runtime::Event, ()> for Event {
auth_request: auth_request.to_protobuf(&()),
})
}
Event::UserAddonsLocked { addons_locked } => {
runtime::event::Type::UserAddonsLocked(runtime::event::UserAddonsLocked {
addons_locked: *addons_locked,
})
}
Event::UserLibraryMissing { library_missing } => {
runtime::event::Type::UserLibraryMissing(runtime::event::UserLibraryMissing {
library_missing: *library_missing,
})
}
Event::UserLoggedOut { uid } => {
runtime::event::Type::UserLoggedOut(runtime::event::UserLoggedOut {
uid: uid.clone(),
Expand Down Expand Up @@ -119,6 +129,14 @@ impl ToProtobuf<runtime::Event, ()> for Event {
runtime::event::LibraryItemNotificationsToggled { id: id.clone() },
)
}
Event::LibraryItemMarkedAsWatched { id, is_watched } => {
runtime::event::Type::LibraryItemMarkedAsWatched(
runtime::event::LibraryItemMarkedAsWatched {
id: id.clone(),
is_watched: *is_watched,
},
)
}
Event::NotificationsDismissed { id } => runtime::event::Type::NotificationsDismissed(
runtime::event::NotificationsDismissed { id: id.clone() },
),
Expand Down
10 changes: 6 additions & 4 deletions src/commonMain/rust/bridge/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ impl FromProtobuf<Settings> for types::profile::Settings {
))
.unwrap_or(u32::MAX),
audio_passthrough: self.audio_passthrough,
audio_language: self.audio_language.to_string(),
audio_language: Some(self.audio_language.to_string()),
secondary_audio_language: self.secondary_audio_language.clone(),
subtitles_language: self.subtitles_language.to_string(),
subtitles_language: Some(self.subtitles_language.to_string()),
secondary_subtitles_language: self.secondary_subtitles_language.clone(),
subtitles_size: u8::try_from(cmp::max(self.subtitles_size, 0)).unwrap_or(u8::MAX),
subtitles_font: self.subtitles_font.to_string(),
Expand All @@ -84,6 +84,7 @@ impl FromProtobuf<Settings> for types::profile::Settings {
subtitles_text_color: self.subtitles_text_color.to_string(),
subtitles_background_color: self.subtitles_background_color.to_string(),
subtitles_outline_color: self.subtitles_outline_color.to_string(),
subtitles_opacity: u8::try_from(cmp::max(self.subtitles_opacity, 0)).unwrap_or(u8::MAX),
esc_exit_fullscreen: self.esc_exit_fullscreen,
seek_time_duration: u32::try_from(cmp::max(self.seek_time_duration, 0))
.unwrap_or(u32::MAX),
Expand Down Expand Up @@ -158,15 +159,16 @@ impl ToProtobuf<types::profile::Settings, ()> for Settings {
play_in_background: self.play_in_background,
hardware_decoding: self.hardware_decoding,
audio_passthrough: self.audio_passthrough,
audio_language: self.audio_language.to_string(),
subtitles_language: self.subtitles_language.to_string(),
audio_language: self.audio_language.clone().unwrap_or_default(),
subtitles_language: self.subtitles_language.clone().unwrap_or_default(),
subtitles_size: self.subtitles_size as i32,
subtitles_font: self.subtitles_font.to_string(),
subtitles_bold: self.subtitles_bold,
subtitles_offset: self.subtitles_offset as i32,
subtitles_text_color: self.subtitles_text_color.to_string(),
subtitles_background_color: self.subtitles_background_color.to_string(),
subtitles_outline_color: self.subtitles_outline_color.to_string(),
subtitles_opacity: self.subtitles_opacity as i32,
esc_exit_fullscreen: self.esc_exit_fullscreen,
seek_time_duration: self.seek_time_duration as i64,
seek_short_time_duration: self.seek_short_time_duration as i64,
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/rust/bridge/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl
deep_links: types::StreamDeepLinks {
player: deep_links.player,
external_player: types::stream_deep_links::ExternalPlayerLink {
href: deep_links.external_player.href,
download: deep_links.external_player.download,
streaming: deep_links.external_player.streaming,
},
},
Expand Down
7 changes: 6 additions & 1 deletion src/commonMain/rust/model/fields/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ impl FromProtobuf<Sort> for models::library_with_filters::Sort {
fn from_protobuf(&self) -> Sort {
match self {
models::library_with_filters::Sort::LastWatched => Sort::LastWatched,
models::library_with_filters::Sort::NameReverse => Sort::NameReverse,
models::library_with_filters::Sort::Name => Sort::Name,
models::library_with_filters::Sort::TimesWatched => Sort::TimesWatched,
models::library_with_filters::Sort::Watched => Sort::Watched,
models::library_with_filters::Sort::NotWatched => Sort::NotWatched,
}
}
}
Expand Down Expand Up @@ -49,7 +52,10 @@ impl ToProtobuf<models::library_with_filters::Sort, ()> for Sort {
match self {
Sort::LastWatched => models::library_with_filters::Sort::LastWatched,
Sort::Name => models::library_with_filters::Sort::Name,
Sort::NameReverse => models::library_with_filters::Sort::NameReverse,
Sort::TimesWatched => models::library_with_filters::Sort::TimesWatched,
Sort::Watched => models::library_with_filters::Sort::Watched,
Sort::NotWatched => models::library_with_filters::Sort::NotWatched,
}
}
}
Expand Down Expand Up @@ -105,7 +111,6 @@ impl ToProtobuf<models::library_with_filters::Selectable, ()> for Selectable {
models::library_with_filters::Selectable {
types: self.types.to_protobuf(&()),
sorts: self.sorts.to_protobuf(&()),
prev_page: self.prev_page.to_protobuf(&()),
next_page: self.next_page.to_protobuf(&()),
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/proto/stremio/core/models/library_with_filters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ message LibraryWithFilters {
enum Sort {
LastWatched = 0;
Name = 1;
TimesWatched = 2;
NameReverse = 2;
TimesWatched = 3;
Watched = 4;
NotWatched = 5;
}
message Selectable {
repeated SelectableType types = 1;
repeated SelectableSort sorts = 2;
optional SelectablePage prev_page = 3;
optional SelectablePage next_page = 4;
optional SelectablePage next_page = 3;
}
message SelectableType {
optional string type = 1;
Expand Down
Loading

0 comments on commit 9a149fe

Please sign in to comment.