Skip to content

Commit 5ab324f

Browse files
resolve upstream conflicts
1 parent 0b16f1c commit 5ab324f

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

src/components/ContinueWatchingItem/ContinueWatchingItem.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,11 @@ const PropTypes = require('prop-types');
55
const { useServices } = require('stremio/services');
66
const LibItem = require('stremio/components/LibItem');
77

8-
const ContinueWatchingItem = ({ _id, notifications, deepLinks, ...props }) => {
8+
const ContinueWatchingItem = ({ _id, notifications, ...props }) => {
99
const { core } = useServices();
1010

11-
const onClick = React.useCallback(() => {
12-
if (deepLinks?.metaDetailsVideos ?? deepLinks?.metaDetailsStreams) {
13-
window.location = deepLinks?.metaDetailsVideos ?? deepLinks?.metaDetailsStreams;
14-
}
15-
}, [deepLinks]);
16-
17-
const onPlayClick = React.useCallback((event) => {
18-
event.stopPropagation();
19-
if (deepLinks?.player ?? deepLinks?.metaDetailsStreams ?? deepLinks?.metaDetailsVideos) {
20-
window.location = deepLinks?.player ?? deepLinks?.metaDetailsStreams ?? deepLinks?.metaDetailsVideos;
21-
}
22-
}, [deepLinks]);
23-
2411
const onDismissClick = React.useCallback((event) => {
25-
event.stopPropagation();
12+
event.preventDefault();
2613
if (typeof _id === 'string') {
2714
core.transport.dispatch({
2815
action: 'Ctx',
@@ -47,8 +34,6 @@ const ContinueWatchingItem = ({ _id, notifications, deepLinks, ...props }) => {
4734
_id={_id}
4835
posterChangeCursor={true}
4936
notifications={notifications}
50-
onClick={onClick}
51-
onPlayClick={onPlayClick}
5237
onDismissClick={onDismissClick}
5338
/>
5439
);

src/components/LibItem/LibItem.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const LibItem = ({ _id, removable, notifications, watched, ...props }) => {
2929
case 'details':
3030
return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string');
3131
case 'watched':
32-
return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string');
32+
return typeof watched !== 'undefined' && props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string');
3333
case 'dismiss':
3434
return typeof _id === 'string' && props.progress !== null && !isNaN(props.progress) && props.progress > 0;
3535
case 'remove':
@@ -119,13 +119,21 @@ const LibItem = ({ _id, removable, notifications, watched, ...props }) => {
119119
}
120120
}, [_id, props.deepLinks, props.optionOnSelect]);
121121

122+
const onPlayClick = React.useCallback((event) => {
123+
if (props.deepLinks && typeof props.deepLinks.player === 'string') {
124+
event.preventDefault();
125+
window.location = props.deepLinks.player;
126+
}
127+
}, [props.deepLinks]);
128+
122129
return (
123130
<MetaItem
124131
{...props}
125132
watched={watched}
126133
newVideos={newVideos}
127134
options={options}
128135
optionOnSelect={optionOnSelect}
136+
onPlayClick={props.deepLinks && typeof props.deepLinks.player === 'string' ? onPlayClick : null}
129137
/>
130138
);
131139
};

src/components/MetaItem/MetaItem.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const MetaItem = React.memo(({ className, type, name, poster, posterShape, poste
1818
const [menuOpen, onMenuOpen, onMenuClose] = useBinaryState(false);
1919
const href = React.useMemo(() => {
2020
return deepLinks ?
21-
typeof deepLinks.player === 'string' ?
22-
deepLinks.player
21+
typeof deepLinks.metaDetailsStreams === 'string' ?
22+
deepLinks.metaDetailsStreams
2323
:
24-
typeof deepLinks.metaDetailsStreams === 'string' ?
25-
deepLinks.metaDetailsStreams
24+
typeof deepLinks.metaDetailsVideos === 'string' ?
25+
deepLinks.metaDetailsVideos
2626
:
27-
typeof deepLinks.metaDetailsVideos === 'string' ?
28-
deepLinks.metaDetailsVideos
27+
typeof deepLinks.player === 'string' ?
28+
deepLinks.player
2929
:
3030
null
3131
:

0 commit comments

Comments
 (0)