Fix: handle some of the songs not found for command -ss multiple download situation.#77
Fix: handle some of the songs not found for command -ss multiple download situation.#77XenoAmess wants to merge 2 commits intocodezjx:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the application's resilience when fetching and downloading song information. It specifically addresses scenarios where certain songs might not be found via the API, preventing subsequent errors in the download process and improving the overall stability of the multiple download feature. The changes ensure that the system can gracefully handle missing song data without crashing. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
f20910f to
e656ff7
Compare
…load situation.
now we print('Song not found for song_id:', song_id) when song not found, instead print error then break the program.
e656ff7 to
749517a
Compare
There was a problem hiding this comment.
Code Review
This pull request enhances the robustness of song retrieval and downloading by introducing error handling and explicit checks for song availability. Specifically, the get_song function in ncm/api.py now includes a try-except block and returns None if a song is not found or an error occurs. Correspondingly, get_song_info_by_id and download_song_by_id in ncm/downloader.py were updated to handle these None returns. Type hints were also added to several functions. Additionally, the .idea directory was added to .gitignore. A review comment suggests further improvements for the get_song function, including moving the docstring, explicitly checking for None from self.get_request, and making the error message more informative.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
now we print('Song not found for song_id:', song_id) when song not found, instead print error then break the program.