* fix #582

* fix result type heuristics
This commit is contained in:
sigma67 2024-05-20 21:45:02 +02:00 • committed by GitHub
commit 0cf0883723
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 11 deletions

View file

@ -40,6 +40,10 @@ class TestSearch:
yt_local = YTMusic(language="it")
results = yt_local.search("ABBA")
assert all(result["resultType"] in ALL_RESULT_TYPES for result in results)
assert len([x for x in results if x["resultType"] == "album"]) <= 10 # album is default fallback
results = yt_local.search("ABBA", filter="songs")
assert all(item["resultType"] == "song" for item in results)
def test_search_filters(self, yt_auth):
query = "hip hop playlist"