Skip to content

Commit

Permalink
Merge pull request #4822 from Goku-04/patch-2
Browse files Browse the repository at this point in the history
Return boolean through direct comparison
  • Loading branch information
thornbill authored Oct 18, 2023
2 parents c2ec479 + 84d14c3 commit 61a4964
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = {
'no-throw-literal': ['error'],
'no-trailing-spaces': ['error'],
'no-undef-init': ['error'],
'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'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const GenresSectionContainer: FC<GenresSectionContainerProps> = ({
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
}}
/>;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/guide/guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/listview/listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/components/playback/playersettingsmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/itemDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/elements/emby-checkbox/emby-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/elements/emby-scrollbuttons/ScrollButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ const ScrollButtons: FC<ScrollButtonsProps> = ({ scrollerFactoryRef, scrollState
className='emby-scrollbuttons-button btnPrev'
onClick={triggerScrollLeft}
icon='chevron_left'
disabled={localeScrollPos > 0 ? false : true}
disabled={localeScrollPos <= 0}
/>

<IconButton
type='button'
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}
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/browserDeviceProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 61a4964

Please sign in to comment.