@@ -16,9 +16,13 @@ async def author(self):
1616 return User (self .client , resp ["data" ])
1717
1818 async def favorite (self ):
19- resp = await self .client .api .call ("/favorites" , "POST" , params = {"type" : types .FavoriteType .Avatar ,\
20- "favoriteId" : self .id })
21- return Favorite (resp ["data" ])
19+ resp = await self .client .api .call ("/favorites" , "POST" , json = {"type" : types .FavoriteType .Avatar ,\
20+ "favoriteId" : self .id , "tags" : ["avatars1" ]})
21+
22+ f = Favorite (self .client , resp ["data" ])
23+ await f .cacheTask
24+
25+ return f
2226
2327## User
2428
@@ -118,6 +122,9 @@ async def fetch_favorites(self, t):
118122 for favorite in resp ["data" ]:
119123 f .append (Favorite (self .client , favorite ))
120124
125+ for fav in f :
126+ await fav .cacheTask
127+
121128 return f
122129
123130 async def favorite (self ):
@@ -151,13 +158,12 @@ async def __cinit__(self):
151158 if hasattr (self , "homeLocation" ):
152159 if self .homeLocation == "" : self .homeLocation = None
153160 else : self .homeLocation = await self .client .fetch_world (self .homeLocation )
161+ else : self .homeLocation = None
154162
155163 # Wait for all cacheTasks
156164 if not self .homeLocation == None :
157165 await self .homeLocation .cacheTask
158166
159- self .client .cacheFull = True
160-
161167## World
162168
163169class LimitedWorld (o .LimitedWorld ):
@@ -202,7 +208,7 @@ async def __cinit__(self):
202208 if self .type == types .FavoriteType .World :
203209 self .object = await self .client .fetch_world (self .favoriteId )
204210 elif self .type == types .FavoriteType .Friend :
205- for friend in self .client .me .friends () :
211+ for friend in self .client .me .friends :
206212 if friend .id == self .favoriteId :
207213 self .object = friend
208214 break
0 commit comments