Skip to content

Commit

Permalink
Merge pull request #50 from Stremio/feat/library-with-filters-actions
Browse files Browse the repository at this point in the history
feat: add actions for LibraryWithFilters
  • Loading branch information
tymmesyde authored Oct 18, 2024
2 parents 8d1ef7d + e712ff1 commit fb59485
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
16 changes: 12 additions & 4 deletions src/commonMain/rust/bridge/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::ops::Range;

use stremio_core::runtime::msg::{
Action, ActionCatalogWithFilters, ActionCatalogsWithExtra, ActionCtx, ActionLibraryByType,
ActionLink, ActionLoad, ActionMetaDetails, ActionPlayer, ActionStreamingServer,
CreateTorrentArgs, PlayOnDeviceArgs,
ActionLibraryWithFilters, ActionLink, ActionLoad, ActionMetaDetails, ActionPlayer,
ActionStreamingServer, CreateTorrentArgs, PlayOnDeviceArgs,
};
use stremio_core::runtime::RuntimeAction;

Expand All @@ -13,8 +13,8 @@ use crate::model::AndroidModel;
use crate::protobuf::stremio::core::runtime;
use crate::protobuf::stremio::core::runtime::{
action_catalog_with_filters, action_catalogs_with_extra, action_ctx, action_library_by_type,
action_link, action_load, action_meta_details, action_player, action_streaming_server,
create_torrent_args, Field,
action_library_with_filters, action_link, action_load, action_meta_details, action_player,
action_streaming_server, create_torrent_args, Field,
};

impl FromProtobuf<Action> for runtime::Action {
Expand Down Expand Up @@ -114,6 +114,14 @@ impl FromProtobuf<Action> for runtime::Action {
None => unimplemented!("ActionCatalogsWithExtra missing"),
}
}
Some(runtime::action::Type::LibraryWithFilters(action_library_with_filters)) => {
match &action_library_with_filters.args {
Some(action_library_with_filters::Args::LoadNextPage(_args)) => {
Action::LibraryWithFilters(ActionLibraryWithFilters::LoadNextPage)
}
None => unimplemented!("ActionLibraryWithFilters missing"),
}
}
Some(runtime::action::Type::LibraryByType(action_library_by_type)) => {
match &action_library_by_type.args {
Some(action_library_by_type::Args::LoadNextPage(index)) => {
Expand Down
14 changes: 8 additions & 6 deletions src/main/proto/stremio/core/runtime/action.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ option java_package = "com.stremio.core.runtime.msg";

import "stremio/core/runtime/action_catalogs_with_extra.proto";
import "stremio/core/runtime/action_catalog_with_filters.proto";
import "stremio/core/runtime/action_library_with_filters.proto";
import "stremio/core/runtime/action_library_by_type.proto";
import "stremio/core/runtime/action_ctx.proto";
import "stremio/core/runtime/action_link.proto";
Expand All @@ -26,12 +27,13 @@ message Action {
ActionLink link = 2;
ActionCatalogWithFilters catalog_with_filters = 3;
ActionCatalogsWithExtra catalogs_with_extra = 4;
ActionLibraryByType library_by_type = 5;
ActionMetaDetails meta_details = 6;
ActionStreamingServer streaming_server = 7;
ActionPlayer player = 8;
ActionLoad load = 9;
ActionUnload unload = 10;
ActionLibraryWithFilters library_with_filters = 5;
ActionLibraryByType library_by_type = 6;
ActionMetaDetails meta_details = 7;
ActionStreamingServer streaming_server = 8;
ActionPlayer player = 9;
ActionLoad load = 10;
ActionUnload unload = 11;
}

message ActionUnload {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto2";

package stremio.core.runtime;

option java_package = "com.stremio.core.runtime.msg";

import "google/protobuf/empty.proto";

message ActionLibraryWithFilters {
oneof args {
google.protobuf.Empty load_next_page = 1;
}
}

0 comments on commit fb59485

Please sign in to comment.