mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 23:12:13 +00:00
adapted to changes in core related to Lib structs renamed to Library
This commit is contained in:
parent
74204374ff
commit
31b2ffd0ff
6 changed files with 16 additions and 16 deletions
|
|
@ -14,11 +14,11 @@ const Board = () => {
|
||||||
<MainNavBars className={styles['board-container']} route={'board'}>
|
<MainNavBars className={styles['board-container']} route={'board'}>
|
||||||
<div className={styles['board-content']}>
|
<div className={styles['board-content']}>
|
||||||
{
|
{
|
||||||
continueWatchingPreview.lib_items.length > 0 ?
|
continueWatchingPreview.library_items.length > 0 ?
|
||||||
<MetaRow
|
<MetaRow
|
||||||
className={classnames(styles['board-row'], styles['continue-watching-row'])}
|
className={classnames(styles['board-row'], styles['continue-watching-row'])}
|
||||||
title={'Continue Watching'}
|
title={'Continue Watching'}
|
||||||
items={continueWatchingPreview.lib_items}
|
items={continueWatchingPreview.library_items}
|
||||||
itemComponent={LibItem}
|
itemComponent={LibItem}
|
||||||
deepLinks={continueWatchingPreview.deepLinks}
|
deepLinks={continueWatchingPreview.deepLinks}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const { useServices } = require('stremio/services');
|
||||||
const { deepLinking, useModelState } = require('stremio/common');
|
const { deepLinking, useModelState } = require('stremio/common');
|
||||||
|
|
||||||
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||||
const lib_items = continue_watching_preview.lib_items.map((libItem) => ({
|
const library_items = continue_watching_preview.library_items.map((libItem) => ({
|
||||||
id: libItem._id,
|
id: libItem._id,
|
||||||
type: libItem.type,
|
type: libItem.type,
|
||||||
name: libItem.name,
|
name: libItem.name,
|
||||||
|
|
@ -18,7 +18,7 @@ const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||||
deepLinks: deepLinking.withLibItem({ libItem })
|
deepLinks: deepLinking.withLibItem({ libItem })
|
||||||
}));
|
}));
|
||||||
const deepLinks = { discover: '#/continuewatching' };
|
const deepLinks = { discover: '#/continuewatching' };
|
||||||
return { lib_items, deepLinks };
|
return { library_items, deepLinks };
|
||||||
};
|
};
|
||||||
|
|
||||||
const useContinueWatchingPreview = () => {
|
const useContinueWatchingPreview = () => {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ const Library = ({ model, route, urlParams, queryParams }) => {
|
||||||
<div className={styles['message-label']}>{route === 'continuewatching' ? 'Continue Watching' : 'Library'} not loaded!</div>
|
<div className={styles['message-label']}>{route === 'continuewatching' ? 'Continue Watching' : 'Library'} not loaded!</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
library.lib_items.length === 0 ?
|
library.library_items.length === 0 ?
|
||||||
<div className={styles['message-container']}>
|
<div className={styles['message-container']}>
|
||||||
<Image
|
<Image
|
||||||
className={styles['image']}
|
className={styles['image']}
|
||||||
|
|
@ -73,7 +73,7 @@ const Library = ({ model, route, urlParams, queryParams }) => {
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div className={styles['meta-items-container']}>
|
<div className={styles['meta-items-container']}>
|
||||||
{library.lib_items.map((libItem, index) => (
|
{library.library_items.map((libItem, index) => (
|
||||||
<LibItem {...libItem} key={index} />
|
<LibItem {...libItem} key={index} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,13 @@ const { CONSTANTS, deepLinking, useModelState, comparatorWithPriorities } = requ
|
||||||
const initLibraryState = () => ({
|
const initLibraryState = () => ({
|
||||||
selected: null,
|
selected: null,
|
||||||
type_names: [],
|
type_names: [],
|
||||||
lib_items: []
|
library_items: []
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapLibraryState = (library) => {
|
const mapLibraryState = (library) => {
|
||||||
const selected = library.selected;
|
const selected = library.selected;
|
||||||
const type_names = library.type_names.sort(comparatorWithPriorities(CONSTANTS.TYPE_PRIORITIES));
|
const type_names = library.type_names.sort(comparatorWithPriorities(CONSTANTS.TYPE_PRIORITIES));
|
||||||
const lib_items = library.lib_items.map((libItem) => ({
|
const library_items = library.library_items.map((libItem) => ({
|
||||||
id: libItem._id,
|
id: libItem._id,
|
||||||
type: libItem.type,
|
type: libItem.type,
|
||||||
name: libItem.name,
|
name: libItem.name,
|
||||||
|
|
@ -24,7 +24,7 @@ const mapLibraryState = (library) => {
|
||||||
null,
|
null,
|
||||||
deepLinks: deepLinking.withLibItem({ libItem })
|
deepLinks: deepLinking.withLibItem({ libItem })
|
||||||
}));
|
}));
|
||||||
return { selected, type_names, lib_items };
|
return { selected, type_names, library_items };
|
||||||
};
|
};
|
||||||
|
|
||||||
const useLibrary = (libraryModel, urlParams, queryParams) => {
|
const useLibrary = (libraryModel, urlParams, queryParams) => {
|
||||||
|
|
|
||||||
|
|
@ -75,12 +75,12 @@ const Player = ({ urlParams }) => {
|
||||||
}, []);
|
}, []);
|
||||||
const onEnded = React.useCallback(() => {
|
const onEnded = React.useCallback(() => {
|
||||||
core.transport.dispatch({ action: 'Unload' }, 'player');
|
core.transport.dispatch({ action: 'Unload' }, 'player');
|
||||||
if (player.lib_item !== null) {
|
if (player.library_item !== null) {
|
||||||
core.transport.dispatch({
|
core.transport.dispatch({
|
||||||
action: 'Ctx',
|
action: 'Ctx',
|
||||||
args: {
|
args: {
|
||||||
action: 'RewindLibraryItem',
|
action: 'RewindLibraryItem',
|
||||||
args: player.lib_item._id
|
args: player.library_item._id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -189,8 +189,8 @@ const Player = ({ urlParams }) => {
|
||||||
commandArgs: {
|
commandArgs: {
|
||||||
stream: player.selected.stream,
|
stream: player.selected.stream,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
time: player.lib_item !== null && player.selected.video_id !== null && player.lib_item.state.video_id === player.selected.video_id ?
|
time: player.library_item !== null && player.selected.video_id !== null && player.library_item.state.video_id === player.selected.video_id ?
|
||||||
player.lib_item.state.timeOffset
|
player.library_item.state.timeOffset
|
||||||
:
|
:
|
||||||
0,
|
0,
|
||||||
transcode: casting,
|
transcode: casting,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const initPlayerState = () => ({
|
||||||
meta_resource: null,
|
meta_resource: null,
|
||||||
subtitles_resources: [],
|
subtitles_resources: [],
|
||||||
next_video: null,
|
next_video: null,
|
||||||
lib_item: null
|
library_item: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapPlayerStateWithCtx = (player, ctx) => {
|
const mapPlayerStateWithCtx = (player, ctx) => {
|
||||||
|
|
@ -74,8 +74,8 @@ const mapPlayerStateWithCtx = (player, ctx) => {
|
||||||
return { request, addon, content };
|
return { request, addon, content };
|
||||||
});
|
});
|
||||||
const next_video = player.next_video;
|
const next_video = player.next_video;
|
||||||
const lib_item = player.lib_item;
|
const library_item = player.library_item;
|
||||||
return { selected, meta_resource, subtitles_resources, next_video, lib_item };
|
return { selected, meta_resource, subtitles_resources, next_video, library_item };
|
||||||
};
|
};
|
||||||
|
|
||||||
const usePlayer = (urlParams) => {
|
const usePlayer = (urlParams) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue