-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: library item progress #461
Conversation
src/types/library/library_item.rs
Outdated
#[inline] | ||
pub fn progress(&self) -> f64 { | ||
if self.state.time_offset > 0 && self.state.duration > 0 { | ||
self.state.time_offset as f64 / self.state.duration as f64 |
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.
Depending on what values we expect here, for large-enough values (like u64::MAX
) we might get into problems when we use as f64
:
Do we have to worry about such large values?
If we do need, then I would suggest using Ratio
:
https://docs.rs/num/latest/num/rational/struct.Ratio.html#impl-ToPrimitive
And then try to make a f64 out of it:
https://docs.rs/num/latest/num/trait.ToPrimitive.html#method.to_f64
…into feat/library-item-stream-id
@tymmesyde Should we use the new stream bucket now? |
Yes, we should. |
…into feat/library-item-stream-id
…into feat/library-item-stream-id
…into feat/library-item-stream-id
…into feat/library-item-stream-id
ac2be00
to
37c59c5
Compare
Add
stream_id
to LibraryItemStateRelated Stremio/stremio-web#383
core-web
changes: feat(serialize_meta_details): return stream and video progress stremio-core-web#51