Show WIP packages in client, add missing keys to package

This commit is contained in:
rubenwardy 2021-12-23 11:56:03 +00:00
parent 2e7d4277e1
commit e3ed5fbc58
3 changed files with 10 additions and 5 deletions

@ -25,8 +25,8 @@ A flag can be:
There are also two meta-flags, which are designed so that we can change how different platforms filter the package list
without making a release.
* `android_default`: currently same as `*, wip, deprecated`. Hides all content warnings, WIP packages, and deprecated packages
* `desktop_default`: currently same as `wip, deprecated`. Hides all WIP and deprecated packages
* `android_default`: currently same as `*, deprecated`. Hides all content warnings, WIP packages, and deprecated packages
* `desktop_default`: currently same as `deprecated`. Hides all WIP and deprecated packages
## Content Warnings

@ -464,11 +464,15 @@ class Package(db.Model):
release = self.getDownloadRelease(version=version)
release_id = release and release.id
short_desc = self.short_desc
if self.dev_state == PackageDevState.WIP:
short_desc = "Work in Progress. " + self.short_desc
ret = {
"name": self.name,
"title": self.title,
"author": self.author.username,
"short_description": self.short_desc,
"short_description": short_desc,
"type": self.type.toName(),
"release": release_id,
"thumbnail": (base_url + tnurl) if tnurl is not None else None,
@ -488,6 +492,7 @@ class Package(db.Model):
"maintainers": [x.username for x in self.maintainers],
"state": self.state.name,
"dev_state": self.dev_state.name,
"name": self.name,
"title": self.title,

@ -42,11 +42,11 @@ class QueryBuilder:
self.order_dir = args.get("order") or "desc"
if "android_default" in self.hide_flags:
self.hide_flags.update(["*", "wip", "deprecated"])
self.hide_flags.update(["*", "deprecated"])
self.hide_flags.discard("android_default")
if "desktop_default" in self.hide_flags:
self.hide_flags.update(["wip", "deprecated"])
self.hide_flags.update(["deprecated"])
self.hide_flags.discard("desktop_default")
self.hide_nonfree = "nonfree" in self.hide_flags