Skip to content

Commit

Permalink
Merge pull request #2312 from popcorn-official/development
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriles90 committed Oct 11, 2021
2 parents 47c1b6c + 988f527 commit 59d5e20
Show file tree
Hide file tree
Showing 73 changed files with 2,318 additions and 1,719 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -17,9 +17,9 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 0

- name: Prepare NSIS
if: matrix.os == 'windows-latest'
Expand Down
7 changes: 2 additions & 5 deletions .jshintrc
Expand Up @@ -21,13 +21,12 @@
"quotmark" : "single",
"trailing" : true,
"sub" : true,
"trailing" : true,
"undef" : true,
"laxbreak" : true,
"loopfunc" : true,
"indent" : 4,
"newcap" : false,
"esversion" : 6,
"esversion" : 8,

// Globals
"globals": {
Expand Down Expand Up @@ -56,7 +55,7 @@
"inherits": true,
"Q": true,
"os": true,
"moment": true,
"dayjs": true,
"crypt": true,
"semver": true,
"fs": true,
Expand All @@ -75,7 +74,6 @@
"url": true,
"tls": true,
"http": true,
"request": true,
"querystring": true,
"URI": true,
"child": true,
Expand All @@ -91,7 +89,6 @@
"Backbone": true,
"Marionette": true,
"Mousetrap": true,
"_": true,
"request": true,
"videojs": true,
"vjs": true,
Expand Down
30 changes: 29 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,32 @@
## 0.4.5 - The next wave - 21 June 2021
## 0.4.6 - The Good Variant - 11 October 2021

New Features:
- Add Localization support
- Add multiple audio language support
- Add maximum Download/Upload speed options
- Add ability to minimize the native media player
- Add Source, Release Info and Parental Guide links for content where data exists
- Add a Magnet Link button in the loading screen
- Add a Rebuild bookmarks database function/button in the settings
- Add support for fetching the Genres list from the API
- Update WebTorrent to 1.5.5 also adding PE/MSE support

Bug Fixes:
- Fix issue with peers not being resolved when restarting canceled stream/download
- Fix wrong file selection on some instances where torrents contain multiple video files
- Fix issue where the subtitles and cover image weren't being downloaded when using the Download function
- Fix file/directory selection on Windows
- Remove non-working TVShow Time support since their API service has been terminated

Other:
- Optimize app closing time
- Settings page UI changes/updates
- Better unreachable API error message displaying all APIs tried
- Update torrent trackers
- Update various modules/dependencies
- Various other small fixes and optimizations

## 0.4.5 - The Next Wave - 21 June 2021

New Features:
- Update NWJS to 0.44.5 (https://github.com/nwjs/nw.js/blob/nw44/CHANGELOG.md)
Expand Down
26 changes: 12 additions & 14 deletions README.md
Expand Up @@ -36,19 +36,17 @@ Download and install:


### MacOS:
Easily install Popcorn Time via _[Homebrew](https://brew.sh) ([Cask](https://github.com/Homebrew/homebrew-cask#homebrew-cask)):_
* **Latest release**:
`brew tap popcorn-official/popcorn-desktop https://github.com/popcorn-official/popcorn-desktop.git`
`brew install --cask popcorn-time`
* Or **latest dev build (for testers)**:
`brew tap popcorn-official/popcorn-desktop https://github.com/popcorn-official/popcorn-desktop.git`
`brew install --cask popcorn-time-beta`

Easily install Popcorn Time via _[Homebrew](https://brew.sh) ([Cask](https://docs.brew.sh/Cask-Cookbook)):_
~~~ rb
brew tap popcorn-official/popcorn-desktop https://github.com/popcorn-official/popcorn-desktop.git
brew install --cask popcorn-time
~~~

Also, if you keep a [_Brewfile_](https://github.com/Homebrew/homebrew-bundle#usage), you can add something like this:
~~~ rb
repo = 'popcorn-official/popcorn-desktop'
repo = "popcorn-official/popcorn-desktop"
tap repo, "https://github.com/#{repo}.git"
cask 'popcorn-time'
cask "popcorn-time"
~~~

Update from _zip_ file:
Expand All @@ -68,17 +66,17 @@ Download and install:
Via archive and command line (tested on ubuntu 18.04 and 20.04):
1. Download Popcorn Time archive:
* For the **latest release**:
`wget -c https://get.popcorntime.app/repo/build/Popcorn-Time-0.4.5-linux64.zip`
`wget -c https://get.popcorntime.app/repo/build/Popcorn-Time-0.4.6-linux64.zip`
_if eventually you get issue with popcorntime.app website you can try to download from the github repo
`wget -c https://github.com/popcorn-official/popcorn-desktop/releases/download/v0.4.5/Popcorn-Time-0.4.5-linux64.zip`_
`wget -c https://github.com/popcorn-official/popcorn-desktop/releases/download/v0.4.6/Popcorn-Time-0.4.6-linux64.zip`_
* Or for the **latest dev build (for testers)**:
`wget -c https://ci.popcorntime.app/job/Popcorn-Time-Desktop/lastSuccessfulBuild/artifact/build/Popcorn-Time-0.4.5_linux64.zip -O Popcorn-Time-0.4.5-linux64.zip`
`wget -c https://ci.popcorntime.app/job/Popcorn-Time-Desktop/lastSuccessfulBuild/artifact/build/Popcorn-Time-0.4.6_linux64.zip -O Popcorn-Time-0.4.6-linux64.zip`
2. Create popcorn-time folder in /opt/:
`sudo mkdir /opt/popcorn-time`
3. Install unzip && dependencies (they should not be always required but some users needed them to make Popcorn Time working):
`sudo apt update && sudo apt install unzip libcanberra-gtk-module libgconf-2-4 libatomic1`
4. Extract the zip in /opt/popcorn-time:
`sudo unzip Popcorn-Time-0.4.5-linux64.zip -d /opt/popcorn-time`
`sudo unzip Popcorn-Time-0.4.6-linux64.zip -d /opt/popcorn-time`
5. Create symlink of Popcorn-Time in /usr/bin:
`sudo ln -sf /opt/popcorn-time/Popcorn-Time /usr/bin/popcorn-time`
6. Create .desktop file (so the launcher):
Expand Down
28 changes: 0 additions & 28 deletions casks/popcorn-time-beta.rb

This file was deleted.

57 changes: 42 additions & 15 deletions casks/popcorn-time.rb
@@ -1,27 +1,54 @@
cask "popcorn-time" do
version "0.4.5"
sha256 "045dbe37d06e24ed7129dddd922648caaba712dee24685fb3cb1f4782f03ead5"
version "0.4.6"
sha256 "cacf8ed13b427bceb481ba88ff97ff297f7e9e0487f1411f8d20ff87dd674ddb"

url "https://get.popcorntime.app/build/Popcorn-Time-#{version}.pkg"
appcast "https://github.com/popcorn-official/popcorn-desktop/releases.atom"
name "Popcorn Time"
desc "Watch movies and TV shows instantly"
homepage "https://popcorntime.app/"
server = "popcorn-ru.tk"
homepage = "http://#{server}"
zip = "Popcorn-Time-#{version}-Mac.zip"

url "#{homepage}/build/#{zip}"
name token.titlecase
desc "BitTorrent client that includes an integrated media player"
homepage homepage

livecheck do
url "#{homepage}/build"
strategy :page_match
regex Regexp.new zip.sub version, "([0-9]+(?:\\.[0-9]+)+)"
end

auto_updates true
conflicts_with cask: "popcorn-time-beta"

pkg "Popcorn-Time-#{version}.pkg"
app "Popcorn-Time.app"

app_support = "#{Dir.home}/Library/Application Support"

postflight do
require "securerandom"

db = "#{app_support}/Popcorn-Time/Default/data/settings.db"

%w[Movies Series].each do |medium|
setting = {
key: "custom#{medium}Server",
value: "https://#{server}/",
_id: SecureRandom.alphanumeric,
}
settings = File.read(db).lines

next if settings.grep(/#{setting[:key]}/).any?

`echo '#{setting.to_json}' >> '#{db}'`
end
end

bundle_id = "com.nw-builder.popcorn-time"
uninstall quit: bundle_id,
delete: "#{appdir}/Popcorn-Time.app"
uninstall quit: bundle_id = "com.nw-builder.popcorn-time"

zap trash: [
"#{app_support}/Popcorn-Time",
"~/Library/Preferences/#{bundle_id}.plist",
"~/Library/Application Support/Popcorn-Time",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/#{bundle_id}.sfl*",
"~/Library/Application Support/configstore/popcorn-time.json",
"#{app_support}/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/#{bundle_id}.sfl*",
"#{app_support}/configstore/popcorn-time.json",
"~/Library/Saved Application State/#{bundle_id}.savedState",
"~/Library/Caches/Popcorn-Time",
]
Expand Down
2 changes: 1 addition & 1 deletion dist/linux/exec_basefile.sh
Expand Up @@ -55,7 +55,7 @@ current="1: Copy files"
echo "
- Copying files to ~/.Butter"
mkdir -p "$HOME/.Butter"
cp -r locales node_modules src .git.json CHANGELOG.md icudtl.dat libffmpegsumo.so LICENSE.txt nw.pak package.nw package.json Butter README.md "$HOME/.Butter" &> /dev/null && error=0 || error=1
cp -r locales node_modules src git.json CHANGELOG.md icudtl.dat libffmpegsumo.so LICENSE.txt nw.pak package.nw package.json Butter README.md "$HOME/.Butter" &> /dev/null && error=0 || error=1

#move icon
mkdir -p "$HOME/.local/share/icons"
Expand Down
2 changes: 1 addition & 1 deletion dist/windows/updater_makensis.nsi
Expand Up @@ -348,7 +348,7 @@ Section
File "..\..\package.json"
File "..\..\build\${APP_NAME}\${ARCH}\${APP_LAUNCHER}"
File "..\..\CHANGELOG.md"
File /nonfatal "..\..\.git.json"
File /nonfatal "..\..\git.json"

;Set output path to InstallDir
SetOutPath "\\?\$INSTDIR\node_modules"
Expand Down
2 changes: 1 addition & 1 deletion dist/windows/updater_package.sh
Expand Up @@ -27,7 +27,7 @@ if [ "${POP_NEW_NW}" = "TRUE" ]; then
fi

cp "${basedir}/package.json" "${outdir}"
cp "${basedir}/.git.json" "${outdir}"
cp "${basedir}/git.json" "${outdir}"

cd ${outdir}
vers=$(sed -n "s|\s*\"version\"\:\ \"\(.*\)\"\,|\1|p" "${basedir}/package.json")
Expand Down
35 changes: 22 additions & 13 deletions gulpfile.js
Expand Up @@ -19,7 +19,7 @@ const gulp = require('gulp'),
currentPlatform = require('nw-builder/lib/detectCurrentPlatform.js'),
yargs = require('yargs'),
nib = require('nib'),
git = require('git-rev'),
git = require('git-describe'),
zip = require('gulp-zip'),
fs = require('fs'),
path = require('path'),
Expand Down Expand Up @@ -95,6 +95,15 @@ const parseReqDeps = () => {
});
};

const curVersion = () => {
if (fs.existsSync('./git.json')) {
const gitData = require('./git.json');
return gitData.semver;
} else {
return pkJson.version;
}
};

// console.log for thenable promises
const log = () => {
console.log.apply(console, arguments);
Expand Down Expand Up @@ -245,7 +254,7 @@ gulp.task('compresszip', () => {
return gulp
.src(sources + '/**')
.pipe(
zip(pkJson.name + '-' + pkJson.version + '_' + platform + '.zip')
zip(pkJson.name + '-' + curVersion() + '_' + platform + '.zip')
)
.pipe(gulp.dest(releasesDir))
.on('end', () => {
Expand Down Expand Up @@ -275,7 +284,7 @@ gulp.task('compressUpdater', () => {
console.log('Packaging updater for: %s', platform);
return gulp
.src(path.join('build', updateFile))
.pipe(zip('update-' + pkJson.version + '_' + platform + '.zip'))
.pipe(zip('update-' + curVersion() + '_' + platform + '.zip'))
.pipe(gulp.dest(releasesDir))
.on('end', () => {
console.log(
Expand Down Expand Up @@ -418,7 +427,7 @@ gulp.task('nwjs', () => {
'./README.md',
'./CHANGELOG.md',
'./LICENSE.txt',
'./.git.json'
'./git.json'
];
// add node_modules
nw.options.files = nw.options.files.concat(requiredDeps);
Expand All @@ -444,17 +453,17 @@ gulp.task('nwjs', () => {
});
});

// create .git.json (used in 'About')
// create git.json (used in 'About')
gulp.task('injectgit', () => {
return Promise.all([promiseCallback(git.branch), promiseCallback(git.long)])
return git.gitDescribe()
.then(
(gitInfo) =>
new Promise((resolve, reject) => {
fs.writeFile(
'.git.json',
'git.json',
JSON.stringify({
branch: gitInfo[0],
commit: gitInfo[1]
commit: gitInfo.hash.substr(1),
semver: gitInfo.semverString,
}),
(error) => {
return error ? reject(error) : resolve(gitInfo);
Expand All @@ -463,8 +472,8 @@ gulp.task('injectgit', () => {
})
)
.then((gitInfo) => {
console.log('Branch:', gitInfo[0]);
console.log('Commit:', gitInfo[1].substr(0, 8));
console.log('Hash:', gitInfo.hash.substr(1));
console.log('Raw:', gitInfo.raw);
})
.catch((error) => {
console.log(error);
Expand Down Expand Up @@ -572,7 +581,7 @@ gulp.task('deb', () => {
nwVersion,
platform,
pkJson.name,
pkJson.version,
curVersion(),
releasesDir
]);

Expand Down Expand Up @@ -686,7 +695,7 @@ gulp.task('prepareUpdater:win', () => {
)
.pipe(gulpRename('update.exe'))
.pipe(gulp.dest(path.join(process.cwd(), releasesDir)))
.pipe(zip('update-' + pkJson.version + '_' + platform + '.zip'))
.pipe(zip('update-' + curVersion() + '_' + platform + '.zip'))
.pipe(gulp.dest(releasesDir))
.on('end', () => {
console.log(
Expand Down

0 comments on commit 59d5e20

Please sign in to comment.