Skip to content

Commit

Permalink
Update AppInfo to include content descriptors (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulDridi committed Apr 4, 2024
1 parent e48dc18 commit ba5d819
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions steam/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -2077,9 +2077,12 @@ class AuthSessionResponse(IntEnum):


class ContentDescriptor(IntEnum):
NudityOrSexualContent = 1
FrequentNudityOrSexualContent = 1
FrequentViolenceOrGore = 2
AdultOnlySexualContent = 3
StrongSexualContent = 3
GratuitousSexualContent = 4
AnyMatureContent = 5


Expand Down
16 changes: 15 additions & 1 deletion steam/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@
from . import utils
from ._const import MISSING, URL, VDF_LOADS, VDFDict, impl_eq_via_id
from .app import PartialApp
from .enums import AppType, BillingType, DepotFileFlag, Language, LicenseType, PackageStatus, ReviewType
from .enums import (
AppType,
BillingType,
ContentDescriptor,
DepotFileFlag,
Language,
LicenseType,
PackageStatus,
ReviewType,
)
from .id import ID
from .models import CDNAsset, _IOMixin
from .package import PartialPackage
Expand Down Expand Up @@ -877,6 +886,7 @@ class AppInfo(ProductInfo, PartialApp[str]):
"language_support",
"tags",
"categories",
"content_descriptors",
"genres",
"created_at",
"review_score",
Expand Down Expand Up @@ -923,6 +933,10 @@ def __init__(
"""Whether this app has a content hub visible."""
self._stats_visible = common.get("community_visible_stats", "0") == "1"
self._free = extended.get("isfreeapp", "0") == "1"
self.content_descriptors = [
ContentDescriptor.try_value(int(id)) for id in common.get("content_descriptors", MultiDict()).values()
]
"""This app's content descriptors."""

self.controller_support = common.get("controller_support", "none")
"""This app's level of controller support."""
Expand Down
1 change: 1 addition & 0 deletions steam/types/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Common(TypedVDFDict, total=False):
has_adult_content: VDFBool
has_adult_content_violence: VDFBool
has_adult_content_sex: VDFBool
content_descriptors: MultiDict[str]
market_presence: VDFBool
workshop_visible: VDFBool
community_hub_visible: VDFBool
Expand Down

0 comments on commit ba5d819

Please sign in to comment.