Skip to content

Fix: handle some of the songs not found for command -ss multiple download situation.#77

Open
XenoAmess wants to merge 2 commits intocodezjx:masterfrom
xenoamess-fork:fix-songs-download-single-fail
Open

Fix: handle some of the songs not found for command -ss multiple download situation.#77
XenoAmess wants to merge 2 commits intocodezjx:masterfrom
xenoamess-fork:fix-songs-download-single-fail

Conversation

@XenoAmess
Copy link
Copy Markdown

@XenoAmess XenoAmess commented Mar 25, 2026

now we print('Song not found for song_id:', song_id) when song not found, instead print error then break the program.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Robust Song Retrieval: Implemented comprehensive error handling and null checks within the get_song API method to gracefully manage situations where song information might not be found or an API error occurs.
  • Conditional Song Download: Modified the song download logic to prevent attempts to download songs that were not successfully retrieved, providing a clear message when a song ID does not yield valid data.
  • Development Environment Cleanup: Updated the .gitignore file to exclude .idea directories, which typically contain IDE-specific configuration files.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@XenoAmess XenoAmess force-pushed the fix-songs-download-single-fail branch from f20910f to e656ff7 Compare March 25, 2026 14:23
…load situation.

now we print('Song not found for song_id:', song_id) when song not found, instead print error then break the program.
@XenoAmess XenoAmess force-pushed the fix-songs-download-single-fail branch from e656ff7 to 749517a Compare March 25, 2026 14:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread ncm/api.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant