You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you believe there is any value in any of these suggestions I can open a PR, else please feel free to completely ignore.
Thanks in advance for your time
The text was updated successfully, but these errors were encountered:
@sfendourakis, looks good, do a PR and I'll take a look at it :)
It is also desirable to add a couple of tests so that you can compare the old version and the new one. Because currently, test is only on one file.
I was trying to understand the
recognize_song
function and I saw some possible code improvements. Please note that I'm new to this codebase and I might have gotten things really wrong, so feel free to correct me if I'm wrong!https://github.com/dotX12/ShazamIO/blob/17627a805c5ac228b9dab42521591ac494001d6a/shazamio/api.py#L347-L353
Here I believe the logic behind the check for
signature_generator.input_pending_processing
is already included following codehttps://github.com/dotX12/ShazamIO/blob/17627a805c5ac228b9dab42521591ac494001d6a/shazamio/algorithm.py#L87-L89
so my proposal would be
https://github.com/dotX12/ShazamIO/blob/17627a805c5ac228b9dab42521591ac494001d6a/shazamio/api.py#L355-L358
Here is will never go inside the while loop since
signature_generator.get_next_signature()
always returns aDecodedMessage()
instance orNone
for the case we covered above. So my proposal would behttps://github.com/dotX12/ShazamIO/blob/17627a805c5ac228b9dab42521591ac494001d6a/shazamio/algorithm.py#L103-L108
This code is also in the
__init__
method of the class so it's already applied, it seems to me that it's not needed here. My proposal would be to keep it only in the__init__
method.If you believe there is any value in any of these suggestions I can open a PR, else please feel free to completely ignore.
Thanks in advance for your time
The text was updated successfully, but these errors were encountered: