Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Return a dummy download hash for Godot editor API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Dec 27, 2019
1 parent 992d1f8 commit 8ac10f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 13 additions & 0 deletions app/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class Asset extends Model
protected $appends = [
'category',
'tags',
'download_hash',
'download_url',
'godot_version',
'icon_url',
Expand Down Expand Up @@ -392,6 +393,18 @@ public function setBrowseUrlAttribute(string $browseUrl): void
}
}

/**
* Placeholder to make the Godot editor accept the download hash but not verify it.
*
* TODO: Consider computing the download hash on a per-version basis and store it.
* However, this may not be a good idea as GitHub ZIP hashes aren't guaranteed
* to be the same over a long period of time.
*/
public function getDownloadHashAttribute(): string
{
return '';
}

/**
* Return the download URL corresponding to the latest version
* (for compatibility with the existing API).
Expand Down
12 changes: 9 additions & 3 deletions public/developer/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,22 @@ components:
format: url
description: >
The asset's changelog URL.
donate_url:
download_hash:
type: string
format: url
default: ''
description: >
The asset's donation URL. This can be set by the author to receive donations (using services like Patreon or GitHub Sponsors).
The asset's SHA-256 hash for the latest version.
**Note:** This is currently always an empty string as asset versions' hashes aren't computed and stored yet.
cost:
type: string
description: >
The asset's license as a [SPDX license identifier](https://spdx.org/licenses/).
For compatibility reasons, this field is called `cost` instead of `license`.
donate_url:
type: string
format: url
description: >
The asset's donation URL. This can be set by the author to receive donations (using services like Patreon or GitHub Sponsors).
godot_version:
type: string
description: >
Expand Down

0 comments on commit 8ac10f9

Please sign in to comment.