add tvshow syntax to db
basic tvshow api request to show available tvshows limit randompage videos to 3 improve settings object to remove one useless copy
This commit is contained in:
@ -23,6 +23,8 @@ interface GetRandomMoviesType {
|
||||
* Randompage shuffles random viedeopreviews and provides a shuffle btn
|
||||
*/
|
||||
class RandomPage extends React.Component<{}, state> {
|
||||
readonly LoadNR = 3;
|
||||
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
|
||||
@ -37,7 +39,7 @@ class RandomPage extends React.Component<{}, state> {
|
||||
componentDidMount(): void {
|
||||
addKeyHandler(this.keypress);
|
||||
|
||||
this.loadShuffledvideos(4);
|
||||
this.loadShuffledvideos(this.LoadNR);
|
||||
}
|
||||
|
||||
componentWillUnmount(): void {
|
||||
@ -75,7 +77,7 @@ class RandomPage extends React.Component<{}, state> {
|
||||
* click handler for shuffle btn
|
||||
*/
|
||||
shuffleclick(): void {
|
||||
this.loadShuffledvideos(4);
|
||||
this.loadShuffledvideos(this.LoadNR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,11 +1,38 @@
|
||||
import React from 'react';
|
||||
import Preview from '../../elements/Preview/Preview';
|
||||
import {APINode, callAPI} from '../../utils/Api';
|
||||
import {TVShow} from '../../types/ApiTypes';
|
||||
import DynamicContentContainer from '../../elements/DynamicContentContainer/DynamicContentContainer';
|
||||
|
||||
interface State {
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
interface Props {}
|
||||
|
||||
class TVShowPage extends React.Component<Props, State> {
|
||||
state = {
|
||||
loading: true
|
||||
};
|
||||
|
||||
data: TVShow.TVshowType[] = [];
|
||||
|
||||
componentDidMount(): void {
|
||||
callAPI(APINode.TVShow, {action: 'getTVShows'}, (resp: TVShow.TVshowType[]) => {
|
||||
this.data = resp;
|
||||
this.setState({loading: false});
|
||||
});
|
||||
}
|
||||
|
||||
class TVShowPage extends React.Component {
|
||||
render(): JSX.Element {
|
||||
return (
|
||||
<>
|
||||
<Preview name='myTestItem' picLoader={(callback): void => callback('')} />
|
||||
<DynamicContentContainer
|
||||
renderElement={(elem): JSX.Element => (
|
||||
<Preview name={elem.Name} picLoader={(callback): void => callback('')} linkPath={'/tvshows/' + elem.Id} />
|
||||
)}
|
||||
data={this.state.loading ? [] : this.data}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user