Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved songs searching #1199

Merged
merged 4 commits into from
Mar 15, 2021
Merged

improved songs searching #1199

merged 4 commits into from
Mar 15, 2021

Conversation

xnetcat
Copy link
Member

@xnetcat xnetcat commented Mar 9, 2021

Instead of searching only for videos in YouTube music, search for everything but get only videos and songs. We can't specify more than 1 filter when retrieving data from YouTube api.

Another solution would be to concat two lists (songs, videos) but that would increase number of requests because we have to send 2 POST requests to yt api instead of one. This would increase the chance of getting rate limited

searchSongs = ytmApiClient.search(searchTerm, filter='songs')
searchVideos = ytmApiClient.search(searchTerm, filter='videos')
searchResult = searchSongs + searchVideos

@xnetcat
Copy link
Member Author

xnetcat commented Mar 9, 2021

I will have to update tests. Tests with real network connection work just fine tho
image

Copy link
Contributor

@aklajnert aklajnert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but please fix the CI checks.

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

The code looks good, but please fix the CI checks.

Regression test are failing because of ffmpeg (fixed in #1200).

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

And I have no clue why flake8 fails, it completes successfully on my pc
image

@aklajnert
Copy link
Contributor

Huh, interesting - the versions seem to be the same. What happens if you fix the error from the CI? Will it fail locally?

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

Huh, interesting - the versions seem to be the same. What happens if you fix the error from the CI? Will it fail locally?

Yup, it failed
image

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

It's funny because I didn't even change this file.

@aklajnert
Copy link
Contributor

Can you run tox --recreate -e flake8? Does that change anything?

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

Can you run tox --recreate -e flake8? Does that change anything?

Nope
image

@aklajnert
Copy link
Contributor

In this case, I would add ignore = E301 to [flake8] section in setup.cfg. There's no point in fighting with the linter if it goes wild. This particular error is not very important anyway.

@aklajnert
Copy link
Contributor

I guess the #1200 should be merged first. The flake8 error there seems reasonable, regardless that the file wasn't changed.

@xnetcat
Copy link
Member Author

xnetcat commented Mar 12, 2021

Can you approve changes in #1200

@fizzy123
Copy link

Just wanted to say, very excited for this! I just made this change locally and it makes things so much better!

@Silverarmor
Copy link
Member

@xnetcat please update branch & resolve conflicts.

@xnetcat
Copy link
Member Author

xnetcat commented Mar 14, 2021

@Silverarmor resolved conflicts

@Silverarmor Silverarmor merged commit 9d985fd into spotDL:dev Mar 15, 2021
@Silverarmor Silverarmor added the Enhancement Enhancing spotDL label Mar 15, 2021
@xnetcat xnetcat deleted the artist-songs branch March 15, 2021 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancing spotDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants