mirror of https://github.com/FreeTubeApp/FreeTube
Remove debug statements and old code
This commit is contained in:
parent
364cb4cffc
commit
a6a64aa331
|
@ -71,7 +71,6 @@ function goToChannel(channelId) {
|
|||
|
||||
function channelNextPage() {
|
||||
showToast('Fetching results, please wait...');
|
||||
console.log(channelView.page);
|
||||
|
||||
invidiousAPI('channels/videos', channelView.channelId, {'page': channelView.page}, (data) => {
|
||||
console.log(data);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* Event when user clicks comment box,
|
||||
* and wants to show/display comments for the user.
|
||||
*/
|
||||
let showComments = function (event) {
|
||||
let showComments = function (event, continuation = '') {
|
||||
let comments = $('#comments');
|
||||
|
||||
if (comments.css('display') === 'none') {
|
||||
|
@ -51,6 +51,7 @@ let showComments = function (event) {
|
|||
const html = mustache.render(commentsTemplate, {
|
||||
comments: comments,
|
||||
});
|
||||
|
||||
$('#comments').html(html);
|
||||
});
|
||||
|
||||
|
@ -77,7 +78,6 @@ let videoShortcutHandler = function (event) {
|
|||
|
||||
let videoPlayer = $('.videoPlayer').get(0);
|
||||
if (typeof (videoPlayer) !== 'undefined' && !$('#jumpToInput').is(':focus') && !$('#search').is(':focus')) {
|
||||
console.log(event.which);
|
||||
switch (event.which) {
|
||||
case 32:
|
||||
// Space Bar
|
||||
|
|
|
@ -64,11 +64,6 @@ function playVideo(videoId, playlistId = '') {
|
|||
playerView.videoDislikes = data.dislikeCount;
|
||||
let totalLikes = parseInt(playerView.videoLikes) + parseInt(playerView.videoDislikes);
|
||||
playerView.likePercentage = parseInt((playerView.videoLikes / totalLikes) * 100);
|
||||
|
||||
/*invidiousAPI('videos', "9Ww-TQUeA3E", {}, function (data) {
|
||||
console.log(data);
|
||||
});*/
|
||||
|
||||
playerView.videoTitle = data.title;
|
||||
playerView.channelName = data.author;
|
||||
playerView.channelId = data.authorId;
|
||||
|
@ -186,7 +181,6 @@ function playVideo(videoId, playlistId = '') {
|
|||
data.title = video.title;
|
||||
data.channelName = video.author;
|
||||
data.thumbnail = video.videoThumbnails[4].url;
|
||||
//data.publishedDate = dateFormat(snippet.publishedAt, "mmm dS, yyyy");
|
||||
data.viewCount = video.viewCountText;
|
||||
|
||||
playerView.recommendedVideoList = playerView.recommendedVideoList.concat(data);
|
||||
|
@ -206,8 +200,6 @@ function playVideo(videoId, playlistId = '') {
|
|||
|
||||
let amountOfPages = Math.ceil(data.videoCount / 100);
|
||||
|
||||
console.log(amountOfPages);
|
||||
|
||||
for (let i = 1; i <= amountOfPages; i++) {
|
||||
invidiousAPI('playlists', playlistId, {page: i}, (data) => {
|
||||
data.videos.forEach((video) => {
|
||||
|
@ -299,7 +291,6 @@ function checkVideoSettings() {
|
|||
let player = document.getElementById('videoPlayer');
|
||||
|
||||
if (autoplay) {
|
||||
console.log(player);
|
||||
player.play();
|
||||
}
|
||||
|
||||
|
|
|
@ -184,16 +184,10 @@ function updateSettings() {
|
|||
defaultQuality = qualitySelect;
|
||||
defaultPlaybackRate = rateSelect;
|
||||
|
||||
console.log(historySwitch);
|
||||
|
||||
console.log(themeSwitch);
|
||||
|
||||
if (themeSwitch === true) {
|
||||
theme = 'dark';
|
||||
}
|
||||
|
||||
console.log(theme);
|
||||
|
||||
// Update default theme
|
||||
settingsDb.update({
|
||||
_id: 'theme'
|
||||
|
|
|
@ -52,45 +52,6 @@ function search(page = 1) {
|
|||
}, function (data) {
|
||||
console.log(data);
|
||||
|
||||
/*let channels = data.items.filter((item) => {
|
||||
if (item.id.kind === 'youtube#channel') {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
let playlists = data.items.filter((item) => {
|
||||
if (item.id.kind === 'youtube#playlist') {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
let videos = data.items.filter((item) => {
|
||||
if (item.id.kind === 'youtube#video') {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
ft.log('Channels: ', channels);
|
||||
ft.log('Typeof object above (channels) ^^', typeof (channels));
|
||||
ft.log('Playlists', playlists);
|
||||
|
||||
if (playlists.length > 0) {
|
||||
//displayPlaylists(playlists);
|
||||
}
|
||||
|
||||
if (channels.length > 0) {
|
||||
//displayChannels(channels);
|
||||
}
|
||||
|
||||
let grabDuration = getDuration(data);
|
||||
|
||||
grabDuration.then((videoList) => {
|
||||
console.log(videoList);
|
||||
videoList.items.forEach((video) => {
|
||||
displayVideo(video, 'search');
|
||||
});
|
||||
});*/
|
||||
|
||||
data.forEach((video) => {
|
||||
switch (video.type) {
|
||||
case 'video':
|
||||
|
@ -106,7 +67,6 @@ function search(page = 1) {
|
|||
}
|
||||
});
|
||||
|
||||
//searchView.nextPageToken = data.nextPageToken;
|
||||
searchView.page = searchView.page + 1;
|
||||
loadingView.seen = false;
|
||||
})
|
||||
|
@ -180,10 +140,7 @@ function displayVideo(videoData, listType = '') {
|
|||
} else {
|
||||
video.duration = minutes + ":" + seconds;
|
||||
}
|
||||
|
||||
// Grab the published date for the video and convert to a user readable state.
|
||||
//const dateString = new Date(videoSnippet.publishedAt);
|
||||
//video.publishedDate = dateFormat(dateString, "mmm dS, yyyy");
|
||||
|
||||
video.publishedDate = videoData.publishedText;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue