Add cover_image to screenshot response in API

This commit is contained in:
rubenwardy 2022-02-02 01:20:11 +00:00
parent 5bb9012655
commit e7d2f09eb4
2 changed files with 2 additions and 0 deletions

@ -226,6 +226,7 @@ curl -X DELETE https://content.minetest.net/api/packages/username/name/releases/
* `url`: absolute URL to screenshot.
* `created_at`: ISO time.
* `order`: Number used in ordering.
* `is_cover_image`: true for cover image.
* GET `/api/packages/<username>/<name>/screenshots/<id>/` (Read)
* Returns screenshot dictionary like above.
* POST `/api/packages/<username>/<name>/screenshots/new/` (Create)

@ -1093,6 +1093,7 @@ class PackageScreenshot(db.Model):
"url": base_url + self.url,
"approved": self.approved,
"created_at": self.created_at.isoformat(),
"is_cover_image": self.package.cover_image == self,
}