Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Amarok
Commits
402623fc
Commit
402623fc
authored
Mar 28, 2011
by
Sergey Ivanov
Browse files
Screen escape characters in MusicBrainz request string.
BUG: 269455
parent
bba5d6c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
402623fc
...
...
@@ -5,6 +5,7 @@ Amarok ChangeLog
VERSION 2.4.1
BUGFIXES:
* Screen escape characters in MusicBrainz request string. (BR: 269455)
* Fixed detection of iPod devices.
* Fixed crash when the lyrics applet was removed and re-added while a
track was playing and the user pressed "ESC".
...
...
src/musicbrainz/MusicBrainzFinder.cpp
View file @
402623fc
...
...
@@ -435,12 +435,16 @@ MusicBrainzFinder::compileRequest( const Meta::TrackPtr &track )
QString
query
=
QString
(
"dur:(%1)"
).
arg
(
track
->
length
()
);
QVariantMap
metadata
=
guessMetadata
(
track
);
QRegExp
escape
(
"([~!
\\
^&*()
\\
-+
\\
[
\\
]{}
\\\\
:
\"
?])"
);
QString
replacement
(
"
\\\\
1"
);
#define VALUE(s) metadata.value( s ).toString().replace( escape, replacement )
if
(
metadata
.
contains
(
Meta
::
Field
::
TITLE
)
)
query
+=
QString
(
" track:(%1)"
).
arg
(
metadata
.
value
(
Meta
::
Field
::
TITLE
)
.
toString
()
);
query
+=
QString
(
" track:(%1)"
).
arg
(
VALUE
(
Meta
::
Field
::
TITLE
)
);
if
(
metadata
.
contains
(
Meta
::
Field
::
ARTIST
)
)
query
+=
QString
(
" artist:(%1)"
).
arg
(
metadata
.
value
(
Meta
::
Field
::
ARTIST
)
.
toString
()
);
query
+=
QString
(
" artist:(%1)"
).
arg
(
VALUE
(
Meta
::
Field
::
ARTIST
)
);
if
(
metadata
.
contains
(
Meta
::
Field
::
ALBUM
)
)
query
+=
QString
(
" release:(%1)"
).
arg
(
metadata
.
value
(
Meta
::
Field
::
ALBUM
).
toString
()
);
query
+=
QString
(
" release:(%1)"
).
arg
(
VALUE
(
Meta
::
Field
::
ALBUM
)
);
#undef VALUE
m_parsedMetaData
.
insert
(
track
,
metadata
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment