Skip to content

Commit 3f87d7b

Browse files
committed
Enhance hosted apps liveliness classification
1 parent caa7330 commit 3f87d7b

13 files changed

Lines changed: 66 additions & 151 deletions

File tree

src/pages/[category]/[page].astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Footer from "../../components/footer.astro"
88
import AppsList from "../../components/apps_list.astro"
99
1010
import categories from "../../categories.json" with { type: "json" }
11+
import { live } from "../../validate_hosted_apps.js"
1112
1213
const characters = [ "1", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ]
1314
@@ -24,7 +25,9 @@ export async function getStaticPaths() {
2425
2526
let { category, page } = Astro.params
2627
27-
let apps = await Content.getCollection("metadata", function(app) {
28+
let packaged = await Content.getCollection("metadata", app => app.data.app_type != "hosted")
29+
30+
let apps = packaged.concat(live).filter(function(app) {
2831
if(! app.data.categories.includes(category)) {
2932
return false
3033
}

src/pages/[category]/index.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ import Metadata from "../../components/common_metadata.astro"
77
import AppsList from "../../components/apps_list.astro"
88
99
import categories from "../../categories.json" with { type: "json" }
10+
import { live } from "../../validate_hosted_apps.js"
1011
1112
export async function getStaticPaths() {
1213
return categories.map(category => ({ params: { category: category.slug }, props: { category } }))
1314
}
1415
1516
let { category } = Astro.props
1617
17-
let apps = await Content.getCollection("metadata", ({ data }) => data.categories.includes(category.slug))
18+
let packaged = await Content.getCollection("metadata", app => app.data.app_type != "hosted")
19+
let apps = packaged.concat(live).filter(app => app.data.categories.includes(category.slug))
20+
1821
---
1922

2023
<!doctype html>

src/pages/all/[page].astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Header from "../../components/header.astro"
77
import Footer from "../../components/footer.astro"
88
import AppsList from "../../components/apps_list.astro"
99
10+
import { live } from "../../validate_hosted_apps.js"
11+
1012
const characters = [ "1", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ]
1113
1214
export async function getStaticPaths() {
@@ -17,7 +19,9 @@ export async function getStaticPaths() {
1719
1820
let { page } = Astro.params
1921
20-
let apps = await Content.getCollection("metadata", function(app) {
22+
let packaged = await Content.getCollection("metadata", app => app.data.app_type != "hosted")
23+
24+
let apps = packaged.concat(live).filter(function(app) {
2125
let name = app.data.name["en-US"] ?? app.data.name.en ?? app.data.name[app.data.default_locale]
2226
let starting = name[0].toUpperCase()
2327
if(! characters.includes(starting)) {

src/pages/all/index.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import Header from "../../components/header.astro"
77
import Footer from "../../components/footer.astro"
88
import AppsList from "../../components/apps_list.astro"
99
10-
let apps = await Content.getCollection("metadata")
10+
import { live } from "../../validate_hosted_apps.js"
11+
12+
let packaged = await Content.getCollection("metadata", app => app.data.app_type != "hosted")
13+
let apps = packaged.concat(live)
1114
---
1215

1316
<!doctype html>

src/pages/dead/[page].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Header from "../../components/header.astro"
77
import Footer from "../../components/footer.astro"
88
import AppsList from "../../components/apps_list.astro"
99
10-
import { dead, total } from "../../validateHostedApps.js"
10+
import { dead } from "../../validate_hosted_apps.js"
1111
1212
const characters = [ "1", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ]
1313

src/pages/dead/index.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Header from "../../components/header.astro"
55
import Footer from "../../components/footer.astro"
66
import AppsList from "../../components/apps_list.astro"
77
8-
import { dead, total } from "../../validateHostedApps.js"
8+
import { dead } from "../../validate_hosted_apps.js"
99
---
1010

1111
<!doctype html>
@@ -22,7 +22,6 @@ import { dead, total } from "../../validateHostedApps.js"
2222
<header>
2323
<h2>All Dead Hosted Apps</h2>
2424
</header>
25-
<p>Found { dead.length } dead hosted apps out of { total } total hosted apps.</p>
2625
<AppsList apps={ dead }/>
2726
</main>
2827
<Footer/>

src/pages/hosted/[page].astro

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Header from "../../components/header.astro"
77
import Footer from "../../components/footer.astro"
88
import AppsList from "../../components/apps_list.astro"
99
10+
import { live } from "../../validate_hosted_apps.js"
11+
1012
const characters = [ "1", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ]
1113
1214
export async function getStaticPaths() {
@@ -17,10 +19,7 @@ export async function getStaticPaths() {
1719
1820
let { page } = Astro.params
1921
20-
let apps = await Content.getCollection("metadata", function(app) {
21-
if(app.data.app_type != "hosted") {
22-
return false
23-
}
22+
let apps = live.filter(app => {
2423
let name = app.data.name["en-US"] ?? app.data.name.en ?? app.data.name[app.data.default_locale]
2524
let starting = name[0].toUpperCase()
2625
if(! characters.includes(starting)) {

src/pages/hosted/index.astro

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
---
2-
import * as Content from "astro:content"
3-
42
import Imports from "../../components/common_imports.astro"
53
import Metadata from "../../components/common_metadata.astro"
64
import Header from "../../components/header.astro"
75
import Footer from "../../components/footer.astro"
86
import AppsList from "../../components/apps_list.astro"
97
10-
let hosted = await Content.getCollection("metadata", ({ data }) => data.app_type == "hosted")
8+
import { live } from "../../validate_hosted_apps.js"
119
---
1210

1311
<!doctype html>
@@ -24,7 +22,7 @@ let hosted = await Content.getCollection("metadata", ({ data }) => data.app_type
2422
<header>
2523
<h2>All Hosted Apps</h2>
2624
</header>
27-
<AppsList apps={ hosted }/>
25+
<AppsList apps={ live }/>
2826
</main>
2927
<Footer/>
3028
</body>

src/pages/index.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ import Categories from "../components/categories.astro"
2323
<p><a href="all/1">All Apps</a></p>
2424
<p><a href="packaged/1">Packaged Apps - can be installed here</a></p>
2525
<p><a href="privileged/1">Privileged Apps - cannot be installed directly and must be sideloaded using developer tools</a></p>
26-
<p><a href="hosted/1">All Hosted Apps</a></p>
27-
<p><a href="live/1">Live Hosted Apps - can be installed, but might no longer function</a></p>
26+
<p><a href="hosted/1">Hosted Apps - possibly installable, but might no longer function</a></p>
2827
<p><a href="dead/1">Dead Hosted Apps - cannot be installed</a></p>
2928
<Categories/>
3029
<p>
31-
Firefox apps can be installed on any version of Firefox OS and on old versions of the Firefox web browser v16 - v46.<br>
30+
Firefox apps can be installed on any version of Firefox OS and on old versions of the Firefox web browser until v46.<br>
3231
<a href="https://ftp.mozilla.org/pub/firefox/releases/45.9.0esr/">Firefox desktop v45</a><br>
3332
<a href="https://archive.mozilla.org/pub/mobile/releases/45.0.2/">Firefox Android v45</a><br>
3433
<a href="https://freesoft.net/android/firefox_os_25_developer_preview">Firefox OS 2.5 Android launcher</a>

src/pages/live/[page].astro

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)