~avery/public-inbox

compatibility-tools-manager: Add support for Luxtorpedia v1 APPLIED

Adds support for https://github.com/luxtorpeda-dev/luxtorpeda, which
wraps linux native engine reimplementations for end users.

Hunter King (1):
  Add support for Luxtorpeda

 src/install-tool.ts |  4 ++--
 src/releases.ts     | 31 ++++++++++++++++++++++++++-----
 src/view.tsx        |  2 +-
 3 files changed, 29 insertions(+), 8 deletions(-)

-- 
2.34.2
#815228 .build.yml success
compatibility-tools-manager/patches/.build.yml: SUCCESS in 1m3s

[Add support for Luxtorpedia][0] from [~hunterking][1]

[0]: https://lists.sr.ht/~avery/public-inbox/patches/34389
[1]: mailto:hking0036@gmail.com

✓ #815228 SUCCESS compatibility-tools-manager/patches/.build.yml https://builds.sr.ht/~avery/job/815228
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~avery/public-inbox/patches/34389/mbox | git am -3
Learn more about email & git

[PATCH compatibility-tools-manager 1/1] Add support for Luxtorpeda Export this patch

From: Hunter King <hking0036@gmail.com>

---
 src/install-tool.ts |  4 ++--
 src/releases.ts     | 31 ++++++++++++++++++++++++++-----
 src/view.tsx        |  2 +-
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/install-tool.ts b/src/install-tool.ts
index 4bb55b6..f91abdd 100644
--- a/src/install-tool.ts
+++ b/src/install-tool.ts
@@ -43,9 +43,9 @@ const downloadTool = async ({
  release: Release;
  compatToolsDir: string;
}) => {
  // Find downalod
  // Find download.
  const asset = release.assets.find(
    (asset) => asset.content_type === 'application/gzip'
    (asset) => asset.content_type === 'application/gzip' || asset.content_type === 'application/x-xz'
  )!;

  const { name, browser_download_url } = asset;
diff --git a/src/releases.ts b/src/releases.ts
index 1cb0ff2..935be3f 100644
--- a/src/releases.ts
+++ b/src/releases.ts
@@ -14,11 +14,32 @@ export interface Release {

let releasesCache: Release[] | undefined;

export const getReleases = async (smm: SMM) => {
  if (!releasesCache) {
    releasesCache = (await smm.Network.get(
      'https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases'
    )) as Release[];
//Enumerate all Proton-GE Releases.
export const getGEReleases = async (smm: SMM) => {
  releasesCache = (await smm.Network.get(
    'https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases'
  )) as Release[];
  return releasesCache;
};

//Enumerate all Luxtorpeda releases.
export const getLuxReleases = async (smm: SMM) => {
  releasesCache = (await smm.Network.get(
    'https://api.github.com/repos/luxtorpeda-dev/luxtorpeda/releases'
  )) as Release[];
  
  for (var release of releasesCache){
    release['tag_name'] = "Luxtorpeda-" + release['tag_name'];
  }

  return releasesCache;
};

//Cache the releases of all supported tools.
export const getReleases = async(smm: SMM) => {
  if (!releasesCache){
    releasesCache = await getGEReleases(smm) as Release[];
    releasesCache = releasesCache.concat(( await getLuxReleases(smm) as Release[]));
  }
  return releasesCache;
};
\ No newline at end of file
diff --git a/src/view.tsx b/src/view.tsx
index d8f2cb3..b11fa54 100644
--- a/src/view.tsx
+++ b/src/view.tsx
@@ -1,7 +1,7 @@
import { SMM } from '.';
import { getInstalledTools } from './get-tools';
import { installTool } from './install-tool';
import { getReleases } from './releases';
import { getReleases} from './releases';
import { removeTool } from './remove-tool';
import styles from './styles.css';
import { dcCreateElement, deleteAll, getCompatToolsDir } from './utils';
-- 
2.34.2
compatibility-tools-manager/patches/.build.yml: SUCCESS in 1m3s

[Add support for Luxtorpedia][0] from [~hunterking][1]

[0]: https://lists.sr.ht/~avery/public-inbox/patches/34389
[1]: mailto:hking0036@gmail.com

✓ #815228 SUCCESS compatibility-tools-manager/patches/.build.yml https://builds.sr.ht/~avery/job/815228