mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 00:31:33 +10:00
Compare commits
3 Commits
dbf9c8e8e5
...
v0.3.0-rc-
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dedf39420 | |||
| 79373cb0c1 | |||
| f264600619 |
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@ -22,9 +22,9 @@ jobs:
|
|||||||
args: '--target aarch64-apple-darwin'
|
args: '--target aarch64-apple-darwin'
|
||||||
- platform: 'macos-latest' # for Intel based macs.
|
- platform: 'macos-latest' # for Intel based macs.
|
||||||
args: '--target x86_64-apple-darwin'
|
args: '--target x86_64-apple-darwin'
|
||||||
- platform: 'ubuntu-24.04' # for Tauri v1 you could replace this with ubuntu-20.04.
|
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
|
||||||
args: ''
|
args: ''
|
||||||
- platform: 'ubuntu-24.04-arm'
|
- platform: 'ubuntu-22.04-arm'
|
||||||
args: '--target aarch64-unknown-linux-gnu'
|
args: '--target aarch64-unknown-linux-gnu'
|
||||||
- platform: 'windows-latest'
|
- platform: 'windows-latest'
|
||||||
args: ''
|
args: ''
|
||||||
@ -48,12 +48,11 @@ jobs:
|
|||||||
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||||
|
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-24.04' # This must match the platform value defined above.
|
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-22.04-arm' # This must match the platform value defined above.
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||||
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
|
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
|
||||||
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
|
|
||||||
|
|
||||||
- name: install frontend dependencies
|
- name: install frontend dependencies
|
||||||
run: yarn install # change this to npm, pnpm or bun depending on which one you use.
|
run: yarn install # change this to npm, pnpm or bun depending on which one you use.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "drop-app",
|
"name": "drop-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.3.0-rc-6",
|
"version": "0.3.0-rc-7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
|
|||||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -1247,7 +1247,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "drop-app"
|
name = "drop-app"
|
||||||
version = "0.3.0-rc-6"
|
version = "0.3.0-rc-7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomic-instant-full",
|
"atomic-instant-full",
|
||||||
"boxcar",
|
"boxcar",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "drop-app"
|
name = "drop-app"
|
||||||
version = "0.3.0-rc-6"
|
version = "0.3.0-rc-7"
|
||||||
description = "The client application for the open-source, self-hosted game distribution platform Drop"
|
description = "The client application for the open-source, self-hosted game distribution platform Drop"
|
||||||
authors = ["Drop OSS"]
|
authors = ["Drop OSS"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@ -18,6 +18,7 @@ pub enum RemoteAccessError {
|
|||||||
HandshakeFailed(String),
|
HandshakeFailed(String),
|
||||||
GameNotFound(String),
|
GameNotFound(String),
|
||||||
InvalidResponse(DropServerError),
|
InvalidResponse(DropServerError),
|
||||||
|
UnparseableResponse(String),
|
||||||
ManifestDownloadFailed(StatusCode, String),
|
ManifestDownloadFailed(StatusCode, String),
|
||||||
OutOfSync,
|
OutOfSync,
|
||||||
Cache(cacache::Error),
|
Cache(cacache::Error),
|
||||||
@ -48,7 +49,8 @@ impl Display for RemoteAccessError {
|
|||||||
RemoteAccessError::InvalidEndpoint => write!(f, "invalid drop endpoint"),
|
RemoteAccessError::InvalidEndpoint => write!(f, "invalid drop endpoint"),
|
||||||
RemoteAccessError::HandshakeFailed(message) => write!(f, "failed to complete handshake: {message}"),
|
RemoteAccessError::HandshakeFailed(message) => write!(f, "failed to complete handshake: {message}"),
|
||||||
RemoteAccessError::GameNotFound(id) => write!(f, "could not find game on server: {id}"),
|
RemoteAccessError::GameNotFound(id) => write!(f, "could not find game on server: {id}"),
|
||||||
RemoteAccessError::InvalidResponse(error) => write!(f, "server returned an invalid response: {} {}", error.status_code, error.status_message),
|
RemoteAccessError::InvalidResponse(error) => write!(f, "server returned an invalid response: {}, {}", error.status_code, error.status_message),
|
||||||
|
RemoteAccessError::UnparseableResponse(error) => write!(f, "server returned an invalid response: {error}"),
|
||||||
RemoteAccessError::ManifestDownloadFailed(status, response) => write!(
|
RemoteAccessError::ManifestDownloadFailed(status, response) => write!(
|
||||||
f,
|
f,
|
||||||
"failed to download game manifest: {status} {response}"
|
"failed to download game manifest: {status} {response}"
|
||||||
|
|||||||
@ -313,18 +313,9 @@ impl GameDownloadAgent {
|
|||||||
match download_game_chunk(context, &self.control_flag, progress_handle, request)
|
match download_game_chunk(context, &self.control_flag, progress_handle, request)
|
||||||
{
|
{
|
||||||
Ok(true) => {
|
Ok(true) => {
|
||||||
debug!(
|
|
||||||
"Finished context #{} with checksum {}",
|
|
||||||
index, context.checksum
|
|
||||||
);
|
|
||||||
completed_indexes.push(context.checksum.clone());
|
completed_indexes.push(context.checksum.clone());
|
||||||
}
|
}
|
||||||
Ok(false) => {
|
Ok(false) => {}
|
||||||
debug!(
|
|
||||||
"Didn't finish context #{} with checksum {}",
|
|
||||||
index, context.checksum
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("{e}");
|
error!("{e}");
|
||||||
sender.send(DownloadManagerSignal::Error(e)).unwrap();
|
sender.send(DownloadManagerSignal::Error(e)).unwrap();
|
||||||
@ -350,10 +341,7 @@ impl GameDownloadAgent {
|
|||||||
.map(|x| {
|
.map(|x| {
|
||||||
(
|
(
|
||||||
x.checksum.clone(),
|
x.checksum.clone(),
|
||||||
context_map_lock
|
context_map_lock.get(&x.checksum).cloned().unwrap_or(false),
|
||||||
.get(&x.checksum)
|
|
||||||
.cloned()
|
|
||||||
.unwrap_or(false),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect::<Vec<(String, bool)>>();
|
.collect::<Vec<(String, bool)>>();
|
||||||
|
|||||||
@ -3,6 +3,7 @@ use crate::download_manager::util::download_thread_control_flag::{
|
|||||||
};
|
};
|
||||||
use crate::download_manager::util::progress_object::ProgressHandle;
|
use crate::download_manager::util::progress_object::ProgressHandle;
|
||||||
use crate::error::application_download_error::ApplicationDownloadError;
|
use crate::error::application_download_error::ApplicationDownloadError;
|
||||||
|
use crate::error::drop_server_error::DropServerError;
|
||||||
use crate::error::remote_access_error::RemoteAccessError;
|
use crate::error::remote_access_error::RemoteAccessError;
|
||||||
use crate::games::downloads::manifest::DropDownloadContext;
|
use crate::games::downloads::manifest::DropDownloadContext;
|
||||||
use crate::remote::auth::generate_authorization_header;
|
use crate::remote::auth::generate_authorization_header;
|
||||||
@ -40,11 +41,9 @@ impl DropWriter<File> {
|
|||||||
// Write automatically pushes to file and hasher
|
// Write automatically pushes to file and hasher
|
||||||
impl Write for DropWriter<File> {
|
impl Write for DropWriter<File> {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
self.hasher.write_all(buf).map_err(|e| {
|
self.hasher
|
||||||
io::Error::other(
|
.write_all(buf)
|
||||||
format!("Unable to write to hasher: {e}"),
|
.map_err(|e| io::Error::other(format!("Unable to write to hasher: {e}")))?;
|
||||||
)
|
|
||||||
})?;
|
|
||||||
self.destination.write(buf)
|
self.destination.write(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,17 +133,11 @@ pub fn download_game_chunk(
|
|||||||
progress: ProgressHandle,
|
progress: ProgressHandle,
|
||||||
request: RequestBuilder,
|
request: RequestBuilder,
|
||||||
) -> Result<bool, ApplicationDownloadError> {
|
) -> Result<bool, ApplicationDownloadError> {
|
||||||
debug!(
|
|
||||||
"Starting download chunk {}, {}, {} #{}",
|
|
||||||
ctx.file_name, ctx.index, ctx.offset, ctx.checksum
|
|
||||||
);
|
|
||||||
// If we're paused
|
// If we're paused
|
||||||
if control_flag.get() == DownloadThreadControlFlag::Stop {
|
if control_flag.get() == DownloadThreadControlFlag::Stop {
|
||||||
progress.set(0);
|
progress.set(0);
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
let request = request.header("Authorization", generate_authorization_header());
|
|
||||||
|
|
||||||
let response = request
|
let response = request
|
||||||
.header("Authorization", generate_authorization_header())
|
.header("Authorization", generate_authorization_header())
|
||||||
.send()
|
.send()
|
||||||
@ -152,10 +145,15 @@ pub fn download_game_chunk(
|
|||||||
|
|
||||||
if response.status() != 200 {
|
if response.status() != 200 {
|
||||||
debug!("chunk request got status code: {}", response.status());
|
debug!("chunk request got status code: {}", response.status());
|
||||||
let err = response.json().unwrap();
|
let raw_res = response.text().unwrap();
|
||||||
|
if let Ok(err) = serde_json::from_str::<DropServerError>(&raw_res) {
|
||||||
return Err(ApplicationDownloadError::Communication(
|
return Err(ApplicationDownloadError::Communication(
|
||||||
RemoteAccessError::InvalidResponse(err),
|
RemoteAccessError::InvalidResponse(err),
|
||||||
));
|
));
|
||||||
|
};
|
||||||
|
return Err(ApplicationDownloadError::Communication(
|
||||||
|
RemoteAccessError::UnparseableResponse(raw_res),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut destination = DropWriter::new(ctx.path.clone());
|
let mut destination = DropWriter::new(ctx.path.clone());
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2.0.0",
|
"$schema": "https://schema.tauri.app/config/2.0.0",
|
||||||
"productName": "Drop Desktop Client",
|
"productName": "Drop Desktop Client",
|
||||||
"version": "0.3.0-rc-6",
|
"version": "0.3.0-rc-7",
|
||||||
"identifier": "dev.drop.app",
|
"identifier": "dev.drop.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "yarn dev --port 1432",
|
"beforeDevCommand": "yarn dev --port 1432",
|
||||||
|
|||||||
Reference in New Issue
Block a user