console.warn and info instead of log

This commit is contained in:
meow 2022-04-20 16:36:03 +03:00
parent 026ea52445
commit 3431a1b1de
6 changed files with 28 additions and 28 deletions

View file

@ -96,7 +96,7 @@ function get_youtube_replies(target, load_more) {
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Pulling comments failed.'); console.warn('Pulling comments failed.');
body.innerHTML = fallback; body.innerHTML = fallback;
}; };

View file

@ -5,7 +5,7 @@ function get_playlist(plid, retries) {
if (retries === undefined) retries = 5; if (retries === undefined) retries = 5;
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to pull playlist'); console.warn('Failed to pull playlist');
return; return;
} }
@ -62,12 +62,12 @@ function get_playlist(plid, retries) {
}; };
xhr.onerror = function () { xhr.onerror = function () {
console.log('Pulling playlist failed... ' + retries + '/5'); console.warn('Pulling playlist failed... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000); setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Pulling playlist failed... ' + retries + '/5'); console.warn('Pulling playlist failed... ' + retries + '/5');
get_playlist(plid, retries - 1); get_playlist(plid, retries - 1);
}; };

View file

@ -25,12 +25,12 @@ function get_subscriptions(callback, retries) {
}; };
xhr.onerror = function () { xhr.onerror = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5'); console.warn('Pulling subscriptions failed... ' + retries + '/5');
setTimeout(function () { get_subscriptions(callback, retries - 1); }, 1000); setTimeout(function () { get_subscriptions(callback, retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5'); console.warn('Pulling subscriptions failed... ' + retries + '/5');
get_subscriptions(callback, retries - 1); get_subscriptions(callback, retries - 1);
}; };
@ -54,7 +54,7 @@ function create_notification_stream(subscriptions) {
} }
var notification = JSON.parse(event.data); var notification = JSON.parse(event.data);
console.log('Got notification:', notification); console.info('Got notification:', notification);
if (start_time < notification.published && !delivered.includes(notification.videoId)) { if (start_time < notification.published && !delivered.includes(notification.videoId)) {
if (Notification.permission === 'granted') { if (Notification.permission === 'granted') {
@ -90,7 +90,7 @@ function create_notification_stream(subscriptions) {
} }
function handle_notification_error(event) { function handle_notification_error(event) {
console.log('Something went wrong with notifications, trying to reconnect...'); console.warn('Something went wrong with notifications, trying to reconnect...');
notifications = { close: function () { } }; notifications = { close: function () { } };
setTimeout(function () { get_subscriptions(create_notification_stream); }, 1000); setTimeout(function () { get_subscriptions(create_notification_stream); }, 1000);
} }

View file

@ -280,7 +280,7 @@ player.on('volumechange', function () {
player.on('waiting', function () { player.on('waiting', function () {
if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) { if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) {
console.log('Player has caught up to source, resetting playbackRate.'); console.info('Player has caught up to source, resetting playbackRate.');
player.playbackRate(1); player.playbackRate(1);
} }
}); });
@ -477,7 +477,7 @@ function set_all_video_times(times) {
try { try {
storage.setItem(save_player_pos_key, JSON.stringify(times)); storage.setItem(save_player_pos_key, JSON.stringify(times));
} catch (e) { } catch (e) {
console.debug('set_all_video_times: ' + e); console.warn('set_all_video_times: ' + e);
} }
} else { } else {
storage.removeItem(save_player_pos_key); storage.removeItem(save_player_pos_key);
@ -492,7 +492,7 @@ function get_all_video_times() {
try { try {
return JSON.parse(raw); return JSON.parse(raw);
} catch (e) { } catch (e) {
console.debug('get_all_video_times: ' + e); console.warn('get_all_video_times: ' + e);
} }
} }
} }

View file

@ -14,7 +14,7 @@ function subscribe(retries) {
if (retries === undefined) retries = 5; if (retries === undefined) retries = 5;
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to subscribe.'); console.warn('Failed to subscribe.');
return; return;
} }
@ -40,12 +40,12 @@ function subscribe(retries) {
}; };
xhr.onerror = function () { xhr.onerror = function () {
console.log('Subscribing failed... ' + retries + '/5'); console.warn('Subscribing failed... ' + retries + '/5');
setTimeout(function () { subscribe(retries - 1); }, 1000); setTimeout(function () { subscribe(retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Subscribing failed... ' + retries + '/5'); console.warn('Subscribing failed... ' + retries + '/5');
subscribe(retries - 1); subscribe(retries - 1);
}; };
@ -57,7 +57,7 @@ function unsubscribe(retries) {
retries = 5; retries = 5;
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to subscribe'); console.warn('Failed to subscribe');
return; return;
} }
@ -83,12 +83,12 @@ function unsubscribe(retries) {
}; };
xhr.onerror = function () { xhr.onerror = function () {
console.log('Unsubscribing failed... ' + retries + '/5'); console.warn('Unsubscribing failed... ' + retries + '/5');
setTimeout(function () { unsubscribe(retries - 1); }, 1000); setTimeout(function () { unsubscribe(retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Unsubscribing failed... ' + retries + '/5'); console.warn('Unsubscribing failed... ' + retries + '/5');
unsubscribe(retries - 1); unsubscribe(retries - 1);
}; };

View file

@ -121,7 +121,7 @@ function get_playlist(plid, retries) {
var playlist = document.getElementById('playlist'); var playlist = document.getElementById('playlist');
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to pull playlist'); console.warn('Failed to pull playlist');
playlist.innerHTML = ''; playlist.innerHTML = '';
return; return;
} }
@ -194,7 +194,7 @@ function get_playlist(plid, retries) {
playlist.innerHTML = playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>'; '<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
console.log('Pulling playlist timed out... ' + retries + '/5'); console.warn('Pulling playlist timed out... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000); setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
}; };
@ -203,7 +203,7 @@ function get_playlist(plid, retries) {
playlist.innerHTML = playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>'; '<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
console.log('Pulling playlist timed out... ' + retries + '/5'); console.warn('Pulling playlist timed out... ' + retries + '/5');
get_playlist(plid, retries - 1); get_playlist(plid, retries - 1);
}; };
@ -215,7 +215,7 @@ function get_reddit_comments(retries) {
var comments = document.getElementById('comments'); var comments = document.getElementById('comments');
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to pull comments'); console.warn('Failed to pull comments');
comments.innerHTML = ''; comments.innerHTML = '';
return; return;
} }
@ -265,7 +265,7 @@ function get_reddit_comments(retries) {
comments.children[0].children[1].children[0].onclick = swap_comments; comments.children[0].children[1].children[0].onclick = swap_comments;
} else { } else {
if (video_data.params.comments[1] === 'youtube') { if (video_data.params.comments[1] === 'youtube') {
console.log('Pulling comments failed... ' + retries + '/5'); console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000); setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
} else { } else {
comments.innerHTML = fallback; comments.innerHTML = fallback;
@ -275,12 +275,12 @@ function get_reddit_comments(retries) {
}; };
xhr.onerror = function () { xhr.onerror = function () {
console.log('Pulling comments failed... ' + retries + '/5'); console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_reddit_comments(retries - 1); }, 1000); setTimeout(function () { get_reddit_comments(retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Pulling comments failed... ' + retries + '/5'); console.warn('Pulling comments failed... ' + retries + '/5');
get_reddit_comments(retries - 1); get_reddit_comments(retries - 1);
}; };
@ -292,7 +292,7 @@ function get_youtube_comments(retries) {
var comments = document.getElementById('comments'); var comments = document.getElementById('comments');
if (retries <= 0) { if (retries <= 0) {
console.log('Failed to pull comments'); console.warn('Failed to pull comments');
comments.innerHTML = ''; comments.innerHTML = '';
return; return;
} }
@ -349,14 +349,14 @@ function get_youtube_comments(retries) {
xhr.onerror = function () { xhr.onerror = function () {
comments.innerHTML = comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>'; '<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5'); console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000); setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
comments.innerHTML = comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>'; '<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5'); console.warn('Pulling comments failed... ' + retries + '/5');
get_youtube_comments(retries - 1); get_youtube_comments(retries - 1);
}; };
@ -417,7 +417,7 @@ function get_youtube_replies(target, load_more, load_replies) {
}; };
xhr.ontimeout = function () { xhr.ontimeout = function () {
console.log('Pulling comments failed.'); console.warn('Pulling comments failed.');
body.innerHTML = fallback; body.innerHTML = fallback;
}; };