mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +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) => {
|
||||
switch (event.value) {
|
||||
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;
|
||||
}
|
||||
case 'details': {
|
||||
window.location = `#/metadetails/${encodeURIComponent(event.dataset.type)}/${encodeURIComponent(event.dataset.id)}${event.dataset.videoId !== null ? `/${encodeURIComponent(event.dataset.videoId)}` : ''}`;
|
||||
break;
|
||||
}
|
||||
case 'dismiss': {
|
||||
|
|
@ -36,9 +39,9 @@ const Board = () => {
|
|||
}
|
||||
}
|
||||
};
|
||||
return continueWatching.lib_items.map(({ id, ...libItem }) => ({
|
||||
return continueWatching.lib_items.map(({ id, videoId, ...libItem }) => ({
|
||||
...libItem,
|
||||
dataset: { id },
|
||||
dataset: { id, videoId, type: libItem.type },
|
||||
options: CONTINUE_WATCHING_OPTIONS,
|
||||
optionOnSelect: onSelect
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ const mapContinueWatchingState = (continue_watching) => {
|
|||
name: lib_item.name,
|
||||
poster: lib_item.poster,
|
||||
posterShape: lib_item.posterShape,
|
||||
videoId: lib_item.state.video_id,
|
||||
progress: lib_item.state.timeOffset > 0 && lib_item.state.duration > 0 ?
|
||||
lib_item.state.timeOffset / lib_item.state.duration
|
||||
:
|
||||
|
|
|
|||
Loading…
Reference in a new issue