Add content flag support in the API
This commit is contained in:
parent
e40b247a97
commit
9c2c8c21f1
|
@ -2,5 +2,5 @@ title: Help
|
||||||
|
|
||||||
* [Package Tags](package_tags)
|
* [Package Tags](package_tags)
|
||||||
* [Ranks and Permissions](ranks_permissions)
|
* [Ranks and Permissions](ranks_permissions)
|
||||||
* [Content Ratings](content_ratings)
|
* [Content Ratings and Flags](content_flags)
|
||||||
* [Reporting Content](reporting)
|
* [Reporting Content](reporting)
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
title: Content Flags
|
||||||
|
|
||||||
|
Content flags allow you to hide content based on your preferences.
|
||||||
|
The filtering is done server-side, which means that you don't need to update
|
||||||
|
your client to use new flags.
|
||||||
|
|
||||||
|
## Flags
|
||||||
|
|
||||||
|
* `nonfree` - can be used to hide packages which do not qualify as
|
||||||
|
'free software', as defined by the Free Software Foundation.
|
||||||
|
* A content rating, given below.
|
||||||
|
|
||||||
|
|
||||||
|
## Ratings
|
||||||
|
|
||||||
|
Content ratings aren't currently supported by ContentDB.
|
||||||
|
Instead, mature content isn't allowed at all for now.
|
||||||
|
|
||||||
|
In the future, more mature content will be allowed but labelled with
|
||||||
|
content ratings which may contain the following:
|
||||||
|
|
||||||
|
* android_default - meta-rating which includes gore and drugs.
|
||||||
|
* desktop_default - meta-rating which won't include anything for now.
|
||||||
|
* gore - more than just blood
|
||||||
|
* drugs
|
||||||
|
* swearing
|
|
@ -1,11 +0,0 @@
|
||||||
title: Content Ratings
|
|
||||||
|
|
||||||
Content ratings aren't currently supported by ContentDB.
|
|
||||||
Instead, mature content isn't allowed at all for now.
|
|
||||||
|
|
||||||
Possible future ratings:
|
|
||||||
|
|
||||||
* mature - meta-rating which includes gore and drugs
|
|
||||||
* gore - more than just blood
|
|
||||||
* drugs
|
|
||||||
* swearing
|
|
|
@ -19,12 +19,14 @@ class QueryBuilder:
|
||||||
if len(types) > 0:
|
if len(types) > 0:
|
||||||
title = ", ".join([type.value + "s" for type in types])
|
title = ", ".join([type.value + "s" for type in types])
|
||||||
|
|
||||||
|
hide_flags = args.getlist("hide")
|
||||||
|
|
||||||
self.title = title
|
self.title = title
|
||||||
self.types = types
|
self.types = types
|
||||||
self.search = args.get("q")
|
self.search = args.get("q")
|
||||||
self.random = "random" in args
|
self.random = "random" in args
|
||||||
self.lucky = self.random or "lucky" in args
|
self.lucky = self.random or "lucky" in args
|
||||||
self.hide_nonfree = isNo(args.get("nonfree"))
|
self.hide_nonfree = "nonfree" in hide_flags
|
||||||
self.limit = 1 if self.lucky else None
|
self.limit = 1 if self.lucky else None
|
||||||
self.order_by = args.get("sort") or "score"
|
self.order_by = args.get("sort") or "score"
|
||||||
self.order_dir = args.get("order") or "desc"
|
self.order_dir = args.get("order") or "desc"
|
||||||
|
|
Loading…
Reference in New Issue