1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #4403 from thornbill/eslint-radix

Add eslint radix rule for parseInt
This commit is contained in:
Bill Thornton 2023-03-10 15:22:32 -05:00 committed by GitHub
commit 3a784ad928
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 90 additions and 101 deletions

View file

@ -114,8 +114,8 @@ import shell from '../../scripts/shell';
const itemId = item.Id;
// Convert to ms
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0);
const currentTime = parseInt(playState.PositionTicks ? (playState.PositionTicks / 10000) : 0);
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0, 10);
const currentTime = parseInt(playState.PositionTicks ? (playState.PositionTicks / 10000) : 0, 10);
const isPaused = playState.IsPaused || false;
const canSeek = playState.CanSeek || false;
@ -247,7 +247,7 @@ import shell from '../../scripts/shell';
navigator.mediaSession.setActionHandler('seekto', function (object) {
const item = playbackManager.getPlayerState(currentPlayer).NowPlayingItem;
// Convert to ms
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0);
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0, 10);
const wantedTime = object.seekTime * 1000;
playbackManager.seekPercent(wantedTime / duration * 100, currentPlayer);
});

View file

@ -1690,7 +1690,7 @@ class PlaybackManager {
function changeStream(player, ticks, params) {
if (canPlayerSeek(player) && params == null) {
player.currentTime(parseInt(ticks / 10000));
player.currentTime(parseInt(ticks / 10000, 10));
return;
}
@ -1714,7 +1714,7 @@ class PlaybackManager {
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
if (ticks) {
ticks = parseInt(ticks);
ticks = parseInt(ticks, 10);
}
const maxBitrate = params.MaxStreamingBitrate || self.getMaxStreamingBitrate(player);
@ -3646,7 +3646,7 @@ class PlaybackManager {
percent /= 100;
ticks *= percent;
this.seek(parseInt(ticks), player);
this.seek(parseInt(ticks, 10), player);
}
seekMs(ms, player = this._currentPlayer) {
@ -4033,13 +4033,13 @@ class PlaybackManager {
this.setBrightness(cmd.Arguments.Brightness, player);
break;
case 'SetAudioStreamIndex':
this.setAudioStreamIndex(parseInt(cmd.Arguments.Index), player);
this.setAudioStreamIndex(parseInt(cmd.Arguments.Index, 10), player);
break;
case 'SetSubtitleStreamIndex':
this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index), player);
this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index, 10), player);
break;
case 'SetMaxStreamingBitrate':
this.setMaxStreamingBitrate(parseInt(cmd.Arguments.Bitrate), player);
this.setMaxStreamingBitrate(parseInt(cmd.Arguments.Bitrate, 10), player);
break;
case 'ToggleFullscreen':
this.toggleFullscreen(player);

View file

@ -43,7 +43,7 @@ function showQualityMenu(player, btn) {
items: menuItems,
positionTo: btn
}).then(function (id) {
const bitrate = parseInt(id);
const bitrate = parseInt(id, 10);
if (bitrate !== selectedBitrate) {
playbackManager.setMaxStreamingBitrate({
enableAutomaticBitrateDetection: bitrate ? false : true,

View file

@ -1,5 +1,3 @@
/*eslint prefer-const: "error"*/
let currentId = 0;
function addUniquePlaylistItemId(item) {
if (!item.PlaylistItemId) {