Hide videos if behind paywall

This commit is contained in:
PrestonN 2018-10-19 10:45:31 -04:00
parent 11ba9f14fe
commit a78afd1b46
2 changed files with 10 additions and 5 deletions

View File

@ -256,7 +256,7 @@ $(document).on('click', 'a[href^="http"]', (event) => {
shell.openExternal(el.href);
}
else{
window.open(el.href,"_self")
window.open(el.href,"_self");
}
});
@ -265,9 +265,10 @@ $(document).on('auxclick', 'a[href^="http"]', (event) => {
let el = event.currentTarget;
if (!el.href.includes('freetube')) {
event.preventDefault();
shell.openExternal(el.href);
}
else{
window.open(el.href,"_self")
event.preventDefault();
let url = el.href.replace('freetube://', '');
shell.openExternal(el.href);
}
});

View File

@ -55,13 +55,17 @@ function search(page = 1) {
data.forEach((video) => {
switch (video.type) {
case 'video':
displayVideo(video, 'search');
if (!video.paid) {
displayVideo(video, 'search');
}
break;
case 'channel':
displayChannel(video);
break;
case 'playlist':
displayPlaylist(video);
if (video.videoCount > 0) {
displayPlaylist(video);
}
break;
default:
}