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

escape / don't parse square brackets in song names #1739

Merged
merged 2 commits into from
Feb 27, 2023

Conversation

NicoWeio
Copy link
Contributor

@NicoWeio NicoWeio commented Feb 13, 2023

escape / don't parse square brackets in song names

Description

  • Escape log records in SpotdlFormatter.format in logging.py
    • While this could be done in each log call individually, this is sufficient since console markup does not seem to be used anywhere else.
  • Escape song names before passing them as progress bar descriptions

Related Issue

#1738

Motivation and Context

Previously, progress bars and log messages would “swallow” parts of song names that happened to include square brackets, so Crywolf - [when you inhale, i fill your lungs] would become Crywolf - , because rich would try to read these as console markup (like [green], for example).

How Has This Been Tested?

  • GitHub Codespaces
  • tested before/after with this album: widow [OBLIVIØN Pt. 1]
  • Writing a test for the progress bar descriptions seems like an unreasonably hard task.

Screenshots (if appropriate)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have read the CORE VALUES document (dead link)
  • I have added tests to cover my changes
  • All new and existing tests passed

@xnetcat xnetcat changed the base branch from master to dev February 13, 2023 16:44
@xnetcat
Copy link
Member

xnetcat commented Feb 13, 2023

pull changes from dev

@NicoWeio NicoWeio marked this pull request as ready for review February 13, 2023 22:58
@NicoWeio
Copy link
Contributor Author

Oops, thanks for the heads-up, @xnetcat!

I'm not that used to writing tests, so kindly let me know if you have any suggestions for improvements.

@xnetcat xnetcat merged commit 84dc15d into spotDL:dev Feb 27, 2023
@xnetcat xnetcat mentioned this pull request Mar 1, 2023
@NicoWeio NicoWeio deleted the rich-escape branch March 9, 2023 15:33
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.

2 participants