Implemented !2 merge request (resume download)

This commit is contained in:
Observer KRypt0n_ 2021-11-27 23:13:27 +02:00
parent 16b31136d7
commit 698072b3cd
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
6 changed files with 18 additions and 19 deletions

View file

@ -1,8 +0,0 @@
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml

View file

@ -2,7 +2,7 @@
"Install": "インストール",
"Update": "アップデート",
"Launch": "打ち上げ",
"ResumeDownload": "Resume Download",
"ResumeDownload": "履歴書のダウンロード",
"Runners": "Runners",
"Language": "言語",
"Voice": "ボイスパック",

View file

@ -2,7 +2,7 @@
"Install": "설치",
"Update": "업데이트",
"Launch": "발사",
"ResumeDownload": "Resume Download",
"ResumeDownload": "이력서 다운로드",
"Runners": "주자",
"Language": "언어",
"Voice": "음성 팩",

View file

@ -2,7 +2,7 @@
"Install": "Установить",
"Update": "Обновить",
"Launch": "Запустить",
"ResumeDownload": "Resume Download",
"ResumeDownload": "Продолжить загрузку",
"Runners": "Версии Wine",
"Language": "Язык",
"Voice": "Озвучка",

View file

@ -17,7 +17,7 @@ type LauncherState =
'game-update-available' |
'game-installation-available' |
'game-voice-update-required' |
'download-resumable' |
'resume-download-available' |
'game-launch-available';
type Theme = 'light' | 'dark';
@ -102,8 +102,11 @@ export default class LauncherUI
$('#launch').text(this.i18n.translate('Launch'));
break;
case 'download-resumable':
case 'resume-download-available':
$('#launch').text(this.i18n.translate('ResumeDownload'));
break;
}
this._launcherState = state;
@ -115,10 +118,15 @@ export default class LauncherUI
const patchInfo = await LauncherLib.getPatchInfo();
// Update available
if (LauncherLib.version != gameData.game.latest.version) {
if(!fs.existsSync(path.join(constants.launcherDir, `latest-${gameData.game.latest.version}.zip`)))
if (LauncherLib.version != gameData.game.latest.version)
{
// If we already started downloading - then resume it
// Otherwise begin new downloading process
if (!fs.existsSync(path.join(constants.launcherDir, `latest-${gameData.game.latest.version}.zip`)))
this.setState(LauncherLib.version === null ? 'game-installation-available' : 'game-update-available');
else this.setState('download-resumable');
else this.setState('resume-download-available');
}
// Voice pack update required

View file

@ -128,10 +128,9 @@ export default class Tools
return new Promise((resolve, reject) => {
let rangeStart = 0;
if(fs.existsSync(savePath)) {
// Part of the file was already downloaded, resume the download
// Part of the file was already downloaded, resume the download
if (fs.existsSync(savePath))
rangeStart = fs.statSync(savePath).size;
}
https.get(uri, {
headers: {