-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve suggested stream in meta details model #527
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far, I need to run some tests - a suitable test case scenario would be appreciated.
Just to confirm what is expected with this change:
In a nutshell, suggested stream tries to find a StreamItem for the past 30 episodes and if it find one it tries to find the same Base url (or simply put, stream from the same Addon) in the meta_streams
& streams
of the MetaDetails.
Can you briefly share what is the usecase for this suggested stream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, I will make sure to figure out a test-case to test it.
…ails Signed-off-by: Lachezar Lechev <[email protected]>
Signed-off-by: Lachezar Lechev <[email protected]>
Signed-off-by: Lachezar Lechev <[email protected]>
Fix merge conflict with development
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works on web.
When there's an older episode with different stream - it chooses it.
For new and older episodes which are not watched it chooses (given the right binge watching ground and a stream for a full season) the correct suggested stream
This PR adds a new field to meta details model -
suggested_stream
. This field finds a stream from addon responses, which should be highlighted or played if binge watching.The logic is that we find the latest
StreamItem
stored based on last 30 videos from current video (ie. we're in E4, so we're going to check E4, E3, E2, E1 in this order until we hit a storedStreamItem
). Then with the stream item we try to find a stream from addon responses (including the streams inside the meta itselfmeta_streams
) - we find the responses from the addon based onStreamItem.stream_transport_url
, then first we try to find the stream based on equality (as otherwise stored stream might be expired/no longer valid), if not found we try to find a stream based on it'sbingeGroup
.One note, why we cannot return
StreamItem.stream
directly if it's for the same episode, is that user might have played a stream from an addon which he no longer has due to some constrains (ie p2p addon), that's why we have to try to find it first and verify that's it's still available.