Skip to content

Commit

Permalink
feat(project): remove enable_text setting
Browse files Browse the repository at this point in the history
- titles are shown by default for ordinary playlists
  • Loading branch information
AntonLantukh committed Feb 9, 2023
1 parent 1b87834 commit 345a118
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 23 deletions.
8 changes: 0 additions & 8 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Use the `content` array to define which and how content playlists should be disp
}, {
"type": "favorites",
"title": "Best videos",
"enableText": false
}, {
"contentId": "WXu7kuaW"
"type": "playlist"
Expand All @@ -130,18 +129,11 @@ If you want to include `favorites` / `continue_watching` shelf, you should also
```
{
"type": "continue_watching",
"enableText": false
}
```

---

**content[].enableText** (optional)

Controls whether or not title and description text overlays appear on the poster images. It is "true" by default. If your poster images contain a lot of text, we recommend setting this to "false."

---

**content[].title** (optional)

You can change the playlist title and choose a custom one. It is also possible to do for `continue_watching` and `favorites` types.
Expand Down
2 changes: 0 additions & 2 deletions docs/features/shelves-and-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ Shelves and libraries can be defined in the [app config](/docs/configuration.md)
{
"content": [
{
"enableText": true,
"featured": true,
"playlistId": "JSKF03bk"
},
{
"enableText": true,
"playlistId": "dGSUzs9o"
}
],
Expand Down
3 changes: 1 addition & 2 deletions src/components/Shelf/Shelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const Shelf = ({
onCardHover,
title,
watchHistory,
enableTitle = true,
featured = false,
loading = false,
error = null,
Expand Down Expand Up @@ -140,7 +139,7 @@ const Shelf = ({

return (
<div className={classNames(styles.shelf, { [styles.featured]: featured })}>
{!featured && enableTitle ? <h2 className={classNames(styles.title, { [styles.loading]: loading })}>{title || playlist.title}</h2> : null}
{!featured ? <h2 className={classNames(styles.title, { [styles.loading]: loading })}>{title || playlist.title}</h2> : null}
<TileDock<PlaylistItem>
items={playlist.playlist}
tilesToShow={tilesToShow}
Expand Down
1 change: 0 additions & 1 deletion src/containers/ShelfList/ShelfList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const ShelfList = ({ rows }: Props) => {
playlist={playlist}
watchHistory={row.type === PersonalShelf.ContinueWatching ? watchHistoryDictionary : undefined}
onCardClick={onCardClick}
enableTitle={row.enableText}
title={title}
featured={row.featured === true}
accessModel={accessModel}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ScreenRouting/mediaScreens/MediaHub/MediaHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { PlaylistItem } from '#types/playlist';
const parsePlaylistIds = (input: unknown): Content[] => {
const playlistIds = typeof input === 'string' ? input.replace(/\s+/g, '').split(',') : [];

return playlistIds.map((id) => ({ type: 'playlist', contentId: id, enableText: true }));
return playlistIds.map((id) => ({ type: 'playlist', contentId: id }));
};

const MediaHub: ScreenComponent<PlaylistItem> = ({ data }) => {
Expand Down
3 changes: 1 addition & 2 deletions src/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const contentSchema: SchemaOf<Content> = object({
contentId: string().notRequired(),
title: string().notRequired(),
featured: boolean().notRequired(),
enableText: boolean().notRequired(),
backgroundColor: string().nullable().notRequired(),
type: mixed().oneOf(['playlist', 'continue_watching', 'favorites']),
}).defined();
Expand Down Expand Up @@ -104,7 +103,7 @@ const loadConfig = async (configLocation: string) => {

const enrichConfig = (config: Config): Config => {
const { content, siteName } = config;
const updatedContent = content.map((content) => Object.assign({ enableText: true, featured: false }, content));
const updatedContent = content.map((content) => Object.assign({ featured: false }, content));

// TODO: Remove this once the inplayer integration structure is added to the dashboard
if (!config.integrations.inplayer?.clientId && config.custom?.['inplayer.clientId']) {
Expand Down
6 changes: 0 additions & 6 deletions test/fixtures/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,25 @@
},
"content": [
{
"enableText": true,
"featured": true,
"type": "playlist",
"contentId": "JSKF03bk"
},
{
"enableText": true,
"type": "favorites"
},
{
"enableText": true,
"type": "continue_watching"
},
{
"enableText": true,
"type": "playlist",
"contentId": "dGSUzs9o"
},
{
"enableText": true,
"type": "playlist",
"contentId": "xQaFzykq"
},
{
"enableText": true,
"type": "playlist",
"contentId": "fWpLtzVh"
}
Expand Down
1 change: 0 additions & 1 deletion types/Config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export type Content = {
title?: string;
type: ContentType;
featured?: boolean;
enableText?: boolean;
backgroundColor?: string | null;
};

Expand Down

0 comments on commit 345a118

Please sign in to comment.