Skip to content

Commit

Permalink
Merge branch 'master' into feat/player-seek-action
Browse files Browse the repository at this point in the history
  • Loading branch information
elpiel committed Dec 6, 2024
2 parents 01087e7 + 4045df3 commit 18893d7
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 6 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.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ hex = "0.4"
# Futures
futures = "0.3"

tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3" }

[profile.release]
lto = true
opt-level = 3
2 changes: 1 addition & 1 deletion stremio-core-kotlin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stremio-core-kotlin"
version = "1.4.1"
version = "1.4.2"
authors = ["Smart Code OOD"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion stremio-core-kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ allprojects {

```gradle
dependencies {
implementation 'com.github.Stremio:stremio-core-kotlin:1.4.1'
implementation 'com.github.Stremio:stremio-core-kotlin:1.4.2'
}
```
2 changes: 1 addition & 1 deletion stremio-core-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.google.protobuf.gradle.*

group = "com.github.Stremio"
version = "1.4.1"
version = "1.4.2"

allprojects {
repositories {
Expand Down
7 changes: 7 additions & 0 deletions stremio-core-protobuf/proto/stremio/core/types/profile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ message User{
required google.protobuf.Timestamp date_registered = 6;
required google.protobuf.Timestamp last_modified = 7;
optional google.protobuf.Timestamp premium_expire = 8;
optional TraktInfo trakt = 9;
}

message GDPRConsent {
required bool tos = 1;
required bool privacy = 2;
required bool marketing = 3;
optional string from = 4;
}

message TraktInfo {
required google.protobuf.Timestamp created_at = 1;
required google.protobuf.Timestamp expires_in = 2;
required string access_token = 3;
}
11 changes: 10 additions & 1 deletion stremio-core-protobuf/src/bridge/date.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{DateTime, TimeZone, Utc};
use chrono::{DateTime, TimeDelta, TimeZone, Utc};

use crate::bridge::{FromProtobuf, ToProtobuf};
use crate::protobuf::google::protobuf::Timestamp;
Expand All @@ -17,3 +17,12 @@ impl ToProtobuf<Timestamp, ()> for DateTime<Utc> {
}
}
}

impl ToProtobuf<Timestamp, ()> for TimeDelta {
fn to_protobuf<E: stremio_core::runtime::Env + 'static>(&self, _args: &()) -> Timestamp {
Timestamp {
seconds: self.num_seconds(),
nanos: self.num_nanoseconds().map_or(0, |nanos| nanos as i32),
}
}
}
13 changes: 12 additions & 1 deletion stremio-core-protobuf/src/bridge/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::convert::TryFrom;

use stremio_core::types::api::{LinkAuthKey, LinkCodeResponse};
use stremio_core::types::profile::{
Auth, FrameRateMatchingStrategy, GDPRConsent, Profile, Settings, User,
Auth, FrameRateMatchingStrategy, GDPRConsent, Profile, Settings, TraktInfo, User,
};

use crate::bridge::{FromProtobuf, ToProtobuf};
Expand Down Expand Up @@ -140,6 +140,16 @@ impl ToProtobuf<types::GdprConsent, ()> for GDPRConsent {
}
}

impl ToProtobuf<types::TraktInfo, ()> for TraktInfo {
fn to_protobuf<E: stremio_core::runtime::Env + 'static>(&self, _args: &()) -> types::TraktInfo {
types::TraktInfo {
created_at: self.created_at.to_protobuf::<E>(&()),
expires_in: self.expires_in.to_protobuf::<E>(&()),
access_token: self.access_token.clone(),
}
}
}

impl ToProtobuf<types::User, ()> for User {
fn to_protobuf<E: stremio_core::runtime::Env + 'static>(&self, _args: &()) -> types::User {
types::User {
Expand All @@ -151,6 +161,7 @@ impl ToProtobuf<types::User, ()> for User {
date_registered: self.date_registered.to_protobuf::<E>(&()),
last_modified: self.last_modified.to_protobuf::<E>(&()),
premium_expire: self.premium_expire.to_protobuf::<E>(&()),
trakt: self.trakt.to_protobuf::<E>(&()),
}
}
}
Expand Down

0 comments on commit 18893d7

Please sign in to comment.