From 1e3f4ed3983f3b101a259f8164511665f25f878e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9ry=20Mathieu=20=28Mathius=29?= Date: Thu, 17 Feb 2022 22:22:04 +0100 Subject: [PATCH] Lint player.js Follow lint indications : - https://github.com/iv-org/invidious/pull/2895#discussion_r809461103 - https://github.com/iv-org/invidious/pull/2895#discussion_r809461622 --- assets/js/player.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index 5498df48..3c58cb62 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -185,9 +185,7 @@ player.playbackRate(video_data.params.speed); * @returns cookieValue */ function getCookieValue(name) { - var value = document.cookie.split(";").filter(item => { - return item.includes(name + "="); - }); + var value = document.cookie.split(";").filter(item => item.includes(name + "=")); return value != null && value.length >= 1 ? value[0].substring((name + "=").length, value[0].length) : null; } @@ -207,7 +205,7 @@ function updateCookie(newVolume, newSpeed) { document.cookie = document.cookie.replace(getCookieValue('PREFS'), encodeURIComponent(JSON.stringify(cookieJson))); } else { var date = new Date(); - //Set expiration in 2 year + // Set expiration in 2 year date.setTime(date.getTime() + 63115200); document.cookie = 'PREFS=' + encodeURIComponent(JSON.stringify({ 'volume': volumeValue, 'speed': speedValue })) +