Skip to content

Commit 72c32af

Browse files
fix: change lastUpdated logic and swap featured property to official (#10)
1 parent 146d85c commit 72c32af

6 files changed

Lines changed: 28 additions & 7 deletions

File tree

apps/moonlight/moonlight-android.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"download": "https://play.google.com/store/apps/details?id=com.limelight",
2323
"documentation": "https://github.com/moonlight-stream/moonlight-docs/wiki"
2424
},
25+
"official": true,
2526
"tags": ["streaming", "android", "mobile", "gaming"],
26-
"featured": true,
2727
"compatibility": {
2828
"sunshine": ">=0.1.0"
2929
}

apps/moonlight/moonlight-embedded.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"download": "https://github.com/moonlight-stream/moonlight-embedded/wiki/Packages",
1313
"documentation": "https://github.com/moonlight-stream/moonlight-docs/wiki"
1414
},
15+
"official": true,
1516
"tags": ["streaming", "gamestream", "client", "gaming"],
16-
"featured": true,
1717
"compatibility": {
1818
"sunshine": ">=0.1.0"
1919
}

apps/moonlight/moonlight-ios.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"download": "https://apps.apple.com/us/app/moonlight-game-streaming/id1000551566",
2626
"documentation": "https://github.com/moonlight-stream/moonlight-docs/wiki"
2727
},
28+
"official": true,
2829
"tags": ["streaming", "ios", "mobile", "gaming"],
29-
"featured": true,
3030
"compatibility": {
3131
"sunshine": ">=0.1.0"
3232
}

apps/moonlight/moonlight-qt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"download": "https://github.com/moonlight-stream/moonlight-qt/releases/latest",
1313
"documentation": "https://github.com/moonlight-stream/moonlight-docs/wiki"
1414
},
15+
"official": true,
1516
"tags": ["streaming", "gamestream", "client", "gaming"],
16-
"featured": true,
1717
"compatibility": {
1818
"sunshine": ">=0.1.0"
1919
}

schemas/app.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
},
7777
"description": "Searchable tags"
7878
},
79-
"featured": {
79+
"official": {
8080
"type": "boolean",
81-
"description": "Whether to highlight this app"
81+
"description": "Whether this is an official app maintained by the LizardByte team or partners"
8282
},
8383
"compatibility": {
8484
"type": "object",

scripts/build-index.cjs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,32 @@ async function fetchGitHubMetadata(repoUrl) {
5555

5656
const data = await response.json();
5757

58+
// Fetch the latest commit on the default branch
59+
let lastCommitDate = data.pushed_at; // fallback to pushed_at
60+
try {
61+
const defaultBranch = data.default_branch;
62+
const commitsUrl = `https://api.github.com/repos/${owner}/${repo.replace(/\.git$/, '')}/commits/${defaultBranch}`;
63+
const commitResponse = await fetch(commitsUrl, {
64+
headers: {
65+
'Accept': 'application/vnd.github.v3+json',
66+
'User-Agent': 'LizardByte-App-Directory',
67+
},
68+
});
69+
70+
if (commitResponse.ok) {
71+
const commitData = await commitResponse.json();
72+
lastCommitDate = commitData.commit.committer.date;
73+
}
74+
} catch (commitError) {
75+
// If fetching commit fails, use pushed_at as fallback
76+
console.error(` Warning: Failed to fetch latest commit, using pushed_at: ${commitError.message}`);
77+
}
78+
5879
return {
5980
stars: data.stargazers_count,
6081
openIssues: data.open_issues_count,
6182
forks: data.forks_count,
62-
lastUpdated: data.updated_at,
83+
lastUpdated: lastCommitDate,
6384
license: data.license?.spdx_id || null,
6485
};
6586
} catch (error_) {

0 commit comments

Comments
 (0)