Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit 24a25a5

Browse files
committed
FavoriteGroup object should inherit from BaseFavorite
1 parent 003383e commit 24a25a5

File tree

1 file changed

+33
-41
lines changed

1 file changed

+33
-41
lines changed

vrcpy/favorite.py

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,6 @@
22

33
import logging
44

5-
class FavoriteGroup(BaseObject):
6-
def __init__(self, client, obj, loop=None):
7-
super().__init__(client, loop)
8-
9-
self.required.update({
10-
"display_name": {
11-
"dict_key": "displayName",
12-
"type": str
13-
},
14-
"id": {
15-
"dict_key": "id",
16-
"type": str
17-
},
18-
"name": {
19-
"dict_key": "name",
20-
"type": str
21-
},
22-
"owner_display_name": {
23-
"dict_key": "ownerDisplayName",
24-
"type": str
25-
},
26-
"owner_id": {
27-
"dict_key": "ownerId",
28-
"type": str
29-
},
30-
"tags": {
31-
"dict_key": "tags",
32-
"type": list
33-
},
34-
"type": {
35-
"dict_key": "type",
36-
"type": str
37-
},
38-
"visibility": {
39-
"dict_key": "visibility",
40-
"type": str
41-
}
42-
})
43-
44-
self._assign(obj)
45-
465
class BaseFavorite(BaseObject):
476
def __init__(self, client, obj, loop=None):
487
super().__init__(client, loop)
@@ -80,6 +39,39 @@ async def unfavorite(self):
8039
await self.client.request.delete("/favorites/"+self.id)
8140
logging.debug("Unfavorited %s %s" % (self.type, self.id))
8241

42+
class FavoriteGroup(BaseFavorite):
43+
def __init__(self, client, obj, loop=None):
44+
super().__init__(client, loop)
45+
46+
self.required.update({
47+
"display_name": {
48+
"dict_key": "displayName",
49+
"type": str
50+
},
51+
"name": {
52+
"dict_key": "name",
53+
"type": str
54+
},
55+
"owner_display_name": {
56+
"dict_key": "ownerDisplayName",
57+
"type": str
58+
},
59+
"owner_id": {
60+
"dict_key": "ownerId",
61+
"type": str
62+
},
63+
"tags": {
64+
"dict_key": "tags",
65+
"type": list
66+
},
67+
"visibility": {
68+
"dict_key": "visibility",
69+
"type": str
70+
}
71+
})
72+
73+
del self.unfavorite
74+
self._assign(obj)
8375

8476
class WorldFavorite(BaseFavorite):
8577
def __init__(self, client, obj, loop=None):

0 commit comments

Comments
 (0)