Skip to content

Commit

Permalink
refactor: move DiscoverDeepLinks to model and declare LibraryDeepLink…
Browse files Browse the repository at this point in the history
…s in kotlin
  • Loading branch information
tymmesyde committed Mar 28, 2024
1 parent b5cff01 commit 013382a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 39 deletions.
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,
)
21 changes: 0 additions & 21 deletions src/commonMain/rust/bridge/deep_links.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/commonMain/rust/bridge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ pub use auth_request::*;
mod date;
pub use date::*;

mod deep_links;
pub use deep_links::*;

mod env_error;
pub use env_error::*;

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(),
}
}
}
13 changes: 0 additions & 13 deletions src/main/proto/stremio/core/deep_links/deep_links.proto

This file was deleted.

7 changes: 5 additions & 2 deletions src/main/proto/stremio/core/models/catalogs_with_extra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ option java_package = "com.stremio.core.models";
import "stremio/core/models/loadable.proto";
import "stremio/core/types/addon.proto";
import "stremio/core/types/meta_item_preview.proto";
import "stremio/core/deep_links/deep_links.proto";

message CatalogsWithExtra {
optional Selected selected = 1;
Expand All @@ -31,9 +30,13 @@ message LoadablePage {
Error error = 4;
Page ready = 5;
}
required stremio.core.deeplinks.DiscoverDeepLinks deep_links = 6;
required DiscoverDeepLinks deep_links = 6;
}

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

message DiscoverDeepLinks {
required string discover = 1;
}

0 comments on commit 013382a

Please sign in to comment.