Fix AutoDL issue with new models not in cache (#645)

This commit is contained in:
Nerivec
2025-01-07 20:52:53 +01:00
committed by GitHub
parent 93833cb977
commit fd9a5349e1
3 changed files with 8 additions and 4 deletions

View File

@@ -10,8 +10,8 @@ permissions:
# Limit concurrency per branch to prevent push issues.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
update-manifests:

View File

@@ -1,6 +1,6 @@
{
"name": "zigbee-ota",
"version": "1.1.0",
"version": "1.1.1",
"repository": {
"type": "git",
"url": "git+https://github.com/Koenkk/zigbee-OTA.git"

View File

@@ -186,7 +186,11 @@ export async function getText(manufacturer: string, pageUrl: string): Promise<st
return await response.text();
}
export function getLatestImage<T>(list: T[], compareFn: (a: T, b: T) => number): T | undefined {
export function getLatestImage<T>(list: T[] | undefined, compareFn: (a: T, b: T) => number): T | undefined {
if (!list) {
return undefined;
}
const sortedList = list.sort(compareFn);
return sortedList.slice(0, sortedList.length > 1 && process.env.PREV ? -1 : undefined).pop();