mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-08 00:58:04 +03:00
Implemented !2 merge request (resume download)
This commit is contained in:
parent
16b31136d7
commit
698072b3cd
6 changed files with 18 additions and 19 deletions
|
@ -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
|
|
@ -2,7 +2,7 @@
|
|||
"Install": "インストール",
|
||||
"Update": "アップデート",
|
||||
"Launch": "打ち上げ",
|
||||
"ResumeDownload": "Resume Download",
|
||||
"ResumeDownload": "履歴書のダウンロード",
|
||||
"Runners": "Runners",
|
||||
"Language": "言語",
|
||||
"Voice": "ボイスパック",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"Install": "설치",
|
||||
"Update": "업데이트",
|
||||
"Launch": "발사",
|
||||
"ResumeDownload": "Resume Download",
|
||||
"ResumeDownload": "이력서 다운로드",
|
||||
"Runners": "주자",
|
||||
"Language": "언어",
|
||||
"Voice": "음성 팩",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"Install": "Установить",
|
||||
"Update": "Обновить",
|
||||
"Launch": "Запустить",
|
||||
"ResumeDownload": "Resume Download",
|
||||
"ResumeDownload": "Продолжить загрузку",
|
||||
"Runners": "Версии Wine",
|
||||
"Language": "Язык",
|
||||
"Voice": "Озвучка",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Add table
Reference in a new issue