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

Fix: Broken list items by comma #8

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

ducktordanny
Copy link
Contributor

@ducktordanny ducktordanny commented Jul 20, 2024

Details

When we had track, album, or playlist items with a comma, the regex used for creating the table removed necessary parts of the string. This commit fixes this issue by using osascript's -s flag with a value s which returns a recompilable source form (for more details see man osascript). The new return value (it'll be in this format: '{"song1", "song2", "song3"}') can then be converted into a table with loadstring.

Example of the issue and fix:

  • Track's title in the list:
Screenshot 2024-07-20 at 11 28 38
  • Track's actual title:
Screenshot 2024-07-20 at 11 28 50
  • Track's title in the list after the fix:
Screenshot 2024-07-20 at 11 31 32

When we had track, album or playlist items with a comma the regex used
for creating table removed necessary parts of the string. This commit
fixes this issue by using osascript's `-s` flag with a value `s` which
returns a recompilable source form. The new type of return then can be
processed into a table with `loadstring`.
@p5quared p5quared self-assigned this Jul 20, 2024
@p5quared p5quared self-requested a review July 20, 2024 14:11
@p5quared p5quared added the bug Something isn't working label Jul 20, 2024
Copy link
Owner

@p5quared p5quared left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up! 😄

@p5quared p5quared merged commit deda524 into p5quared:main Jul 20, 2024
1 check passed
@ducktordanny ducktordanny deleted the fix/comma-breaking-track-list branch July 22, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants