Skip to content

Commit

Permalink
fix(StreamsList): show EpisodePicker only if type is series
Browse files Browse the repository at this point in the history
  • Loading branch information
Botsy committed Feb 12, 2025
1 parent 07cc2a9 commit 675328c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/routes/MetaDetails/MetaDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ const MetaDetails = ({ urlParams, queryParams }) => {
className={styles['streams-list']}
streams={metaDetails.streams}
video={video}
type={streamPath.type}
onEpisodeSearch={handleEpisodeSearch}
/>
:
Expand Down
15 changes: 12 additions & 3 deletions src/routes/MetaDetails/StreamsList/StreamsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { default: SeasonEpisodePicker } = require('./EpisodePicker');

const ALL_ADDONS_KEY = 'ALL';

const StreamsList = ({ className, video, onEpisodeSearch, ...props }) => {
const StreamsList = ({ className, video, type, onEpisodeSearch, ...props }) => {
const { t } = useTranslation();
const { core } = useServices();
const platform = usePlatform();
Expand Down Expand Up @@ -128,14 +128,22 @@ const StreamsList = ({ className, video, onEpisodeSearch, ...props }) => {
{
props.streams.length === 0 ?
<div className={styles['message-container']}>
<SeasonEpisodePicker className={styles['search']} onSubmit={handleEpisodePicker} />
{
type === 'series' ?
<SeasonEpisodePicker className={styles['search']} onSubmit={handleEpisodePicker} />
: null
}
<Image className={styles['image']} src={require('/images/empty.png')} alt={' '} />
<div className={styles['label']}>No addons were requested for streams!</div>
</div>
:
props.streams.every((streams) => streams.content.type === 'Err') ?
<div className={styles['message-container']}>
<SeasonEpisodePicker className={styles['search']} onSubmit={handleEpisodePicker} />
{
type === 'series' ?
<SeasonEpisodePicker className={styles['search']} onSubmit={handleEpisodePicker} />
: null
}
{
video?.upcoming ?
<div className={styles['label']}>{t('UPCOMING')}...</div>
Expand Down Expand Up @@ -207,6 +215,7 @@ StreamsList.propTypes = {
className: PropTypes.string,
streams: PropTypes.arrayOf(PropTypes.object).isRequired,
video: PropTypes.object,
type: PropTypes.string,
onEpisodeSearch: PropTypes.func
};

Expand Down

0 comments on commit 675328c

Please sign in to comment.