Skip to content

Commit

Permalink
Merge pull request #610 from Stremio/feat/player-support-stream-urls
Browse files Browse the repository at this point in the history
feat: Player support of stream urls
  • Loading branch information
elpiel authored Jun 12, 2024
2 parents 0dc25a6 + 503843a commit 7005dbe
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/models/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,12 +1093,17 @@ fn seek_update<E: Env + 'static>(
library_item,
) {
(true, Some(selected), Some(video_params), Some(series_info), Some(library_item)) => {
match (
// live streams will not have opensubtitle hash so just relying on URL and Torrent is enough.
let stream_source_supported = matches!(
&selected.stream.source,
StreamSource::Url { .. } | StreamSource::Torrent { .. }
);
match (
stream_source_supported,
selected.stream.name.as_ref(),
video_params.hash.clone(),
) {
(StreamSource::Torrent { .. }, Some(stream_name), Some(opensubtitles_hash)) => {
(true, Some(stream_name), Some(opensubtitles_hash)) => {
let stream_name_hash = {
use sha2::Digest;
let mut sha256 = sha2::Sha256::new();
Expand Down Expand Up @@ -1268,12 +1273,17 @@ fn skip_gaps_update<E: Env + 'static>(
Some(series_info),
Some(library_item),
) => {
match (
let stream_source_supported = matches!(
&selected.stream.source,
StreamSource::Url { .. } | StreamSource::Torrent { .. }
);
// live streams will not have opensubtitle hash so just relying on URL and Torrent is enough.
match (
stream_source_supported,
selected.stream.name.as_ref(),
video_params.hash.clone(),
) {
(StreamSource::Torrent { .. }, Some(stream_name), Some(opensubtitles_hash)) => {
(true, Some(stream_name), Some(opensubtitles_hash)) => {
let stream_name_hash = {
use sha2::Digest;
let mut sha256 = sha2::Sha256::new();
Expand Down

0 comments on commit 7005dbe

Please sign in to comment.