mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Add game support to API
This commit is contained in:
parent
a291b2cd6f
commit
5bb9012655
@ -90,6 +90,7 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
|
||||
* `issue_tracker`: Issue tracker URL.
|
||||
* `forums`: forum topic ID.
|
||||
* `video_url`: URL to a video.
|
||||
* `game_support`: Array of game support information objects. Not currently documented, as subject to change.
|
||||
* GET `/api/packages/<username>/<name>/dependencies/`
|
||||
* Returns dependencies, with suggested candidates
|
||||
* If query argument `only_hard` is present, only hard deps will be returned.
|
||||
|
@ -354,7 +354,7 @@ class PackageGameSupport(db.Model):
|
||||
game = db.relationship("Package", foreign_keys=[game_id])
|
||||
|
||||
supports = db.Column(db.Boolean, nullable=False, default=True)
|
||||
confidence = db.Column(db.Integer, nullable=False, default=0)
|
||||
confidence = db.Column(db.Integer, nullable=False, default=1)
|
||||
|
||||
__table_args__ = (db.UniqueConstraint("game_id", "package_id", name="_package_game_support_uc"),)
|
||||
|
||||
@ -580,7 +580,15 @@ class Package(db.Model):
|
||||
"release": release and release.id,
|
||||
|
||||
"score": round(self.score * 10) / 10,
|
||||
"downloads": self.downloads
|
||||
"downloads": self.downloads,
|
||||
|
||||
"game_support": [
|
||||
{
|
||||
"supports": support.supports,
|
||||
"confidence": support.confidence,
|
||||
"game": support.game.getAsDictionaryShort(base_url, version)
|
||||
} for support in self.supported_games.all()
|
||||
]
|
||||
}
|
||||
|
||||
def getThumbnailOrPlaceholder(self, level=2):
|
||||
|
Loading…
Reference in New Issue
Block a user