Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nate Graham
Kid3
Commits
a801a575
Commit
a801a575
authored
Jan 14, 2011
by
Urs Fleisch
Browse files
replace also numerical HTML entities in Discogs and Amazon import
parent
43762835
Changes
2
Hide whitespace changes
Inline
Side-by-side
kid3/kid3/discogsdialog.cpp
View file @
a801a575
...
...
@@ -451,7 +451,7 @@ void DiscogsDialog::parseAlbumResults(const QByteArray& albumStr)
int
duration
=
0
;
int
pos
=
trackNr
;
if
(
titleRe
.
QCM_indexIn
(
trackDataStr
)
>=
0
)
{
title
=
titleRe
.
cap
(
1
);
title
=
removeHtml
(
titleRe
.
cap
(
1
)
)
;
}
if
(
durationRe
.
QCM_indexIn
(
trackDataStr
)
>=
0
)
{
duration
=
durationRe
.
cap
(
1
).
toInt
()
*
60
+
...
...
@@ -472,7 +472,7 @@ void DiscogsDialog::parseAlbumResults(const QByteArray& albumStr)
start
=
end
+
10
;
// skip </td></tr>
if
(
indexRe
.
QCM_indexIn
(
trackDataStr
)
>=
0
)
{
if
(
additionalTags
)
{
QString
subtitle
(
indexRe
.
cap
(
1
));
QString
subtitle
(
removeHtml
(
indexRe
.
cap
(
1
))
)
;
framesHdr
.
setValue
(
Frame
::
FT_Part
,
subtitle
);
frames
.
setValue
(
Frame
::
FT_Part
,
subtitle
);
}
...
...
kid3/kid3/importsourcedialog.cpp
View file @
a801a575
...
...
@@ -501,6 +501,14 @@ QString ImportSourceDialog::replaceHtmlEntities(QString str)
str
.
replace
(
"<"
,
"<"
);
str
.
replace
(
">"
,
">"
);
str
.
replace
(
"&"
,
"&"
);
QRegExp
numEntityRe
(
"&#(
\\
d+);"
);
int
pos
=
0
;
while
((
pos
=
numEntityRe
.
QCM_indexIn
(
str
,
pos
))
!=
-
1
)
{
str
.
replace
(
pos
,
numEntityRe
.
matchedLength
(),
QChar
(
numEntityRe
.
cap
(
1
).
toInt
()));
pos
+=
numEntityRe
.
matchedLength
();
}
return
str
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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