From fb77e19da793d51cbf9e2068f524bcba966c5aa2 Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:28:45 +0530 Subject: [PATCH 1/9] Directly return boolean value instead of returning it from ternary operator --- .../components/library/GenresSectionContainer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/experimental/components/library/GenresSectionContainer.tsx b/src/apps/experimental/components/library/GenresSectionContainer.tsx index 74f57782b19..3295be54d01 100644 --- a/src/apps/experimental/components/library/GenresSectionContainer.tsx +++ b/src/apps/experimental/components/library/GenresSectionContainer.tsx @@ -70,8 +70,8 @@ const GenresSectionContainer: FC = ({ centerText: true, cardLayout: false, shape: itemType === BaseItemKind.MusicAlbum ? 'overflowSquare' : 'overflowPortrait', - showParentTitle: itemType === BaseItemKind.MusicAlbum ? true : false, - showYear: itemType === BaseItemKind.MusicAlbum ? false : true + showParentTitle: (itemType === BaseItemKind.MusicAlbum), + showYear: !(itemType === BaseItemKind.MusicAlbum) }} />; }; From 0fe536a7e2c86a13d47dc5948837dba30b6d2552 Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Mon, 2 Oct 2023 23:19:40 +0530 Subject: [PATCH 2/9] Replace !(===) with !== --- .../experimental/components/library/GenresSectionContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/experimental/components/library/GenresSectionContainer.tsx b/src/apps/experimental/components/library/GenresSectionContainer.tsx index 3295be54d01..9945fd51e0f 100644 --- a/src/apps/experimental/components/library/GenresSectionContainer.tsx +++ b/src/apps/experimental/components/library/GenresSectionContainer.tsx @@ -71,7 +71,7 @@ const GenresSectionContainer: FC = ({ cardLayout: false, shape: itemType === BaseItemKind.MusicAlbum ? 'overflowSquare' : 'overflowPortrait', showParentTitle: (itemType === BaseItemKind.MusicAlbum), - showYear: !(itemType === BaseItemKind.MusicAlbum) + showYear: (itemType !== BaseItemKind.MusicAlbum) }} />; }; From a3eebd3a6ee2334207e24ae09578609579c85890 Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:26:18 +0530 Subject: [PATCH 3/9] Update src/apps/experimental/components/library/GenresSectionContainer.tsx Remove parentheses Co-authored-by: Bill Thornton --- .../components/library/GenresSectionContainer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/experimental/components/library/GenresSectionContainer.tsx b/src/apps/experimental/components/library/GenresSectionContainer.tsx index 9945fd51e0f..2ff0a10eb4a 100644 --- a/src/apps/experimental/components/library/GenresSectionContainer.tsx +++ b/src/apps/experimental/components/library/GenresSectionContainer.tsx @@ -70,8 +70,8 @@ const GenresSectionContainer: FC = ({ centerText: true, cardLayout: false, shape: itemType === BaseItemKind.MusicAlbum ? 'overflowSquare' : 'overflowPortrait', - showParentTitle: (itemType === BaseItemKind.MusicAlbum), - showYear: (itemType !== BaseItemKind.MusicAlbum) + showParentTitle: itemType === BaseItemKind.MusicAlbum, + showYear: itemType !== BaseItemKind.MusicAlbum }} />; }; From b8f194ef8c6eda11c233ee37c52aeeb0e818f04a Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:08:16 +0530 Subject: [PATCH 4/9] Update .eslintrc.js : no-unneeded-ternary --- .eslintrc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 4caf5f2b939..8f03aac7e8f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -63,6 +63,8 @@ module.exports = { '@typescript-eslint/no-shadow': ['error'], 'no-throw-literal': ['error'], 'no-trailing-spaces': ['error'], + 'no-unneeded-ternary': ['error'], + '@typescript-eslint/no-unneeded-ternary': ['error'], 'no-unused-expressions': ['off'], '@typescript-eslint/no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }], 'no-unused-private-class-members': ['error'], From 4c9199c7c6ac0e4726774193a35acda0d20c3eab Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:09:15 +0530 Subject: [PATCH 5/9] remove typescript option --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8f03aac7e8f..c22fa464791 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -64,7 +64,6 @@ module.exports = { 'no-throw-literal': ['error'], 'no-trailing-spaces': ['error'], 'no-unneeded-ternary': ['error'], - '@typescript-eslint/no-unneeded-ternary': ['error'], 'no-unused-expressions': ['off'], '@typescript-eslint/no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }], 'no-unused-private-class-members': ['error'], From e6828eeee8e8ba5e95e40b20621a54fe1dc7cdb8 Mon Sep 17 00:00:00 2001 From: Ranbeer Date: Sat, 14 Oct 2023 20:35:55 +0530 Subject: [PATCH 6/9] remove linter errors --- src/components/guide/guide.js | 2 +- src/components/listview/listview.js | 2 +- src/components/playback/playersettingsmenu.js | 2 +- src/controllers/itemDetails/index.js | 4 ++-- src/elements/emby-checkbox/emby-checkbox.js | 2 +- src/elements/emby-scrollbuttons/ScrollButtons.tsx | 4 ++-- src/scripts/browserDeviceProfile.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/guide/guide.js b/src/components/guide/guide.js index 76c54693f99..97c8bff2c18 100644 --- a/src/components/guide/guide.js +++ b/src/components/guide/guide.js @@ -291,7 +291,7 @@ function Guide(options) { showPremiereIndicator: allowIndicators && userSettings.get('guide-indicator-premiere') !== 'false', showNewIndicator: allowIndicators && userSettings.get('guide-indicator-new') !== 'false', showRepeatIndicator: allowIndicators && userSettings.get('guide-indicator-repeat') === 'true', - showEpisodeTitle: layoutManager.tv ? false : true + showEpisodeTitle: !layoutManager.tv }; apiClient.getLiveTvChannels(channelQuery).then(function (channelsResult) { diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index 1a230c31ed5..4c05be198e2 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -177,7 +177,7 @@ export function getListViewHtml(options) { const isLargeStyle = options.imageSize === 'large'; const enableOverview = options.enableOverview; - const clickEntireItem = layoutManager.tv ? true : false; + const clickEntireItem = layoutManager.tv; const outerTagName = clickEntireItem ? 'button' : 'div'; const enableSideMediaInfo = options.enableSideMediaInfo != null ? options.enableSideMediaInfo : true; diff --git a/src/components/playback/playersettingsmenu.js b/src/components/playback/playersettingsmenu.js index e0acde509be..4afaa53a7eb 100644 --- a/src/components/playback/playersettingsmenu.js +++ b/src/components/playback/playersettingsmenu.js @@ -46,7 +46,7 @@ function showQualityMenu(player, btn) { const bitrate = parseInt(id, 10); if (bitrate !== selectedBitrate) { playbackManager.setMaxStreamingBitrate({ - enableAutomaticBitrateDetection: bitrate ? false : true, + enableAutomaticBitrateDetection: !!bitrate, maxBitrate: bitrate }, player); } diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 4efe69e7818..123b3c3092c 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -1374,8 +1374,8 @@ function renderChildren(page, item) { items: result.Items, showIndexNumber: false, enableOverview: true, - enablePlayedButton: layoutManager.mobile ? false : true, - infoButton: layoutManager.mobile ? false : true, + enablePlayedButton: !layoutManager.mobile, + infoButton: !layoutManager.mobile, imageSize: 'large', enableSideMediaInfo: false, highlight: false, diff --git a/src/elements/emby-checkbox/emby-checkbox.js b/src/elements/emby-checkbox/emby-checkbox.js index 2be4237d211..6fed51fe2e3 100644 --- a/src/elements/emby-checkbox/emby-checkbox.js +++ b/src/elements/emby-checkbox/emby-checkbox.js @@ -21,7 +21,7 @@ function onKeyDown(e) { } } -const enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s ? true : false; +const enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s; function forceRefresh(loading) { const elem = this.parentNode; diff --git a/src/elements/emby-scrollbuttons/ScrollButtons.tsx b/src/elements/emby-scrollbuttons/ScrollButtons.tsx index aaeb9bc23e4..a23eb7afce6 100644 --- a/src/elements/emby-scrollbuttons/ScrollButtons.tsx +++ b/src/elements/emby-scrollbuttons/ScrollButtons.tsx @@ -67,7 +67,7 @@ const ScrollButtons: FC = ({ scrollerFactoryRef, scrollState className='emby-scrollbuttons-button btnPrev' onClick={triggerScrollLeft} icon='chevron_left' - disabled={localeScrollPos > 0 ? false : true} + disabled={!localeScrollPos > 0} /> = ({ scrollerFactoryRef, scrollState className='emby-scrollbuttons-button btnNext' onClick={triggerScrollRight} icon='chevron_right' - disabled={scrollState.scrollWidth > 0 && localeScrollPos + scrollState.scrollSize >= scrollState.scrollWidth ? true : false} + disabled={scrollState.scrollWidth > 0 && localeScrollPos + scrollState.scrollSize >= scrollState.scrollWidth} /> ); diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index f6289522f32..afa8c8df760 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -692,7 +692,7 @@ export default function (options) { profile.TranscodingProfiles = []; - const hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls() ? true : false; + const hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls(); if (canPlayHls() && browser.enableHlsAudio !== false) { profile.TranscodingProfiles.push({ From c727871922f941603b16111d4d6abfb7dc632399 Mon Sep 17 00:00:00 2001 From: Ranbeer Date: Sat, 14 Oct 2023 20:44:30 +0530 Subject: [PATCH 7/9] modified: ScrollButtons.tsx --- src/elements/emby-scrollbuttons/ScrollButtons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/emby-scrollbuttons/ScrollButtons.tsx b/src/elements/emby-scrollbuttons/ScrollButtons.tsx index a23eb7afce6..411bee1a923 100644 --- a/src/elements/emby-scrollbuttons/ScrollButtons.tsx +++ b/src/elements/emby-scrollbuttons/ScrollButtons.tsx @@ -67,7 +67,7 @@ const ScrollButtons: FC = ({ scrollerFactoryRef, scrollState className='emby-scrollbuttons-button btnPrev' onClick={triggerScrollLeft} icon='chevron_left' - disabled={!localeScrollPos > 0} + disabled={!(localeScrollPos > 0)} /> Date: Sat, 14 Oct 2023 20:56:28 +0530 Subject: [PATCH 8/9] replace (!!) with (!) Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --- src/components/playback/playersettingsmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/playback/playersettingsmenu.js b/src/components/playback/playersettingsmenu.js index 4afaa53a7eb..9f9f54d56be 100644 --- a/src/components/playback/playersettingsmenu.js +++ b/src/components/playback/playersettingsmenu.js @@ -46,7 +46,7 @@ function showQualityMenu(player, btn) { const bitrate = parseInt(id, 10); if (bitrate !== selectedBitrate) { playbackManager.setMaxStreamingBitrate({ - enableAutomaticBitrateDetection: !!bitrate, + enableAutomaticBitrateDetection: !bitrate, maxBitrate: bitrate }, player); } From 63ffa27c2c56043228b5a9adaa3f3179f5a8c615 Mon Sep 17 00:00:00 2001 From: Freako <65329453+Goku-04@users.noreply.github.com> Date: Sat, 14 Oct 2023 21:12:32 +0530 Subject: [PATCH 9/9] Update ScrollButtons.tsx --- src/elements/emby-scrollbuttons/ScrollButtons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/emby-scrollbuttons/ScrollButtons.tsx b/src/elements/emby-scrollbuttons/ScrollButtons.tsx index 411bee1a923..87aa27d7839 100644 --- a/src/elements/emby-scrollbuttons/ScrollButtons.tsx +++ b/src/elements/emby-scrollbuttons/ScrollButtons.tsx @@ -67,7 +67,7 @@ const ScrollButtons: FC = ({ scrollerFactoryRef, scrollState className='emby-scrollbuttons-button btnPrev' onClick={triggerScrollLeft} icon='chevron_left' - disabled={!(localeScrollPos > 0)} + disabled={localeScrollPos <= 0} />