Skip to content

Commit

Permalink
[subtitles] check and get idx/sub pair when download.
Browse files Browse the repository at this point in the history
  • Loading branch information
taxigps committed Dec 5, 2013
1 parent dd4dd2e commit 43044cd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions xbmc/video/dialogs/GUIDialogSubtitles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,19 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s

// and copy the file across
CFile::Cache(strUrl, strSubPath);

// for ".sub" subtitles we check if ".idx" counterpart exists and copy that as well
if (strSubExt.Equals(".sub"))
{
strUrl = URIUtils::ReplaceExtension(strUrl, ".idx");
if(CFile::Exists(strUrl))
{
CStdString strSubNameIdx = StringUtils::Format("%s.%s.idx", strFileName.c_str(), strSubLang.c_str());

This comment has been minimized.

Copy link
@Karlson2k

Karlson2k Dec 6, 2013

Member

@taxigps Is CStdString required?

This comment has been minimized.

Copy link
@amet

amet Dec 6, 2013

Contributor

its just a c/p of the few lines up

CStdString strSubName ...

This comment has been minimized.

Copy link
@Karlson2k

This comment has been minimized.

Copy link
@amet

amet Dec 6, 2013

Contributor

yes boss, but poink everyone on it then... not just selected :)

This comment has been minimized.

Copy link
@Karlson2k

Karlson2k Dec 6, 2013

Member

Already. If I missed something, just say where.

This comment has been minimized.

Copy link
@taxigps

taxigps Dec 7, 2013

Author Member

so it's your mistake @amet :) shall I change the code to std::string?

This comment has been minimized.

Copy link
@amet

amet Dec 7, 2013

Contributor

the whole 'GUIDialogSubtitles.cpp' has been added not even a month ago, and there were no complaints.

I'll look into changing them all in few days

This comment has been minimized.

Copy link
@amet

amet Dec 7, 2013

Contributor

@taxigps no problem, i'll do the whole thing, unless you want to

strSubPath = URIUtils::AddFileToFolder(strDestPath, strSubNameIdx);
CFile::Cache(strUrl, strSubPath);
}
}

SetSubtitles(strSubPath);
// Close the window
Close();
Expand Down

0 comments on commit 43044cd

Please sign in to comment.