Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.3.0 #555

Merged
merged 104 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
61ed925
Add @amilajack/react-plyr for caption support
amilajack Sep 2, 2018
b7abd92
Add initial support for subtitles
amilajack Sep 2, 2018
f3eaaa1
bump g++ version (#418)
amilajack Nov 16, 2018
16b3b5d
chore(deps): update dependency concurrently to v4.0.1
renovate-bot Nov 17, 2018
cdffa00
chore(deps): update dependency electron-builder to ^20.36.2
renovate-bot Nov 17, 2018
fc267cd
chore(deps): update dependency eslint-config-prettier to ^3.3.0
renovate-bot Nov 17, 2018
fb87674
chore(deps): update dependency eslint-plugin-promise to v4.0.1
renovate-bot Nov 17, 2018
f42f343
chore(deps): update dependency testcafe to ^0.23.2
renovate-bot Nov 17, 2018
088fc76
chore(deps): update dependency url-loader to v1.1.2
renovate-bot Nov 17, 2018
d7f87bb
fix(deps): update dependency @amilajack/react-plyr to ^2.1.2
renovate-bot Nov 17, 2018
5aae401
fix(deps): update dependency vlc-command to v1.1.2
renovate-bot Nov 17, 2018
d9d4618
fix(deps): update dependency react-router-redux to v5.0.0-alpha.8
renovate-bot Nov 17, 2018
3719bcd
fix(deps): update dependency yargs to v12.0.4
renovate-bot Nov 17, 2018
764e2ea
fix(deps): update react monorepo to v16.6.3
renovate-bot Nov 17, 2018
14131ec
fix(deps): update dependency electron-window-state to v5 (#443)
renovate[bot] Nov 19, 2018
c803d89
chore(deps): update dependency why-did-you-update to v1 (#442)
renovate[bot] Nov 19, 2018
492731b
chore(deps): update dependency spectron to v5 (#439)
renovate[bot] Nov 19, 2018
04d2c61
chore(deps): update dependency sinon to v7 (#438)
renovate[bot] Nov 19, 2018
a584ec8
chore(deps): update dependency lint-staged to v8 (#437)
renovate[bot] Nov 19, 2018
0683fef
chore(deps): update dependency husky to v1 (#435)
renovate[bot] Nov 19, 2018
83a8120
chore(deps): update dependency fbjs-scripts to v1 (#434)
renovate[bot] Nov 19, 2018
28ed2bf
chore(deps): update dependency eslint-plugin-jest to v22 (#433)
renovate[bot] Nov 19, 2018
b964267
chore(deps): update dependency concurrently to v4.1.0
renovate-bot Nov 24, 2018
1fca50c
chore(deps): update dependency detect-port to ^1.3.0
renovate-bot Nov 24, 2018
c260cf7
chore(deps): update dependency electron to v2.0.14
renovate-bot Nov 24, 2018
04e99ed
chore(deps): update dependency husky to ^1.2.0
renovate-bot Nov 24, 2018
8f358f6
chore(deps): update dependency lint-staged to ^8.1.0
renovate-bot Nov 24, 2018
979bf6e
chore(deps): update dependency lru-cache to v4.1.4
renovate-bot Nov 24, 2018
c233ba7
fix(deps): update dependency yargs to v12.0.5
renovate-bot Nov 24, 2018
f621a19
chore(deps): update dependency eslint-plugin-jest to v22.1.0
renovate-bot Dec 1, 2018
aa0b4f7
chore(deps): update dependency flow-bin to ^0.87.0
renovate-bot Dec 1, 2018
b8e0331
chore(deps): update dependency lru-cache to v4.1.5
renovate-bot Dec 1, 2018
8bc2c63
chore(deps): update dependency prettier to ^1.15.3
renovate-bot Dec 1, 2018
9cbc250
chore(deps): update dependency stylelint to ^9.9.0
renovate-bot Dec 1, 2018
26c189d
chore(deps): update dependency testcafe-react-selectors to ^3.0.2
renovate-bot Dec 1, 2018
53c03b6
fix(deps): update dependency electron-window-state to ^5.0.3
renovate-bot Dec 1, 2018
ab751c7
fix(deps): update dependency popper.js to ^1.14.6
renovate-bot Dec 1, 2018
10ca2a9
chore(deps): update dependency autoprefixer to ^9.4.2
renovate-bot Dec 8, 2018
287dbf5
chore(deps): update dependency dotenv to v6.2.0
renovate-bot Dec 8, 2018
654b87c
chore(deps): update dependency enzyme-to-json to ^3.3.5
renovate-bot Dec 8, 2018
995e7ee
chore(deps): update dependency eslint-plugin-jest to v22.1.2
renovate-bot Dec 8, 2018
a7a62b6
chore(deps): update dependency eslint to ^5.10.0
renovate-bot Dec 8, 2018
5b4fb14
chore(deps): update dependency electron-builder to ^20.38.3
renovate-bot Dec 11, 2018
1a8d22a
chore(deps): update dependency electron to v2.0.15
renovate-bot Dec 15, 2018
ce363f7
chore(deps): update dependency enzyme to ^3.8.0
renovate-bot Dec 15, 2018
8036cc3
chore(deps): update dependency flow-bin to ^0.89.0
renovate-bot Dec 15, 2018
36e44f7
chore(deps): update dependency husky to ^1.2.1
renovate-bot Dec 15, 2018
baa06bf
chore(deps): update dependency node-sass to v4.11.0
renovate-bot Dec 15, 2018
fb5cff9
chore(deps): update dependency sinon to ^7.2.2
renovate-bot Dec 15, 2018
cfd2939
chore(deps): update dependency testcafe-browser-provider-electron to …
renovate-bot Dec 15, 2018
dbeb860
chore(deps): update dependency webpack-merge to v4.1.5
renovate-bot Dec 15, 2018
07f45dc
fix(deps): update dependency react-hot-loader to v4.6.0
renovate-bot Dec 15, 2018
9c1c596
fix(deps): update dependency react-transition-group to ^2.5.1
renovate-bot Dec 15, 2018
3f2ca23
chore(deps): update dependency autoprefixer to ^9.4.3
renovate-bot Dec 22, 2018
b3b84da
chore(deps): update dependency electron to v2.0.16
renovate-bot Dec 22, 2018
c502557
chore(deps): update dependency testcafe to ^0.23.3
renovate-bot Dec 22, 2018
aa65f42
chore(deps): update dependency electron-builder to ^20.38.4
renovate-bot Dec 22, 2018
4c055a0
chore(deps): update dependency webpack-dev-server to ^3.1.11
renovate-bot Dec 22, 2018
82845f3
chore(deps): update dependency testcafe-browser-provider-electron to …
renovate-bot Dec 22, 2018
f412717
fix(deps): update dependency bootstrap to v4.2.1
renovate-bot Dec 22, 2018
5875864
fix(deps): update dependency get-port to ^4.1.0
renovate-bot Dec 22, 2018
2a0c2d7
fix(deps): update dependency react-hot-loader to v4.6.3
renovate-bot Dec 22, 2018
9b36e8f
fix(deps): update dependency react-transition-group to ^2.5.2
renovate-bot Dec 22, 2018
fa09640
fix(deps): update react monorepo to v16.7.0
renovate-bot Dec 22, 2018
ddb88e7
chore(deps): update dependency webpack-dev-server to ^3.1.12
renovate-bot Dec 22, 2018
21806df
chore(deps): update dependency webpack-dev-server to ^3.1.13
renovate-bot Dec 22, 2018
7812e3c
chore(deps): update dependency husky to ^1.3.1
renovate-bot Dec 29, 2018
f407d72
chore(deps): update dependency webpack-dev-server to ^3.1.14
renovate-bot Dec 29, 2018
254422d
chore(deps): update dependency eslint-plugin-react to ^7.12.1
renovate-bot Jan 1, 2019
655c35b
chore(deps): update dependency eslint to ^5.12.0
renovate-bot Jan 4, 2019
e716670
chore(deps): update dependency autoprefixer to ^9.4.4
renovate-bot Jan 5, 2019
55e1edc
chore(deps): update dependency eslint-plugin-react to ^7.12.3
renovate-bot Jan 5, 2019
a297adc
chore(deps): update dependency webpack-merge to v4.2.1
renovate-bot Jan 5, 2019
b1ad8d2
chore(deps): update dependency chalk to ^2.4.2
renovate-bot Jan 5, 2019
05e3c39
chore(deps): update dependency webpack-cli to ^3.2.1
renovate-bot Jan 7, 2019
80df92d
chore(deps): update dependency webpack-dev-middleware to ^3.5.0
renovate-bot Jan 7, 2019
71dd7b9
chore(deps): update dependency eslint-plugin-jest to v22.1.3
renovate-bot Jan 12, 2019
965f631
chore(deps): update dependency flow-bin to ^0.90.0
renovate-bot Jan 12, 2019
6eb1a77
chore(deps): update dependency autoprefixer to ^9.4.5
renovate-bot Jan 12, 2019
e811a7d
chore(deps): update dependency babel-plugin-flow-runtime to v0.18.0
renovate-bot Jan 19, 2019
fc50c35
chore(deps): update dependency electron-builder to ^20.38.5
renovate-bot Jan 19, 2019
5625867
chore(deps): update dependency eslint to ^5.12.1
renovate-bot Jan 19, 2019
669a3f4
chore(deps): update dependency eslint-config-prettier to ^3.5.0
renovate-bot Jan 19, 2019
5c3bb26
chore(deps): update dependency eslint-plugin-react to ^7.12.4
renovate-bot Jan 19, 2019
19536c5
chore(deps): update dependency flow-bin to ^0.91.0
renovate-bot Jan 19, 2019
14703eb
chore(deps): update dependency node-libs-browser to v2.2.0
renovate-bot Jan 19, 2019
776210f
chore(deps): update dependency stylelint to ^9.10.0
renovate-bot Jan 19, 2019
4cfe32e
chore(deps): update dependency testcafe-react-selectors to ^3.0.3
renovate-bot Jan 19, 2019
e3daaec
chore(deps): update dependency webpack-dev-middleware to ^3.5.1
renovate-bot Jan 19, 2019
e46c09f
fix(deps): update dependency react-transition-group to ^2.5.3
renovate-bot Jan 19, 2019
2c5314b
chore(deps): update dependency stylelint to ^9.10.1
renovate-bot Jan 19, 2019
6dbb50a
chore(deps): update dependency eslint-config-prettier to ^3.6.0
renovate-bot Jan 19, 2019
dc47402
chore(deps): update dependency autoprefixer to ^9.4.7
renovate-bot Jan 28, 2019
e75b126
chore(deps): update dependency electron to v2.0.17
renovate-bot Feb 2, 2019
44f1718
chore(deps): update dependency sinon to ^7.2.6
renovate-bot Mar 1, 2019
903fe20
chore(deps): update dependency autoprefixer to ^9.4.9
renovate-bot Mar 2, 2019
8935895
chore(deps): update dependency source-map-support to ^0.5.10
renovate-bot Mar 2, 2019
1c1f4b2
chore(deps): update dependency electron-rebuild to ^1.8.4
renovate-bot Mar 2, 2019
55f282e
fix movie images issues
amilajack Mar 7, 2019
37189ae
fix(deps): update dependency bootstrap to v4.3.1 [security]
renovate-bot Mar 10, 2019
6bd086d
Merge branch 'master' into next
amilajack Apr 3, 2019
882e2e8
update webpack renderer dev config
amilajack Apr 3, 2019
1ea1620
fix bug causing item page to not open
amilajack Apr 3, 2019
7d54c7b
add auto update support
amilajack Apr 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .babelrc

This file was deleted.

7 changes: 2 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,9 @@ CONFIG_MAX_CONNECTIONS=20

# English subtitles support
#
# This flag allows subtitles in torrents to be played along with the movie. Be
# careful, since this is a very early stage experiment! Currently this only
# allows English subtitles. Support for subtitles of multiple languages is
# planned for a future release.
# This flag allows subtitles in torrents to be played along with the movie

FLAG_SUBTITLES=false
FLAG_SUBTITLES=true



Expand Down
25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ flow-typed/npm/*
release
app/main.prod.js
app/main.prod.js.map
app/bundle.js
app/bundle.js.map
app/style.css
app/style.css.map
dist
Expand Down
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@ matrix:
language: node_js
node_js:
- node
- 9
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- os: linux
language: node_js
node_js:
- node
- 9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-8
- icnsutils
- graphicsmagick
- xz-utils
Expand Down Expand Up @@ -49,7 +47,7 @@ cache:
- "$HOME/docker"

install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX="g++-4.8"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX="g++-8"; fi
- yarn
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@
</a>
</div>

<div>
<img src="https://raw.github.com/amilajack/popcorn-time-desktop-design/master/Desktop.jpg" width="500px"/>
</div>

<br />

## Features:

**Modern**: This client was started from scratch and was designed to be performant and customizable
## Features:

**Performance**: Significantly faster than other clients. Everything from scrolling perf to playing movies is buttery smooth
* ✨ **Modern**: This client was started from scratch and was designed to be performant and customizable

**Faster Torrents**: New API optimized for fast torrents by querying the from multiple endpoints
* ⏩ **Performance**: Significantly faster than other clients. Everything from scrolling perf to playing movies is buttery smooth

**Modern Stack**: Electron, React, Redux, Webpack, ES8, Flow, and others
* 💨**Faster Torrents**: New API optimized for fast torrents by querying the from multiple endpoints

**Cross Platform**: Works on Mac, Windows, and Linux
* ✅**Cross Platform**: Works on Mac, Windows, and Linux

## Getting started:

Expand All @@ -60,7 +63,7 @@ cd popcorn-time-desktop
# 💡 For casting support, you will need to satisfy mdns's requirements:
# For windows install bonjour: https://support.apple.com/downloads/bonjour_for_windows
# For linux, make sure you have these dependencies installed with apt-get:
# https://github.com/amilajack/popcorn-time-desktop/blob/v1.2.0/.travis.yml#L24-L35
# https://github.com/amilajack/popcorn-time-desktop/blob/v1.3.0/.travis.yml#L24-L35

# Install dependencies
# Have a cup of coffee ☕️ this might take a while
Expand Down
7 changes: 5 additions & 2 deletions app/api/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import vlcCommand from 'vlc-command';
import ChromecastPlayerProvider from './players/ChromecastPlayerProvider';
import type { metadataType } from './players/PlayerProviderInterface';

export type subtitleType = { kind: string, src: string, srclang: string };

const { powerSaveBlocker } = remote;

export default class Player {
Expand Down Expand Up @@ -62,11 +64,12 @@ export default class Player {
async initCast(
provider: ChromecastPlayerProvider,
streamingUrl: string,
metadata: metadataType
metadata: metadataType,
subtitles: Array<subtitleType>
) {
this.powerSaveBlockerId = powerSaveBlocker.start('prevent-app-suspension');
const addr = streamingUrl.replace('localhost', network());
return provider.play(addr, metadata);
return provider.play(addr, metadata, subtitles);
}

initYouTube() {
Expand Down
8 changes: 8 additions & 0 deletions app/api/Subtitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ export default class SubtitleServer {

// Start the static file server for the subtitle files
const server = express();
// Enable CORS
// https://github.com/thibauts/node-castv2-client/wiki/How-to-use-subtitles-with-the-DefaultMediaReceiver-app#subtitles
server.use((req, res, next) => {
if (req.headers.origin) {
res.headers['Access-Control-Allow-Origin'] = req.headers.origin;
}
next();
});
server.use(express.static(this.basePath));
this.server = server.listen(this.port);

Expand Down
11 changes: 9 additions & 2 deletions app/api/Torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ export default class Torrent {
magnetURI: string,
metadata: metadataType,
supportedFormats: Array<string>,
cb
cb: (
servingUrl: string,
file: { name: string },
files: string,
torrent: string,
subtitle: { name: string } | boolean
) => void
) {
if (this.inProgress) {
console.log('Torrent already in progress');
Expand Down Expand Up @@ -159,7 +165,8 @@ export default class Torrent {
file,
files,
torrent,
selectSubtitleFile(files, activeMode, metadata)
false
// selectSubtitleFile(files, activeMode, metadata)
);

this.clearIntervals();
Expand Down
35 changes: 29 additions & 6 deletions app/api/players/ChromecastPlayerProvider.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// @flow
import { Client, DefaultMediaReceiver } from 'castv2-client';
import mdns from 'mdns';
import network from 'network-address';
import type {
PlayerProviderInterface,
deviceType,
metadataType
metadataType,
subtitleType
} from './PlayerProviderInterface';

type castv2DeviceType = {
Expand Down Expand Up @@ -81,13 +83,28 @@ class ChromecastPlayerProvider implements PlayerProviderInterface {
return selectedDevice;
}

play(contentUrl: string, metadata: metadataType) {
play(
contentUrl: string,
metadata: metadataType,
subtitles: Array<subtitleType>
) {
const client = new Client();

if (!this.selectDevice) {
throw new Error('No device selected');
}

const networkAddress = network();
const tracks = subtitles.map((subtitle, index) => ({
trackId: index, // This is an unique ID, used to reference the track
type: 'TEXT', // Default Media Receiver currently only supports TEXT
trackContentId: subtitle.src.replace('localhost', networkAddress), // the URL of the VTT (enabled CORS and the correct ContentType are required)
trackContentType: 'text/vtt', // Currently only VTT is supported
name: subtitle.srclang, // a Name for humans
language: subtitle.srclang, // the language
subtype: 'SUBTITLES' // should be SUBTITLES
}));

return new Promise((resolve, reject) => {
client.connect(
this.selectedDevice.address,
Expand All @@ -101,6 +118,8 @@ class ChromecastPlayerProvider implements PlayerProviderInterface {
contentType: 'video/mp4',
streamType: 'BUFFERED', // or LIVE

tracks,

// Title and cover displayed while buffering
metadata: {
type: 0,
Expand All @@ -117,10 +136,14 @@ class ChromecastPlayerProvider implements PlayerProviderInterface {
}
};

player.load(media, { autoplay: true }, _err => {
if (_err) reject(_err);
resolve();
});
player.load(
media,
{ autoplay: true, activeTrackIds: tracks.map(e => e.trackId) },
_err => {
if (_err) reject(_err);
resolve();
}
);
});
}
);
Expand Down
13 changes: 2 additions & 11 deletions app/api/torrents/BaseTorrentProvider.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @flow
/* eslint prefer-template: 0 */
import cache from 'lru-cache';
import Cache from 'lru-cache';
import url from 'url';
import TheMovieDbMetadataProvider from '../metadata/TheMovieDbMetadataProvider';
import type { torrentType } from './TorrentProviderInterface';

export const providerCache = cache({
export const providerCache = new Cache({
maxAge: process.env.CONFIG_CACHE_TIMEOUT
? parseInt(process.env.CONFIG_CACHE_TIMEOUT, 10) * 1000 * 60 * 60
: 1000 * 60 * 60 // 1 hr
Expand Down Expand Up @@ -250,15 +250,6 @@ export async function convertTmdbToImdb(tmdbId: string): Promise<string> {
return movie.ids.imdbId;
}

// export async function convertImdbtoTmdb(imdbId: string): Promise<string> {
// const theMovieDbProvider = new TheMovieDbMetadataProvider();
// const movie = await theMovieDbProvider.getMovie(imdbId);
// if (!movie.ids.imdbId) {
// throw new Error('Cannot convert imdbId to tmdbId');
// }
// return movie.ids.imdbId;
// }

export function formatSeasonEpisodeToString(
season: number,
episode: number
Expand Down
35 changes: 35 additions & 0 deletions app/app.global.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Modules
//

@import "./styles/variables.scss";

//
// Bootstrap
// Core variables and mixins
// @TODO: Import only boootstrap that are used
//

@import "~bootstrap/scss/bootstrap.scss";
@import "~ionicons/dist/css/ionicons.min.css";
@import "~plyr/src/sass/plyr.scss";
@import "~notie/src/notie.scss";

//
// Components
//

@import "./styles/components/Movie.scss";
@import "./styles/components/CardList.scss";
@import "./styles/components/Rating.scss";
@import "./styles/components/Loader.scss";
@import "./styles/components/Item.scss";
@import "./styles/components/Show.scss";
@import "./styles/components/SaveItem.scss";
@import "./styles/components/Button.scss";

//
// Utilities
//

@import "./styles/utilities/container.scss";
Loading