mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 17:15:48 +00:00
send video projection to MarkVideoAsWatched
This commit is contained in:
parent
25c247bec2
commit
0d0a25a1df
3 changed files with 7 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ const { useServices } = require('stremio/services');
|
|||
const StreamPlaceholder = require('./StreamPlaceholder');
|
||||
const styles = require('./styles');
|
||||
|
||||
const Stream = ({ className, videoId, addonName, name, description, thumbnail, progress, deepLinks, ...props }) => {
|
||||
const Stream = ({ className, videoId, videoReleased, addonName, name, description, thumbnail, progress, deepLinks, ...props }) => {
|
||||
const profile = useProfile();
|
||||
const streamingServer = useStreamingServer();
|
||||
const { core } = useServices();
|
||||
|
|
@ -35,11 +35,11 @@ const Stream = ({ className, videoId, addonName, name, description, thumbnail, p
|
|||
action: 'MetaDetails',
|
||||
args: {
|
||||
action: 'MarkVideoAsWatched',
|
||||
args: [videoId, true]
|
||||
args: [{ id: videoId, released: videoReleased }, true]
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [videoId]);
|
||||
}, [videoId, videoReleased]);
|
||||
const onClick = React.useCallback((event) => {
|
||||
if (href === null) {
|
||||
// link does not lead to the player, it is expected to
|
||||
|
|
@ -111,6 +111,7 @@ Stream.Placeholder = StreamPlaceholder;
|
|||
Stream.propTypes = {
|
||||
className: PropTypes.string,
|
||||
videoId: PropTypes.string,
|
||||
videoReleased: PropTypes.instanceOf(Date),
|
||||
addonName: PropTypes.string,
|
||||
name: PropTypes.string,
|
||||
description: PropTypes.string,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ const StreamsList = ({ className, video, ...props }) => {
|
|||
<Stream
|
||||
key={index}
|
||||
videoId={video?.id}
|
||||
videoReleased={video?.released}
|
||||
addonName={stream.addonName}
|
||||
name={stream.name}
|
||||
description={stream.description}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ const Video = ({ className, id, title, thumbnail, episode, released, upcoming, w
|
|||
action: 'MetaDetails',
|
||||
args: {
|
||||
action: 'MarkVideoAsWatched',
|
||||
args: [id, !watched]
|
||||
args: [{ id, released }, !watched]
|
||||
}
|
||||
});
|
||||
}, [id, watched]);
|
||||
}, [id, released, watched]);
|
||||
const href = React.useMemo(() => {
|
||||
return deepLinks ?
|
||||
typeof deepLinks.player === 'string' ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue