Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiscoverDeepLinks and LibraryDeepLinks #45

Merged
merged 7 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/androidMain/kotlin/com/stremio/core/DeepLinks.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.stremio.core

class LibraryDeepLinks(
val library: String,
)
3 changes: 3 additions & 0 deletions src/commonMain/rust/bridge/resource_loadable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use inflector::Inflector;
use stremio_core::deep_links::DiscoverDeepLinks;
use stremio_core::models::common::{DescriptorLoadable, ResourceLoadable};
use stremio_core::models::ctx::Ctx;
use stremio_core::types::addon::{DescriptorPreview, ResourceRequest};
Expand Down Expand Up @@ -40,10 +41,12 @@ impl ToProtobuf<models::LoadablePage, Ctx> for ResourceLoadable<Vec<MetaItemPrev
)
})
.unwrap_or_default();
let deep_links = DiscoverDeepLinks::from(&self.request).to_protobuf(&());
models::LoadablePage {
title,
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(ctx, &self.request)),
deep_links,
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/commonMain/rust/model/fields/catalogs_with_extra.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use stremio_core::deep_links::DiscoverDeepLinks;
use stremio_core::models::catalog_with_filters::Catalog;
use stremio_core::models::catalogs_with_extra::{CatalogsWithExtra, Selected};
use stremio_core::models::ctx::Ctx;
Expand Down Expand Up @@ -40,3 +41,11 @@ impl ToProtobuf<models::CatalogsWithExtra, Ctx> for CatalogsWithExtra {
}
}
}

impl ToProtobuf<models::DiscoverDeepLinks, ()> for DiscoverDeepLinks {
fn to_protobuf(&self, _args: &()) -> models::DiscoverDeepLinks {
models::DiscoverDeepLinks {
discover: self.discover.clone(),
}
}
}
7 changes: 6 additions & 1 deletion src/main/proto/stremio/core/models/catalogs_with_extra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ message LoadablePage {
Error error = 4;
Page ready = 5;
}
required DiscoverDeepLinks deep_links = 6;
}

message Page {
repeated stremio.core.types.MetaItemPreview meta_items = 1;
}
}

message DiscoverDeepLinks {
required string discover = 1;
}
Loading