api page coverSrc support; filter tags response by field

This commit is contained in:
tmshv committed 2020-03-03 07:43:30 +03:00
1 parent 11ff066e6c
commit 1318328fe7
4 files changed
+42 -10

No files matched your search

+16 -7
View File
@@ -36,9 +36,9 @@ export default class Image {
const artifacts = data.data
return new Image({ ...data, artifacts })
}
public hash: any
public file: any
public artifacts: any
public hash: string
public file: string
public artifacts: Map<string, ImageArtifact>
constructor({ hash, file, artifacts }) {
this.hash = hash
@@ -79,13 +79,22 @@ export default class Image {
set: srcset,
}
}
getSrc(): string | null {
const a = this.getArtifact(ImageArtifactType.ORIGINAL)
if (!a) {
return null
}
return a.url
}
}
class ImageArtifact {
public url: any
public size: any
public width: any
public height: any
public url: string
public size: string
public width: number
public height: number
constructor({ url, size, width, height }) {
this.url = url