send video projection to MarkVideoAsWatched

This commit is contained in:
unclekingpin 2023-08-18 13:36:14 -07:00
parent 25c247bec2
commit 0d0a25a1df
3 changed files with 7 additions and 5 deletions

View file

@ -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,

View file

@ -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}

View file

@ -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' ?