implement thubnail loading from tmdb

fix lots of errors if ' char occurs in path strings
correct reverse proxy for websocket
This commit is contained in:
2021-04-23 21:23:51 +02:00
parent f72a3e5fb4
commit d952538f0a
9 changed files with 142 additions and 21 deletions

View File

@ -42,6 +42,7 @@ class EpisodePage extends React.Component<Props, State> {
<DynamicContentContainer
renderElement={(el): JSX.Element => <EpisodeTile key={el.ID} episode={el} />}
data={this.episodes}
initialLoadNr={-1}
/>
</>
);

View File

@ -1,6 +1,6 @@
import React from 'react';
import Preview from '../../elements/Preview/Preview';
import {APINode, callAPI} from '../../utils/Api';
import {APINode, callAPI, callAPIPlain} from '../../utils/Api';
import {TVShow} from '../../types/ApiTypes';
import DynamicContentContainer from '../../elements/DynamicContentContainer/DynamicContentContainer';
import {Route, Switch, useRouteMatch} from 'react-router-dom';
@ -33,11 +33,21 @@ class TVShowPage extends React.Component<Props, State> {
<Preview
key={elem.Id}
name={elem.Name}
picLoader={(callback): void => callback('')}
picLoader={(callback: (pic: string) => void): void => {
callAPIPlain(
APINode.TVShow,
{
action: 'readThumbnail',
Id: elem.Id
},
(result) => callback(result)
);
}}
linkPath={'/tvshows/' + elem.Id}
/>
)}
data={this.state.loading ? [] : this.data}
initialLoadNr={20}
/>
);
}