Skip to content

Commit

Permalink
Was a Hell of a Ride
Browse files Browse the repository at this point in the history
  • Loading branch information
gpt-modules committed Mar 14, 2014
0 parents commit 7e4d851
Show file tree
Hide file tree
Showing 161 changed files with 31,791 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

.idea/

node_modules/

build/

pids
logs
results

npm-debug.log

app.nw

.sass-cache
*-ck.js
*.srt
*.DS_Store

js/vendor/config.js
dist/windows/Install Popcorn Time.exe
dist/mac/Popcorn Time.app/
dist/mac/Popcorn Time.zip


# vim swap files
*.swp
3 changes: 3 additions & 0 deletions Config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
relative_assets = true
css_dir = 'css'
line_comments = false
85 changes: 85 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
module.exports = function(grunt) {
var buildPlatforms = parseBuildPlatforms(grunt.option('platforms'));

grunt.initConfig({
compass: {
dist: {
files: {
'css/app.css': 'sass/app.scss'
}
}
},
watch: {
files: ['sass/**/*.scss'],
tasks: ['sass'],
options: {
livereload: true
}
},
nodewebkit: {
options: {
version: '0.9.2',
build_dir: './build', // Where the build version of my node-webkit app is saved
mac_icns: './images/popcorntime.icns', // Path to the Mac icon file
mac: buildPlatforms.mac,
win: buildPlatforms.win,
linux32: buildPlatforms.linux32,
linux64: buildPlatforms.linux64
},
src: ['./css/**', './fonts/**', './images/**', './js/**', './language/**', './node_modules/**', '!./node_modules/grunt*/**', './rc/**', './Config.rb', './index.html', './package.json', './README.md' ] // Your node-webkit app './**/*'
},
copy: {
main: {
files: [
{
src: 'libraries/win/ffmpegsumo.dll',
dest: 'build/releases/Popcorn-Time/win/Popcorn-Time/ffmpegsumo.dll',
flatten: true
},
{
src: 'libraries/mac/ffmpegsumo.so',
dest: 'build/releases/Popcorn-Time/mac/Popcorn-Time.app/Contents/Frameworks/node-webkit Framework.framework/Libraries/ffmpegsumo.so',
flatten: true
},
{
src: 'libraries/linux64/libffmpegsumo.so',
dest: 'build/releases/Popcorn-Time/linux64/Popcorn-Time/libffmpegsumo.so',
flatten: true
}
]
}
}
});

grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-node-webkit-builder');

grunt.registerTask('css', ['compass']);
grunt.registerTask('default', ['compass']);
grunt.registerTask('nodewkbuild', ['nodewebkit', 'copy']);


};

var parseBuildPlatforms = function(argumentPlatform) {
// this will make it build no platform when the platform option is specified
// without a value which makes argumentPlatform into a boolean
var inputPlatforms = argumentPlatform || process.platform + ";" + process.arch;

// Do some scrubbing to make it easier to match in the regexes bellow
inputPlatforms = inputPlatforms.replace("darwin", "mac");
inputPlatforms = inputPlatforms.replace(/;ia|;x|;arm/, "");

var buildAll = /^all$/.test(inputPlatforms);

var buildPlatforms = {
mac: /mac/.test(inputPlatforms) || buildAll,
win: /win/.test(inputPlatforms) || buildAll,
linux32: /linux32/.test(inputPlatforms) || buildAll,
linux64: /linux64/.test(inputPlatforms) || buildAll
};

return buildPlatforms;
}
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#Popcorn time [![Dependency Status](https://david-dm.org/popcorn-time/popcorn-app.png?theme=shields.io)](https://david-dm.org/popcorn-time/popcorn-time)

## Idea

To allow any computer user to watch movies easily streaming from torrents, without any particular knowledge.

![Demo Screenshot](http://getpopcornti.me/images/how-ui.png)

### Status

Under development (RC1) for Mac OSX - Windows - Linux.

### APIs

**Currently used:**
- ~~[RottenTomatoes](http://developer.rottentomatoes.com) for movies metadata.~~
- ~~[PirateBay](http://thepiratebay.se/browse/207/0/7/0) Recent popular movies list.~~
- [YIFY](http://yts.re/api) movie torrents API.
- [OpenSubtitles](http://trac.opensubtitles.org/projects/opensubtitles/wiki/XMLRPC) for subtitles
- [TheMovieDB](http://www.themoviedb.org/) for movies metadata.

**In discussion:**
- [SubtitleSeeker](http://www.api.subtitleseeker.com/About/Api-Search/) for subtitles.


## Building

### Dependencies

You will need nodejs and grunt:

$ npm install -g grunt-cli

### Build

Install the node modules:

$ npm install

Build with:

$ grunt nodewkbuild

By default it will build for your current platform however you can control that
by specifying a comma separated list of platforms in the `platforms` option to
grunt:

$ grunt nodewkbuild --platforms=linux32,linux64,mac,win

You can also build for all platforms with:

$ grunt nodewkbuild --platforms=all

## Any problem?

### Regarding superagent dependency
Due to [wrong browser verification](https://github.com/visionmedia/superagent/issues/95) on a dependency, this hard fix must be applied.
Replace `node_modules/moviedb/node_modules/superagent/index.js` contents with:
```javascript
// if (typeof window != 'undefined') {
// module.exports = require('./lib/superagent');
// } else if (process.env.SUPERAGENT_COV) {
// module.exports = require('./lib-cov/node');
// } else {
module.exports = require('./lib/node');
// }
```

### Regarding Video, MP4 H264 Playback
- Info: https://github.com/rogerwang/node-webkit/wiki/Support-mp3-and-h264-in-video-and-audio-tag
- Needed to build a custom build of node-webkit that adds h264 support (or you can download ready-to-go builds from https://file.ac/s4Lt3Vo6rls/)
- Alternatively, we can replace a .so and .dll file from the correspondent Chrome build to node-webkit and node-webkit.exe


## Development
- Run `compass watch` in Terminal for CSS compiling and listen to future changes.
- [How to build with SublimeText](https://github.com/rogerwang/node-webkit/wiki/Debugging-with-Sublime-Text-2-and-3)
- Currently Gaze to watch all files and reload the app is disabled due to memory leaks and unstability.
- Run node-webkit from the root directory with --debug to enable debugging mode like so ```node-webkit . --debug```
47 changes: 47 additions & 0 deletions css/animations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@-webkit-keyframes sidebareffect {
/* line 2, ../sass/animations.scss */
from {
-webkit-transform: translate(220px, 0);
}

/* line 3, ../sass/animations.scss */
to {
-webkit-transform: translate(0, 0);
}
}

@-webkit-keyframes sidebareffect2 {
/* line 7, ../sass/animations.scss */
from {
-webkit-transform: translate(0, 0);
}

/* line 8, ../sass/animations.scss */
to {
-webkit-transform: translate(220px, 0);
}
}

@-webkit-keyframes spin {
/* line 12, ../sass/animations.scss */
from {
-webkit-transform: rotate(0deg);
}

/* line 13, ../sass/animations.scss */
to {
-webkit-transform: rotate(360deg);
}
}

@-webkit-keyframes backdropFadeIn {
/* line 17, ../sass/animations.scss */
from {
opacity: 0;
}

/* line 18, ../sass/animations.scss */
to {
opacity: 0.2;
}
}
Loading

0 comments on commit 7e4d851

Please sign in to comment.