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 for duplicate subtitles found on windows #1434

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion xbmc/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,21 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
{
CStdString strPath2 = URIUtils::AddFileToFolder(strLookInPaths[i],common_sub_dirs[j]);
if (CDirectory::Exists(strPath2))
strLookInPaths.push_back(strPath2);
{
//check that no duplicate paths are added for case-insesitive sources e.g.
//subs and Subs would cause duplicate subtitles to be loaded.
bool bInsert = true;
for (int k=0; k<strLookInPaths.size(); k++)
{
if(0 == strLookInPaths[k].CompareNoCase(strPath2))
{
bInsert = false;
break;
}
}
if (bInsert)
strLookInPaths.push_back(strPath2);
}
}
}
// .. done checking for common subdirs
Expand Down