Skip to content

Commit

Permalink
Merge pull request #46 from Stremio/chore/update-core
Browse files Browse the repository at this point in the history
Update core
  • Loading branch information
TheBeastLT committed Apr 4, 2024
2 parents 39d5108 + 67e006e commit 1a8ac85
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

37 changes: 37 additions & 0 deletions src/commonMain/rust/bridge/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl FromProtobuf<StreamSource> for types::stream::Source {
.expect("Stream.info_hash parse failed"),
file_idx: source.file_idx.map(|idx| idx as u16),
announce: source.announce.clone(),
file_must_include: source.file_must_include.to_owned(),
},
types::stream::Source::External(source) => StreamSource::External {
external_url: source.external_url.from_protobuf(),
Expand All @@ -33,6 +34,16 @@ impl FromProtobuf<StreamSource> for types::stream::Source {
types::stream::Source::PlayerFrame(source) => StreamSource::PlayerFrame {
player_frame_url: source.player_frame_url.from_protobuf(),
},
types::stream::Source::Rar(source) => StreamSource::Rar {
rar_urls: source.rar_urls.from_protobuf(),
file_idx: source.file_idx.map(|idx| idx as u16),
file_must_include: source.file_must_include.to_owned(),
},
types::stream::Source::Zip(source) => StreamSource::Zip {
zip_urls: source.zip_urls.from_protobuf(),
file_idx: source.file_idx.map(|idx| idx as u16),
file_must_include: source.file_must_include.to_owned(),
},
}
}
}
Expand All @@ -59,6 +70,9 @@ impl FromProtobuf<Stream> for types::Stream {
binge_group: self.behavior_hints.binge_group.to_owned(),
country_whitelist: Some(self.behavior_hints.country_whitelist.to_owned()),
proxy_headers: self.behavior_hints.proxy_headers.from_protobuf(),
filename: self.behavior_hints.filename.to_owned(),
video_hash: self.behavior_hints.video_hash.to_owned(),
video_size: self.behavior_hints.video_size,
other: Default::default(),
},
}
Expand All @@ -80,10 +94,12 @@ impl ToProtobuf<types::stream::Source, ()> for StreamSource {
info_hash,
file_idx,
announce,
file_must_include,
} => types::stream::Source::Torrent(types::stream::Torrent {
info_hash: hex::encode(info_hash),
file_idx: file_idx.map(|idx| idx as i32),
announce: announce.clone(),
file_must_include: file_must_include.to_owned(),
}),
StreamSource::External {
external_url,
Expand All @@ -98,6 +114,24 @@ impl ToProtobuf<types::stream::Source, ()> for StreamSource {
player_frame_url: player_frame_url.to_string(),
})
}
StreamSource::Rar {
rar_urls,
file_idx,
file_must_include,
} => types::stream::Source::Rar(types::stream::Rar {
rar_urls: rar_urls.to_protobuf(&()),
file_idx: file_idx.map(|idx| idx as i32),
file_must_include: file_must_include.to_owned(),
}),
StreamSource::Zip {
zip_urls,
file_idx,
file_must_include,
} => types::stream::Source::Zip(types::stream::Zip {
zip_urls: zip_urls.to_protobuf(&()),
file_idx: file_idx.map(|idx| idx as i32),
file_must_include: file_must_include.to_owned(),
}),
}
}
}
Expand Down Expand Up @@ -165,6 +199,9 @@ impl
.to_owned()
.unwrap_or_default(),
proxy_headers: self.behavior_hints.proxy_headers.to_protobuf(&()),
filename: self.behavior_hints.filename.to_owned(),
video_hash: self.behavior_hints.video_hash.to_owned(),
video_size: self.behavior_hints.video_size,
},
deep_links: types::StreamDeepLinks {
player: deep_links.player,
Expand Down
2 changes: 2 additions & 0 deletions src/commonMain/rust/model/fields/streaming_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ impl FromProtobuf<Settings> for models::streaming_server::Settings {
cache_root: self.cache_root.to_owned(),
server_version: self.server_version.to_owned(),
remote_https: self.remote_https.clone(),
transcode_profile: self.transcode_profile.to_owned(),
cache_size: self.cache_size.to_owned(),
bt_max_connections: self.bt_max_connections,
bt_handshake_timeout: self.bt_handshake_timeout,
Expand Down Expand Up @@ -83,6 +84,7 @@ impl ToProtobuf<models::streaming_server::Settings, ()> for Settings {
cache_root: self.cache_root.to_string(),
server_version: self.server_version.to_string(),
remote_https: self.remote_https.clone(),
transcode_profile: self.transcode_profile.to_owned(),
cache_size: self.cache_size,
bt_max_connections: self.bt_max_connections,
bt_handshake_timeout: self.bt_handshake_timeout,
Expand Down
15 changes: 8 additions & 7 deletions src/main/proto/stremio/core/models/streaming_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ message StreamingServer {
required string cache_root = 2;
required string server_version = 3;
optional string remote_https = 4;
optional double cache_size = 5;
required uint64 bt_max_connections = 6;
required uint64 bt_handshake_timeout = 7;
required uint64 bt_request_timeout = 8;
required double bt_download_speed_soft_limit = 9;
required double bt_download_speed_hard_limit = 10;
required uint64 bt_min_peers_for_stable = 11;
optional string transcode_profile = 5;
optional double cache_size = 6;
required uint64 bt_max_connections = 7;
required uint64 bt_handshake_timeout = 8;
required uint64 bt_request_timeout = 9;
required double bt_download_speed_soft_limit = 10;
required double bt_download_speed_hard_limit = 11;
required uint64 bt_min_peers_for_stable = 12;
}
message Statistics {
required string name = 1;
Expand Down
30 changes: 24 additions & 6 deletions src/main/proto/stremio/core/types/stream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ message Stream {
Torrent torrent = 3;
External external = 4;
PlayerFrame player_frame = 5;
Rar rar = 6;
Zip zip = 7;
}
optional string name = 6;
optional string description = 7;
optional string thumbnail = 8;
repeated Subtitle subtitles = 9;
required StreamBehaviorHints behavior_hints = 10;
required StreamDeepLinks deep_links = 11;
optional string name = 8;
optional string description = 9;
optional string thumbnail = 10;
repeated Subtitle subtitles = 11;
required StreamBehaviorHints behavior_hints = 12;
required StreamDeepLinks deep_links = 13;

message Url {
required string url = 1;
Expand All @@ -33,6 +35,7 @@ message Stream {
required string info_hash = 1;
optional int32 file_idx = 2;
repeated string announce = 3;
repeated string file_must_include = 4;
}

message External {
Expand All @@ -43,13 +46,28 @@ message Stream {
message PlayerFrame {
required string player_frame_url = 1;
}

message Rar {
repeated string rar_urls = 1;
optional int32 file_idx = 2;
repeated string file_must_include = 3;
}

message Zip {
repeated string zip_urls = 1;
optional int32 file_idx = 2;
repeated string file_must_include = 3;
}
}

message StreamBehaviorHints {
required bool not_web_ready = 1;
optional string binge_group = 2;
repeated string country_whitelist = 3;
optional StreamProxyHeaders proxy_headers = 4;
optional string filename = 5;
optional string video_hash = 6;
optional uint64 video_size = 7;
}

message StreamProxyHeaders {
Expand Down

0 comments on commit 1a8ac85

Please sign in to comment.