mirror of
https://github.com/tcgdex/compiler.git
synced 2025-04-22 10:42:09 +00:00
Log when there is no releaseDate for a serie
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
0c3b237fb8
commit
d5638674a2
@ -7,10 +7,11 @@ export async function getSeries(): Promise<Array<Serie>> {
|
|||||||
const series = await Promise.all((await smartGlob('./db/data/*.js'))
|
const series = await Promise.all((await smartGlob('./db/data/*.js'))
|
||||||
.map((it) => it.substring(it.lastIndexOf('/') + 1, it.length - 3))
|
.map((it) => it.substring(it.lastIndexOf('/') + 1, it.length - 3))
|
||||||
.map((it) => getSerie(it)))
|
.map((it) => getSerie(it)))
|
||||||
const tmp: Array<[Serie, Set]> = await Promise.all(series.map( async (it) => {
|
const tmp: Array<[Serie, Set | undefined]> = await Promise.all(series.map( async (it) => {
|
||||||
return [it, (await getSets(it.name.en)).reduce<Set | undefined>((p, c) => p ? p.releaseDate < c.releaseDate ? p : c : c, undefined) as Set] as [Serie, Set]
|
return [it, (await getSets(it.name.en)).reduce<Set | undefined>((p, c) => p ? p.releaseDate < c.releaseDate ? p : c : c, undefined) as Set] as [Serie, Set]
|
||||||
}))
|
}))
|
||||||
return tmp.sort((a, b) => a[1].releaseDate > b[1].releaseDate ? 1 : -1).map((it) => it[0])
|
tmp.forEach((t) => !t[1] && console.log(t[0].name) )
|
||||||
|
return tmp.sort((a, b) => (a[1] ? a[1].releaseDate : '0') > (b[1] ? b[1].releaseDate : '0') ? 1 : -1).map((it) => it[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getSerie(name: string): Promise<Serie> {
|
export async function getSerie(name: string): Promise<Serie> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user