mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 23:12:13 +00:00
redirects from ContinueWatching implemented
This commit is contained in:
parent
88b6641edc
commit
02ee397d95
2 changed files with 6 additions and 2 deletions
|
|
@ -19,9 +19,12 @@ const Board = () => {
|
||||||
const onSelect = (event) => {
|
const onSelect = (event) => {
|
||||||
switch (event.value) {
|
switch (event.value) {
|
||||||
case 'play': {
|
case 'play': {
|
||||||
|
// TODO check streams storage
|
||||||
|
window.location = `#/metadetails/${encodeURIComponent(event.dataset.type)}/${encodeURIComponent(event.dataset.id)}${event.dataset.videoId !== null ? `/${encodeURIComponent(event.dataset.videoId)}` : ''}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'details': {
|
case 'details': {
|
||||||
|
window.location = `#/metadetails/${encodeURIComponent(event.dataset.type)}/${encodeURIComponent(event.dataset.id)}${event.dataset.videoId !== null ? `/${encodeURIComponent(event.dataset.videoId)}` : ''}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'dismiss': {
|
case 'dismiss': {
|
||||||
|
|
@ -36,9 +39,9 @@ const Board = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return continueWatching.lib_items.map(({ id, ...libItem }) => ({
|
return continueWatching.lib_items.map(({ id, videoId, ...libItem }) => ({
|
||||||
...libItem,
|
...libItem,
|
||||||
dataset: { id },
|
dataset: { id, videoId, type: libItem.type },
|
||||||
options: CONTINUE_WATCHING_OPTIONS,
|
options: CONTINUE_WATCHING_OPTIONS,
|
||||||
optionOnSelect: onSelect
|
optionOnSelect: onSelect
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ const mapContinueWatchingState = (continue_watching) => {
|
||||||
name: lib_item.name,
|
name: lib_item.name,
|
||||||
poster: lib_item.poster,
|
poster: lib_item.poster,
|
||||||
posterShape: lib_item.posterShape,
|
posterShape: lib_item.posterShape,
|
||||||
|
videoId: lib_item.state.video_id,
|
||||||
progress: lib_item.state.timeOffset > 0 && lib_item.state.duration > 0 ?
|
progress: lib_item.state.timeOffset > 0 && lib_item.state.duration > 0 ?
|
||||||
lib_item.state.timeOffset / lib_item.state.duration
|
lib_item.state.timeOffset / lib_item.state.duration
|
||||||
:
|
:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue