Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Stremio/stremio-core-kotlin into …
Browse files Browse the repository at this point in the history
…debug
  • Loading branch information
nklhtv committed Aug 3, 2022
2 parents a438383 + 7853844 commit 394f1ed
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stremio-core-android"
version = "1.0.11"
version = "1.0.12"
authors = ["Smart Code OOD"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ allprojects {

```gradle
dependencies {
implementation 'com.github.Stremio:stremio-core-kotlin:1.0.11-debug'
implementation 'com.github.Stremio:stremio-core-kotlin:1.0.12-debug'
}
```

## Manual

[Download](https://jitpack.io/com/github/stremio/stremio-core-kotlin/1.0.11-debug/stremio-core-kotlin-1.0.11-debug.aar) aar and link
[Download](https://jitpack.io/com/github/stremio/stremio-core-kotlin/1.0.12-debug/stremio-core-kotlin-1.0.12-debug.aar) aar and link
it manually
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ android {
defaultConfig {
minSdkVersion 23
targetSdkVersion 31
versionCode 12
versionName "1.0.11"
versionCode 13
versionName "1.0.12"
}

kotlinOptions {
Expand Down
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
install:
- wget https://github.com/Stremio/stremio-core-kotlin/releases/download/$VERSION/stremio-core-kotlin.aar
- FILE="-Dfile=stremio-core-kotlin.aar"
- mvn install:install-file $FILE -DgroupId=com.stremio.core -DartifactId=stremio-core-kotlin -Dversion=1.0.11 -Dpackaging=aar -DgeneratePom=true
- mvn install:install-file $FILE -DgroupId=com.stremio.core -DartifactId=stremio-core-kotlin -Dversion=1.0.12 -Dpackaging=aar -DgeneratePom=true
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.stremio.core</groupId>
<artifactId>stremio-core-kotlin</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</project>
93 changes: 47 additions & 46 deletions src/main/rust/bridge/resource_loadable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use crate::protobuf::stremio::core::models;

impl ToProtobuf<models::LoadablePage, Ctx> for ResourceLoadable<Vec<MetaItemPreview>> {
fn to_protobuf(&self, ctx: &Ctx) -> models::LoadablePage {
ctx.profile
let title = ctx
.profile
.addons
.iter()
.find(|addon| addon.transport_url == self.request.base)
Expand All @@ -23,22 +24,22 @@ impl ToProtobuf<models::LoadablePage, Ctx> for ResourceLoadable<Vec<MetaItemPrev
.map(|manifest_catalog| (addon, manifest_catalog))
})
.map(|(addon, manifest_catalog)| {
let title = format!(
format!(
"{} - {} {}",
&addon.manifest.name,
&manifest_catalog
.name
.as_ref()
.unwrap_or(&manifest_catalog.id),
&self.request.path.r#type
);
models::LoadablePage {
title,
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(ctx, &self.request)),
}
)
})
.unwrap()
.unwrap_or_default();
models::LoadablePage {
title,
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(ctx, &self.request)),
}
}
}

Expand All @@ -49,24 +50,24 @@ impl ToProtobuf<models::LoadableMetaItem, (&Ctx, Option<&LibraryItem>, Option<&W
&self,
(ctx, library_item, watched): &(&Ctx, Option<&LibraryItem>, Option<&WatchedBitField>),
) -> models::LoadableMetaItem {
ctx.profile
let addon_name = ctx
.profile
.addons
.iter()
.find(|addon| addon.transport_url == self.request.base)
.map(|addon| {
let addon_name = &addon.manifest.name;
models::LoadableMetaItem {
title: addon_name.to_string(),
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(
*library_item,
*watched,
Some(addon_name),
&self.request,
)),
}
})
.unwrap()
.map(|addon| &addon.manifest.name)
.cloned()
.unwrap_or_default();
models::LoadableMetaItem {
title: addon_name.to_string(),
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(
*library_item,
*watched,
Some(&addon_name),
&self.request,
)),
}
}
}

Expand All @@ -77,38 +78,38 @@ impl ToProtobuf<models::LoadableStreams, (&Ctx, Option<&ResourceRequest>)>
&self,
(ctx, meta_request): &(&Ctx, Option<&ResourceRequest>),
) -> models::LoadableStreams {
ctx.profile
let addon_name = ctx
.profile
.addons
.iter()
.find(|addon| addon.transport_url == self.request.base)
.map(|addon| {
let addon_name = &addon.manifest.name;
models::LoadableStreams {
title: addon_name.to_owned(),
request: self.request.to_protobuf(&()),
content: self
.content
.to_protobuf(&(addon_name, &self.request, *meta_request)),
}
})
.unwrap()
.map(|addon| &addon.manifest.name)
.cloned()
.unwrap_or_default();
models::LoadableStreams {
title: addon_name.to_owned(),
request: self.request.to_protobuf(&()),
content: self
.content
.to_protobuf(&(&addon_name, &self.request, *meta_request)),
}
}
}

impl ToProtobuf<models::LoadableSubtitles, Ctx> for ResourceLoadable<Vec<Subtitles>> {
fn to_protobuf(&self, ctx: &Ctx) -> models::LoadableSubtitles {
ctx.profile
let addon_name = ctx
.profile
.addons
.iter()
.find(|addon| addon.transport_url == self.request.base)
.map(|addon| {
let addon_name = &addon.manifest.name;
models::LoadableSubtitles {
title: addon_name.to_owned(),
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(Some(addon_name))),
}
})
.unwrap()
.map(|addon| &addon.manifest.name)
.cloned()
.unwrap_or_default();
models::LoadableSubtitles {
title: addon_name.to_owned(),
request: self.request.to_protobuf(&()),
content: self.content.to_protobuf(&(Some(&addon_name))),
}
}
}

0 comments on commit 394f1ed

Please sign in to comment.