aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jcmarsha@gmail.com>2014-04-18 20:28:25 +1200
committerJonathan Marshall <jmarshall@xbmc.org>2014-04-26 09:10:36 +1200
commitce273ed609ddd1199c84f3d0485bd271cb9c8081 (patch)
tree1723cbf182db445a4f99b53e3709c1477a34c958
parent3a1548e5798633accfbbe4e2db0f25de271f8dfa (diff)
Merge pull request #4572 from arnova/rar_subs
fixed: Downloading subs for rars was broken
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitles.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
index b8315aba37..858f1f2a02 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp
+++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
@@ -418,10 +418,9 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s
CStdString strDestPath;
std::vector<CStdString> vecFiles;
- CStdString strCurrentFilePath = URIUtils::GetDirectory(strCurrentFile);
+ CStdString strCurrentFilePath;
if (StringUtils::StartsWith(strCurrentFilePath, "http://"))
{
- strCurrentFilePath = "";
strCurrentFile = "TempSubtitle";
vecFiles.push_back(strCurrentFile);
}
@@ -431,6 +430,15 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s
if (!subPath.empty())
strDownloadPath = subPath;
+ /* Get item's folder for sub storage, special case for RAR/ZIP items
+ TODO: We need some way to avoid special casing this all over the place
+ for rar/zip (perhaps modify GetDirectory?)
+ */
+ if (URIUtils::IsInRAR(strCurrentFile) || URIUtils::IsInZIP(strCurrentFile))
+ strCurrentFilePath = URIUtils::GetDirectory(CURL(strCurrentFile).GetHostName());
+ else
+ strCurrentFilePath = URIUtils::GetDirectory(strCurrentFile);
+
// Handle stacks
if (g_application.CurrentFileItem().IsStack() && items->Size() > 1)
{