playlist search result "itemCount" field cast to int (#589)
* playlist search result "itemCount" field cast to int * use to_int --------- Co-authored-by: sigma67 <sigma67.github@gmail.com>
This commit is contained in:
parent
1f4332a8a9
commit
bd512384d9
1 changed files with 4 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
from ..helpers import to_int
|
||||||
from ._utils import *
|
from ._utils import *
|
||||||
from .songs import *
|
from .songs import *
|
||||||
|
|
||||||
|
|
@ -97,7 +98,9 @@ def parse_search_result(data, search_result_types, result_type, category):
|
||||||
elif result_type == "playlist":
|
elif result_type == "playlist":
|
||||||
flex_item = get_flex_column_item(data, 1)["text"]["runs"]
|
flex_item = get_flex_column_item(data, 1)["text"]["runs"]
|
||||||
has_author = len(flex_item) == default_offset + 3
|
has_author = len(flex_item) == default_offset + 3
|
||||||
search_result["itemCount"] = get_item_text(data, 1, default_offset + has_author * 2).split(" ")[0]
|
search_result["itemCount"] = to_int(
|
||||||
|
get_item_text(data, 1, default_offset + has_author * 2).split(" ")[0]
|
||||||
|
)
|
||||||
search_result["author"] = None if not has_author else get_item_text(data, 1, default_offset)
|
search_result["author"] = None if not has_author else get_item_text(data, 1, default_offset)
|
||||||
|
|
||||||
elif result_type == "station":
|
elif result_type == "station":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue