beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.79k stars 1.82k forks source link

Reworked #4709 after latest release #5447

Closed arogl closed 1 day ago

arogl commented 3 days ago

Description

Fixes #4709 SQL use of Double Quoted Strings.

Replacing #5236

arogl commented 2 days ago

I think there's there may be one more replacement left, see extra/_beet line 111:

      sqlcmd="select distinct value from item_attributes where key=='$1' and value!='';"

I believe this is already correct when reviewing against the changes already made.

Double quotes surrounding the command and single quotes for variable use within the string

snejus commented 2 days ago

I think there's there may be one more replacement left, see extra/_beet line 111:

        sqlcmd="select distinct value from item_attributes where key=='$1' and value!='';"

I believe this is already correct when reviewing against the changes already made.

Double quotes surrounding the command and single quotes for variable use within the string

Ah you're completely right! My bad, got mixed up there.

snejus commented 2 days ago

I think I found something relevant!

beetsplug/web/__init__.py:            'SELECT DISTINCT "{}" FROM "{}" ORDER BY "{}"'.format(
CONTRIBUTING.rst:             rows = tx.query('SELECT DISTINCT "{0}" FROM "{1}" ORDER BY "{2}"'
arogl commented 2 days ago

I have updated the 2 files as requested

beetsplug/web/__init__.py:
CONTRIBUTING.rst:

Looking through the code I wonder if the changes in this PR should look to be updated to f-strings?

snejus commented 2 days ago

I have updated the 2 files as requested

beetsplug/web/__init__.py:
CONTRIBUTING.rst:

Looking through the code I wonder if the changes in this PR should look to be updated to f-strings?

I wouldn't think so - I guess it would be out of scope of your actual goal here