Skip to content

Commit

Permalink
v1.3.0 (#555)
Browse files Browse the repository at this point in the history
* Add @amilajack/react-plyr for caption support

* Add initial support for subtitles

* bump g++ version (#418)

* chore(deps): update dependency concurrently to v4.0.1

* chore(deps): update dependency electron-builder to ^20.36.2

* chore(deps): update dependency eslint-config-prettier to ^3.3.0

* chore(deps): update dependency eslint-plugin-promise to v4.0.1

* chore(deps): update dependency testcafe to ^0.23.2

* chore(deps): update dependency url-loader to v1.1.2

* fix(deps): update dependency @amilajack/react-plyr to ^2.1.2

* fix(deps): update dependency vlc-command to v1.1.2

* fix(deps): update dependency react-router-redux to v5.0.0-alpha.8

* fix(deps): update dependency yargs to v12.0.4

* fix(deps): update react monorepo to v16.6.3

* fix(deps): update dependency electron-window-state to v5 (#443)

* chore(deps): update dependency why-did-you-update to v1 (#442)

* chore(deps): update dependency spectron to v5 (#439)

* chore(deps): update dependency sinon to v7 (#438)

* chore(deps): update dependency lint-staged to v8 (#437)

* chore(deps): update dependency husky to v1 (#435)

* chore(deps): update dependency fbjs-scripts to v1 (#434)

* chore(deps): update dependency eslint-plugin-jest to v22 (#433)

* chore(deps): update dependency concurrently to v4.1.0

* chore(deps): update dependency detect-port to ^1.3.0

* chore(deps): update dependency electron to v2.0.14

* chore(deps): update dependency husky to ^1.2.0

* chore(deps): update dependency lint-staged to ^8.1.0

* chore(deps): update dependency lru-cache to v4.1.4

* fix(deps): update dependency yargs to v12.0.5

* chore(deps): update dependency eslint-plugin-jest to v22.1.0

* chore(deps): update dependency flow-bin to ^0.87.0

* chore(deps): update dependency lru-cache to v4.1.5

* chore(deps): update dependency prettier to ^1.15.3

* chore(deps): update dependency stylelint to ^9.9.0

* chore(deps): update dependency testcafe-react-selectors to ^3.0.2

* fix(deps): update dependency electron-window-state to ^5.0.3

* fix(deps): update dependency popper.js to ^1.14.6

* chore(deps): update dependency autoprefixer to ^9.4.2

* chore(deps): update dependency dotenv to v6.2.0

* chore(deps): update dependency enzyme-to-json to ^3.3.5

* chore(deps): update dependency eslint-plugin-jest to v22.1.2

* chore(deps): update dependency eslint to ^5.10.0

* chore(deps): update dependency electron-builder to ^20.38.3

* chore(deps): update dependency electron to v2.0.15

* chore(deps): update dependency enzyme to ^3.8.0

* chore(deps): update dependency flow-bin to ^0.89.0

* chore(deps): update dependency husky to ^1.2.1

* chore(deps): update dependency node-sass to v4.11.0

* chore(deps): update dependency sinon to ^7.2.2

* chore(deps): update dependency testcafe-browser-provider-electron to ^0.0.7

* chore(deps): update dependency webpack-merge to v4.1.5

* fix(deps): update dependency react-hot-loader to v4.6.0

* fix(deps): update dependency react-transition-group to ^2.5.1

* chore(deps): update dependency autoprefixer to ^9.4.3

* chore(deps): update dependency electron to v2.0.16

* chore(deps): update dependency testcafe to ^0.23.3

* chore(deps): update dependency electron-builder to ^20.38.4

* chore(deps): update dependency webpack-dev-server to ^3.1.11

* chore(deps): update dependency testcafe-browser-provider-electron to ^0.0.8

* fix(deps): update dependency bootstrap to v4.2.1

* fix(deps): update dependency get-port to ^4.1.0

* fix(deps): update dependency react-hot-loader to v4.6.3

* fix(deps): update dependency react-transition-group to ^2.5.2

* fix(deps): update react monorepo to v16.7.0

* chore(deps): update dependency webpack-dev-server to ^3.1.12

* chore(deps): update dependency webpack-dev-server to ^3.1.13

* chore(deps): update dependency husky to ^1.3.1

* chore(deps): update dependency webpack-dev-server to ^3.1.14

* chore(deps): update dependency eslint-plugin-react to ^7.12.1

* chore(deps): update dependency eslint to ^5.12.0

* chore(deps): update dependency autoprefixer to ^9.4.4

* chore(deps): update dependency eslint-plugin-react to ^7.12.3

* chore(deps): update dependency webpack-merge to v4.2.1

* chore(deps): update dependency chalk to ^2.4.2

* chore(deps): update dependency webpack-cli to ^3.2.1

* chore(deps): update dependency webpack-dev-middleware to ^3.5.0

* chore(deps): update dependency eslint-plugin-jest to v22.1.3

* chore(deps): update dependency flow-bin to ^0.90.0

* chore(deps): update dependency autoprefixer to ^9.4.5

* chore(deps): update dependency babel-plugin-flow-runtime to v0.18.0

* chore(deps): update dependency electron-builder to ^20.38.5

* chore(deps): update dependency eslint to ^5.12.1

* chore(deps): update dependency eslint-config-prettier to ^3.5.0

* chore(deps): update dependency eslint-plugin-react to ^7.12.4

* chore(deps): update dependency flow-bin to ^0.91.0

* chore(deps): update dependency node-libs-browser to v2.2.0

* chore(deps): update dependency stylelint to ^9.10.0

* chore(deps): update dependency testcafe-react-selectors to ^3.0.3

* chore(deps): update dependency webpack-dev-middleware to ^3.5.1

* fix(deps): update dependency react-transition-group to ^2.5.3

* chore(deps): update dependency stylelint to ^9.10.1

* chore(deps): update dependency eslint-config-prettier to ^3.6.0

* chore(deps): update dependency autoprefixer to ^9.4.7

* chore(deps): update dependency electron to v2.0.17

* chore(deps): update dependency sinon to ^7.2.6

* chore(deps): update dependency autoprefixer to ^9.4.9

* chore(deps): update dependency source-map-support to ^0.5.10

* chore(deps): update dependency electron-rebuild to ^1.8.4

* fix movie images issues

* fix(deps): update dependency bootstrap to v4.3.1 [security]

* update webpack renderer dev config

* fix bug causing item page to not open

* add auto update support
  • Loading branch information
amilajack authored Apr 3, 2019
1 parent a832a73 commit 88f8448
Show file tree
Hide file tree
Showing 50 changed files with 6,813 additions and 6,548 deletions.
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

0 comments on commit 88f8448

Please sign in to comment.