From a1e2fc8995285485e54daf1deb0811e3bd77f264 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Tue, 26 Dec 2017 22:53:45 -0800 Subject: [PATCH 01/29] - Fixed build archive so that all files are included when a new build is generated. All builds should now have all the proper files as expected and run properly. --- gulpfile.js | 21 +++++++++++++-------- package.json | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7a2d88b8..30f14974 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,6 +7,8 @@ var argv = require('yargs') var del = require('del'); var detectCurrentPlatform = require('nw-builder/lib/detectCurrentPlatform.js'); var zip = require('gulp-zip'); +var gzip = require('gulp-gzip'); +var tar = require('gulp-tar'); var package = require('./package.json'); var nw = new NwBuilder({ @@ -36,20 +38,23 @@ gulp.task('clean', function() { gulp.task('zip', function () { - gulp.src('./build/Popcorn-Time-CE/osx64/*') - .pipe(zip('popcorn-time-ce_osx64_'+package.version+'.gz')) + gulp.src('./build/Popcorn-Time-CE/osx64/**/*') + .pipe(tar('popcorn-time-ce_osx64_'+package.version+'.tar')) + .pipe(gzip()) .pipe(gulp.dest('./dist')); - gulp.src('./build/Popcorn-Time-CE/win32/*') + gulp.src('./build/Popcorn-Time-CE/win32/**') .pipe(zip('popcorn-time-ce_win32_'+package.version+'.zip')) .pipe(gulp.dest('./dist')); - gulp.src('./build/Popcorn-Time-CE/win64/*') + gulp.src('./build/Popcorn-Time-CE/win64/**') .pipe(zip('popcorn-time-ce_win64_'+package.version+'.zip')) .pipe(gulp.dest('./dist')); - gulp.src('./build/Popcorn-Time-CE/linux32/*') - .pipe(zip('popcorn-time-ce_linux32_'+package.version+'.gz')) + gulp.src('./build/Popcorn-Time-CE/linux32/**') + .pipe(tar('popcorn-time-ce_linux32_'+package.version+'.tar')) + .pipe(gzip()) .pipe(gulp.dest('./dist')); - return gulp.src('./build/Popcorn-Time-CE/linux64/*') - .pipe(zip('popcorn-time-ce_linux64_'+package.version+'.gz')) + return gulp.src('./build/Popcorn-Time-CE/linux64/**') + .pipe(tar('popcorn-time-ce_linux64_'+package.version+'.tar')) + .pipe(gzip()) .pipe(gulp.dest('./dist')); }); diff --git a/package.json b/package.json index c468c600..e6e119d3 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,8 @@ "eslint-config-google": "^0.9.1", "gulp": "^3.9.1", "gulp-zip": "~4.0.0", + "gulp-gzip":"^1.4.0", + "gulp-tar": "^2.0.0", "nw-builder": "^3.5.1", "nw-gyp": "^3.4.0", "yargs": "^10.0.3" From eb614243b95ff9a0289e1fad2598562e043f2542 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Tue, 26 Dec 2017 23:05:20 -0800 Subject: [PATCH 02/29] Bump version to 0.4.1-14 --- CHANGELOG.md | 10 ++++++++++ install | 2 +- package.json | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d100e2cc..1eb524fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 0.4.1-14 Beta - Lets start the New Year right... - 26 December 2017 + +New Features: + +- Packages are updated by Greenkeeper + +BugFixes: + +- Fixed build archive so that all files are included when a new build is generated. All builds should now have all the proper files as expected and run properly. +- Updated dependencies ## 0.4.1-11 Beta - Now with some butter - 6 December 2017 New Features: diff --git a/install b/install index e22ae1b5..5f4dca58 100755 --- a/install +++ b/install @@ -23,7 +23,7 @@ fi func_error #Variables -version="0.4.1-13" +version="0.4.1-14" tos="http://popcorn-time.is/tos.html" $path="$HOME/.Popcorn-Time-CE" diff --git a/package.json b/package.json index e6e119d3..a201ae40 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ }, "license": "GPL-3.0", "main": "src/app/index.html", - "version": "0.4.1-13", + "version": "0.4.1-14", "node-remote": "*://*", - "releaseName": "Now with some butter", + "releaseName": "Lets start the New Year right...", "scripts": { "start": "gulp run" }, From a68ddf45ac61c52735e2048da0966526fa0a83e6 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Thu, 28 Dec 2017 23:05:03 -0800 Subject: [PATCH 03/29] Updated JS and Git files --- .gitignore | 1 + .jshintrc | 3 --- src/app/language/en.json | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8b0670a5..5e756ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +dist/ # Visual Studio 2015 cache/options directory .vs/ diff --git a/.jshintrc b/.jshintrc index e55403bc..432e6aed 100644 --- a/.jshintrc +++ b/.jshintrc @@ -21,7 +21,6 @@ "quotmark" : "single", "trailing" : true, "sub" : true, - "trailing" : true, "undef" : true, "laxbreak" : true, "loopfunc" : true, @@ -85,8 +84,6 @@ // Third party "Backbone": true, "Mousetrap": true, - "_": true, - "request": true, "videojs": true, "vjs": true } diff --git a/src/app/language/en.json b/src/app/language/en.json index 2a25a30f..a6a905f7 100644 --- a/src/app/language/en.json +++ b/src/app/language/en.json @@ -526,6 +526,7 @@ " Musical": " Musical", " Romance": " Romance", " Horror": " Horror", - "comedy": "comedy", - "reality": "reality" + " Comedy": " Comedy", + " Reality": " Reality", + " Documentary": " Documentary" } \ No newline at end of file From 3622586ffabb309444ab9c3272eefb925117cf08 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 30 Dec 2017 00:02:03 +0000 Subject: [PATCH 04/29] chore(package): update gulp-zip to version 4.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a201ae40..d27ad3a2 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "eslint": "^4.13.1", "eslint-config-google": "^0.9.1", "gulp": "^3.9.1", - "gulp-zip": "~4.0.0", + "gulp-zip": "~4.1.0", "gulp-gzip":"^1.4.0", "gulp-tar": "^2.0.0", "nw-builder": "^3.5.1", From 6edc99f66b90bec4242a081203cf5e1d6cf4acb9 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 23 Jan 2018 19:02:47 +0000 Subject: [PATCH 05/29] chore(package): update yargs to version 11.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d27ad3a2..29a35b91 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "gulp-tar": "^2.0.0", "nw-builder": "^3.5.1", "nw-gyp": "^3.4.0", - "yargs": "^10.0.3" + "yargs": "^11.0.0" }, "description": "", "author": "" From c95fb595198b1696c91d9f9fcc2bde7fbe0daf98 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Mon, 11 Dec 2017 22:16:28 -0800 Subject: [PATCH 06/29] Streamer: Increased Buffer Stream Webtorrent: Display torrent warning in the console --- src/app/lib/streamer.js | 111 +++++++++++++++++++++------------------- src/app/settings.js | 1 + 2 files changed, 59 insertions(+), 53 deletions(-) diff --git a/src/app/lib/streamer.js b/src/app/lib/streamer.js index 13d48e51..9eb3f0ae 100644 --- a/src/app/lib/streamer.js +++ b/src/app/lib/streamer.js @@ -1,8 +1,9 @@ -(function(App) { +(function (App) { 'use strict'; var STREAM_PORT = 21584; // 'PT'! - var BUFFERING_SIZE = 10 * 1024 * 1024; + //var BUFFERING_SIZE = 10 * 1024 * 1024; + var BUFFERING_SIZE = Settings.bufferSize; var readTorrent = require('read-torrent'); var peerflix = require('peerflix'); @@ -13,7 +14,7 @@ var engine = null; var preload_engine = null; var statsUpdater = null; - var active = function(wire) { + var active = function (wire) { return !wire.peerChoking; }; var subtitles = null; @@ -22,11 +23,9 @@ var subtitleDownloading = false; var serverStarting = false; + var watchState = function (stateModel) { - var watchState = function(stateModel) { - - - if (engine !== null) { + if (engine !== null) { var swarm = engine.get(stateModel.get('streamInfo').get('torrent').info); var state = 'connecting'; @@ -76,7 +75,7 @@ } }; - var handleTorrent = function(torrent, stateModel) { + var handleTorrent = function (torrent, stateModel) { var tmpFilename = torrent.info.infoHash; tmpFilename = tmpFilename.replace(/([^a-zA-Z0-9-_])/g, '_'); // +'-'+ (new Date()*1); @@ -101,7 +100,7 @@ port: parseInt(Settings.streamPort, 10) || 0, tmp: App.settings.tmpLocation, path: tmpFile, // we'll have a different file name for each stream also if it's same torrent in same session - buffer: (1.5 * 1024 * 1024).toString(), // create a buffer on torrent-stream + buffer: BUFFERING_SIZE.toString(), // create a buffer on torrent-stream index: torrent.file_index, name: torrent.info.infoHash, id: torrentPeerId @@ -126,6 +125,10 @@ engine.piecesGot = 0; engine.cachedDownload = 0; + engineTorrent.on('warning', function (err) { + win.warn(err); + }); + engineTorrent.on('ready', function () { win.debug("torrent:ready"); App.vent.trigger('stream:server', stateModel); @@ -159,6 +162,8 @@ //Set file_index to the largest file in torrent streamInfo.set('file_index', file_index); + //Increase buffer size based on file size + //Set total torrent size streamInfo.set('size', size); }); @@ -248,13 +253,13 @@ } }; - App.vent.on('subtitle:downloaded', function(sub) { + App.vent.on('subtitle:downloaded', function (sub) { if (sub) { stateModel.get('streamInfo').set('subFile', sub); App.vent.trigger('subtitle:convert', { path: sub, language: torrent.defaultSubtitle - }, function(err, res) { + }, function (err, res) { if (err) { win.error('error converting subtitles', err); stateModel.get('streamInfo').set('subFile', null); @@ -266,12 +271,12 @@ downloadedSubtitles = true; }); - engine.server.on('listening', function() { + engine.server.on('listening', function () { if (engine) { win.debug("engine:listening"); win.debug(`Server running at ` + engine.server.address().address + ":" + engine.server.address().port); engine.server.port = engine.server.address().port; - + //streamInfo.set('src', 'http://127.0.0.1:' + engine.server.address().port + '/'); streamInfo.set('src', 'http://' + engine.server.address().address + ':' + engine.server.port + "/" + streamInfo.get('file_index')); streamInfo.set('type', 'video/mp4'); @@ -289,14 +294,14 @@ }); - engine.on('uninterested', function() { + engine.on('uninterested', function () { if (engine) { engine.pause(); } }); - engine.on('interested', function() { + engine.on('interested', function () { if (engine) { engine.resume(); } @@ -306,7 +311,7 @@ var Preload = { - start: function(model) { + start: function (model) { if (Streamer.currentTorrent && model.get('torrent') === Streamer.currentTorrent.get('torrent')) { return; @@ -316,7 +321,7 @@ win.debug('Preloading model:', model.get('title')); var torrent_url = model.get('torrent'); - readTorrent(torrent_url, function(err, torrent) { + readTorrent(torrent_url, function (err, torrent) { win.debug('Preloading torrent:', torrent.name); var tmpFilename = torrent.infoHash; @@ -343,7 +348,7 @@ }, - stop: function() { + stop: function () { if (preload_engine) { if (preload_engine.server._handle) { @@ -359,7 +364,7 @@ var Streamer = { - start: function(model) { + start: function (model) { var torrentUrl = model.get('torrent'); var torrent_read = false; if (model.get('torrent_read')) { @@ -381,7 +386,7 @@ this.stop_ = false; var that = this; - var doTorrent = function(err, torrent) { + var doTorrent = function (err, torrent) { // Return if streaming was cancelled while loading torrent if (that.stop_) { return; @@ -394,12 +399,12 @@ // did we need to extract subtitle ? var extractSubtitle = model.get('extract_subtitle'); - var getSubtitles = function(data) { + var getSubtitles = function (data) { win.debug('Subtitles data request:', data); var subtitleProvider = App.Config.getProvider('tvshowsubtitle'); - subtitleProvider.fetch(data).then(function(subs) { + subtitleProvider.fetch(data).then(function (subs) { if (subs && Object.keys(subs).length > 0) { subtitles = subs; win.info(Object.keys(subs).length + ' subtitles found'); @@ -410,7 +415,7 @@ win.warn('No subtitles returned'); } hasSubtitles = true; - }).catch(function(err) { + }).catch(function (err) { subtitles = null; hasSubtitles = true; downloadedSubtitles = true; @@ -418,7 +423,7 @@ }); }; - var handleTorrent_fnc = function() { + var handleTorrent_fnc = function () { // TODO: We should passe the movie / tvshow imdbid instead // and read from the player // so from there we can use the previous next etc @@ -478,7 +483,7 @@ } } if (torrent.files && torrent.files.length > 0 && !model.get('file_index') && model.get('file_index') !== 0) { - torrent.files = $.grep(torrent.files, function(n) { + torrent.files = $.grep(torrent.files, function (n) { return (n); }); var fileModel = new Backbone.Model({ @@ -495,7 +500,7 @@ torrentMetadata = torrent.info.name.toString(); } Common.matchTorrent(torrent.name, torrentMetadata) - .then(function(res) { + .then(function (res) { if (res.error) { win.warn(res.error); sub_data.filename = res.filename; @@ -504,34 +509,34 @@ handleTorrent_fnc(); } else { switch (res.type) { - case 'movie': - $('.loading-background').css('background-image', 'url(' + res.movie.image + ')'); - sub_data.imdbid = res.movie.imdbid; - model.set('quality', res.quality); - model.set('imdb_id', sub_data.imdbid); - title = res.movie.title; - break; - case 'episode': - $('.loading-background').css('background-image', 'url(' + res.show.episode.image + ')'); - sub_data.imdbid = res.show.imdbid; - sub_data.season = res.show.episode.season; - sub_data.episode = res.show.episode.episode; - model.set('quality', res.quality); - model.set('tvdb_id', res.show.tvdbid); - model.set('episode_id', res.show.episode.tvdbid); - model.set('imdb_id', res.show.imdbid); - model.set('episode', sub_data.episode); - model.set('season', sub_data.season); - title = res.show.title + ' - ' + i18n.__('Season %s', res.show.episode.season) + ', ' + i18n.__('Episode %s', res.show.episode.episode) + ' - ' + res.show.episode.title; - break; - default: - sub_data.filename = res.filename; + case 'movie': + $('.loading-background').css('background-image', 'url(' + res.movie.image + ')'); + sub_data.imdbid = res.movie.imdbid; + model.set('quality', res.quality); + model.set('imdb_id', sub_data.imdbid); + title = res.movie.title; + break; + case 'episode': + $('.loading-background').css('background-image', 'url(' + res.show.episode.image + ')'); + sub_data.imdbid = res.show.imdbid; + sub_data.season = res.show.episode.season; + sub_data.episode = res.show.episode.episode; + model.set('quality', res.quality); + model.set('tvdb_id', res.show.tvdbid); + model.set('episode_id', res.show.episode.tvdbid); + model.set('imdb_id', res.show.imdbid); + model.set('episode', sub_data.episode); + model.set('season', sub_data.season); + title = res.show.title + ' - ' + i18n.__('Season %s', res.show.episode.season) + ', ' + i18n.__('Episode %s', res.show.episode.episode) + ' - ' + res.show.episode.title; + break; + default: + sub_data.filename = res.filename; } getSubtitles(sub_data); handleTorrent_fnc(); } }) - .catch(function(err) { + .catch(function (err) { title = $.trim(torrent.name.replace('[rartv]', '').replace('[PublicHD]', '').replace('[ettv]', '').replace('[eztv]', '')).replace(/[\s]/g, '.'); sub_data.filename = title; win.error('An error occured while trying to get metadata and subtitles', err); @@ -552,7 +557,7 @@ // HACK(xaiki): we need to go through parse torrent // if we have a torrent and not an http source, this // is fragile as shit. - if (typeof(torrentUrl) === 'string' && torrentUrl.substring(0, 7) === 'http://' && !torrentUrl.match('\\.torrent') && !torrentUrl.match('\\.php?')) { + if (typeof (torrentUrl) === 'string' && torrentUrl.substring(0, 7) === 'http://' && !torrentUrl.match('\\.torrent') && !torrentUrl.match('\\.php?')) { return Streamer.startStream(model, torrentUrl, stateModel); } else if (!torrent_read) { readTorrent(torrentUrl, doTorrent); //preload torrent @@ -578,16 +583,16 @@ App.vent.trigger('stream:ready', si); }, - stop: function() { + stop: function () { this.stop_ = true; if (engine) { // update ratio - if (!Settings.totalDownloaded){ + if (!Settings.totalDownloaded) { Settings.totalDownloaded = 0; } Settings.totalDownloaded = Settings.totalDownloaded + engine.torrents[0].received; - if (!Settings.totalUploaded){ + if (!Settings.totalUploaded) { Settings.totalUploaded = 0; } Settings.totalUploaded = Settings.totalUploaded + engine.torrents[0].uploaded; diff --git a/src/app/settings.js b/src/app/settings.js index 860d137b..429329af 100644 --- a/src/app/settings.js +++ b/src/app/settings.js @@ -26,6 +26,7 @@ Settings.postersJump = [134, 154, 174, 194, 214, 234, 254, 274, 294]; Settings.alwaysFullscreen = false; Settings.playNextEpisodeAuto = true; Settings.chosenPlayer = 'local'; +Settings.bufferSize = 10 * 1024 * 1024; // Advanced UI Settings.alwaysOnTop = false; From afe38f24b4824ea8610777e41d8af14c2d244000 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Wed, 13 Dec 2017 01:48:09 -0800 Subject: [PATCH 07/29] Added GTM --- src/app/index.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/index.html b/src/app/index.html index b9851f49..1f1dfd67 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -2,6 +2,14 @@ + + + + @@ -11,6 +19,12 @@ + + + + +
From 4dc6f7209c8d6afe70a44956e7b5c209d4759f37 Mon Sep 17 00:00:00 2001 From: captainyarr Date: Sat, 30 Dec 2017 22:53:27 -0800 Subject: [PATCH 08/29] Update Analytics --- .vscode/settings.json | 3 ++- src/app/index.html | 34 ++++++++++++++++++++++-------- src/app/lib/views/main_window.js | 22 +++++++++++++------ src/app/settings.js | 2 +- src/app/templates/movie-detail.tpl | 10 ++++++--- src/app/templates/show-detail.tpl | 9 +++++--- 6 files changed, 56 insertions(+), 24 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 40360063..392fb975 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ // Place your settings in this file to overwrite default and user settings. { - "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, + // Defines space handling after function keyword for anonymous functions + "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, "eslint.enable": false, "jshint.enable": false } \ No newline at end of file diff --git a/src/app/index.html b/src/app/index.html index 1f1dfd67..9163c862 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -3,11 +3,22 @@ - + @@ -19,7 +30,7 @@ - + @@ -183,13 +194,14 @@ a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) - })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); + })(window, document, 'script', 'https://www.google-analytics.com/analytics_debug.js', 'ga'); window.ga_debug = { trace: true } ga('create', Settings.gaCode, { //'cookieDomain': 'none' }); + ga('set', 'checkProtocolTask', function() { /* nothing */ }); // Replace the following lines with the plugins you want to use. @@ -201,9 +213,13 @@ ga('require', 'impressionTracker', { attributePrefix: 'data-' }); - ga('require', 'maxScrollTracker'); + ga('require', 'maxScrollTracker', { + maxScrollMetricIndex: 1, + }); ga('require', 'mediaQueryTracker'); - ga('require', 'pageVisibilityTracker'); + ga('require', 'pageVisibilityTracker', { + sendInitialPageview: true, + });