Skip to content

Commit

Permalink
Merge pull request #9 from Rhymlore/fix-downloads-component
Browse files Browse the repository at this point in the history
Improved Fetching Releases
  • Loading branch information
CannonLock authored Mar 21, 2024
2 parents e0d203c + 8b5ac99 commit 90d0ac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions utils/fetchReleases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ async function fetchFilteredReleases(): Promise<FilteredRelease[]> {
let filteredReleases: FilteredRelease[] = [];

for (const release of sortedReleases) {
// Ignore the release if it's a prerelease
if (release.prerelease) {
continue;
}

const [major, minor] = release.tag_name.replace('v', '').split('.').map(Number);
const majorVersion = `${major}.${minor}`;

Expand All @@ -20,6 +25,7 @@ async function fetchFilteredReleases(): Promise<FilteredRelease[]> {

filteredReleases.push({
version: release.tag_name,
prerelease: release.prerelease,
assets: release.assets.map(asset => {
const packageInfo = asset.name.includes('osdf') ?
'osdf' :
Expand Down
2 changes: 2 additions & 0 deletions utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ id: number;
}

export interface Release {
prerelease: boolean;
assets: Asset[];
tag_name: string; // To determine the version of the release.
name: string;
Expand All @@ -33,6 +34,7 @@ name: string;
export type FilteredRelease = {
version: string;
assets: FilteredAsset[];
prerelease: boolean;
}

export type FilteredAsset = {
Expand Down

0 comments on commit 90d0ac7

Please sign in to comment.