update marketplace url to reflect build version (#2914)

* update marketplace url to reflect build version

* adjust marketplace config

* use helper function to compare urls

* rework some registry stuff

* #2900, #2899, and other registry changes

* alpha.1

* trailing /

* add startosRegistry

* fix migration

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
Co-authored-by: Aiden McClelland <me@drbonez.dev>
Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
This commit is contained in:
Lucy
2025-04-29 16:12:21 -04:00
committed by GitHub
parent 2adf34fbaf
commit 5c473eb9cc
63 changed files with 733 additions and 470 deletions

View File

@@ -1,6 +1,12 @@
import { Injectable } from '@angular/core'
import { PatchDB } from 'patch-db-client'
import { BehaviorSubject, distinctUntilChanged, map, combineLatest } from 'rxjs'
import {
BehaviorSubject,
distinctUntilChanged,
map,
combineLatest,
firstValueFrom,
} from 'rxjs'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { getServerInfo } from 'src/app/utils/get-server-info'
import { DataModel } from './patch-db/data-model'
@@ -11,7 +17,7 @@ import { RR } from './api/api.types'
providedIn: 'root',
})
export class OSService {
osUpdate?: RR.GetRegistryOsUpdateRes
osUpdate?: RR.CheckOsUpdateRes
updateAvailable$ = new BehaviorSubject<boolean>(false)
readonly updating$ = this.patch.watch$('serverInfo', 'statusInfo').pipe(
@@ -47,7 +53,12 @@ export class OSService {
async loadOS(): Promise<void> {
const { version, id } = await getServerInfo(this.patch)
this.osUpdate = await this.api.checkOSUpdate({ serverId: id })
const { startosRegistry } = await firstValueFrom(this.patch.watch$('ui'))
this.osUpdate = await this.api.checkOSUpdate({
registry: startosRegistry,
serverId: id,
})
const [latestVersion, _] = Object.entries(this.osUpdate).at(-1)!
const updateAvailable =
Version.parse(latestVersion).compare(Version.parse(version)) === 'greater'