@@ -382,37 +382,60 @@ async def async_sub_fork(self, share_id: int) -> Tuple[bool, str]:
382382 return self ._handle_response (res , clear_cache = False )
383383
384384 @cached (region = _shares_cache_region , maxsize = 1 , ttl = 1800 , skip_empty = True )
385- def get_shares (self , name : Optional [str ] = None , page : Optional [int ] = 1 , count : Optional [int ] = 30 ) -> List [dict ]:
385+ def get_shares (self , name : Optional [str ] = None , page : Optional [int ] = 1 , count : Optional [int ] = 30 ,
386+ genre_id : Optional [int ] = None , min_rating : Optional [float ] = None ,
387+ max_rating : Optional [float ] = None ) -> List [dict ]:
386388 """
387389 获取订阅分享数据
388390 """
389391 enabled , _ = self ._check_subscribe_share_enabled ()
390392 if not enabled :
391393 return []
392394
393- res = RequestUtils ( proxies = settings . PROXY , timeout = 15 ). get_res ( self . _sub_shares , params = {
395+ params = {
394396 "name" : name ,
395397 "page" : page ,
396398 "count" : count
397- })
399+ }
400+
401+ # 添加可选参数
402+ if genre_id is not None :
403+ params ["genre_id" ] = genre_id
404+ if min_rating is not None :
405+ params ["min_rating" ] = min_rating
406+ if max_rating is not None :
407+ params ["max_rating" ] = max_rating
408+
409+ res = RequestUtils (proxies = settings .PROXY , timeout = 15 ).get_res (self ._sub_shares , params = params )
398410
399411 return self ._handle_list_response (res )
400412
401413 @cached (region = _shares_cache_region , maxsize = 1 , ttl = 1800 , skip_empty = True )
402- async def async_get_shares (self , name : Optional [str ] = None , page : Optional [int ] = 1 , count : Optional [int ] = 30 ) -> \
403- List [dict ]:
414+ async def async_get_shares (self , name : Optional [str ] = None , page : Optional [int ] = 1 , count : Optional [int ] = 30 ,
415+ genre_id : Optional [int ] = None , min_rating : Optional [float ] = None ,
416+ max_rating : Optional [float ] = None ) -> List [dict ]:
404417 """
405418 异步获取订阅分享数据
406419 """
407420 enabled , _ = self ._check_subscribe_share_enabled ()
408421 if not enabled :
409422 return []
410423
411- res = await AsyncRequestUtils ( proxies = settings . PROXY , timeout = 15 ). get_res ( self . _sub_shares , params = {
424+ params = {
412425 "name" : name ,
413426 "page" : page ,
414427 "count" : count
415- })
428+ }
429+
430+ # 添加可选参数
431+ if genre_id is not None :
432+ params ["genre_id" ] = genre_id
433+ if min_rating is not None :
434+ params ["min_rating" ] = min_rating
435+ if max_rating is not None :
436+ params ["max_rating" ] = max_rating
437+
438+ res = await AsyncRequestUtils (proxies = settings .PROXY , timeout = 15 ).get_res (self ._sub_shares , params = params )
416439
417440 return self ._handle_list_response (res )
418441
0 commit comments