[mythtv-commits] Ticket #11088: nearestName is case sensitive and too restrictive.
MythTV
noreply at mythtv.org
Thu Sep 13 23:00:32 UTC 2012
#11088: nearestName is case sensitive and too restrictive.
-------------------------+--------------------------------------
Reporter: drwyrm@… | Type: Bug Report - General
Status: new | Priority: trivial
Milestone: unknown | Component: MythTV - General
Version: Master Head | Severity: medium
Keywords: | Ticket locked: 0
-------------------------+--------------------------------------
Not sure why it was comparing the first char of both strings, also think
it shouldn't be case sensitive at all.
{{{
diff --git a/mythtv/libs/libmythmetadata/metadatacommon.cpp
b/mythtv/libs/libmythmetadata/metadatacommon.cpp
index 8a5d29f..6cc1b36 100644
--- a/mythtv/libs/libmythmetadata/metadatacommon.cpp
+++ b/mythtv/libs/libmythmetadata/metadatacommon.cpp
@@ -1374,9 +1374,8 @@ QString nearestName(const QString& actual, const
QStringList& candidates)
QStringList::ConstIterator i = candidates.begin();
while ( i != candidates.end() )
{
- if ( (*i)[0] == actual[0] )
- {
- int delta = editDistance( actual, *i );
+ QString candidate = *i;
+ int delta = editDistance( actual.toLower(),
candidate.toLower() );
if ( delta < deltaBest )
{
deltaBest = delta;
@@ -1387,7 +1386,6 @@ QString nearestName(const QString& actual, const
QStringList& candidates)
{
numBest++;
}
- }
++i;
}
}}}
--
Ticket URL: <http://code.mythtv.org/trac/ticket/11088>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list