Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[MediaPortal] TSReader: Don't replace \\ by smb:// when not at the st…
Browse files Browse the repository at this point in the history
…art of the path
  • Loading branch information
margro committed Dec 9, 2013
1 parent f2e974c commit 53885af
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions addons/pvr.mediaportal.tvserver/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,25 +143,28 @@ std::string ToThumbFileName(const char* strChannelName)
std::string ToXBMCPath(const std::string& strFileName)
{
CStdString strXBMCFileName = strFileName;
CStdString SMBPrefix = "smb://";

if (g_szSMBusername.length() > 0)
if (strXBMCFileName.Left(2) == "\\\\")
{
SMBPrefix += g_szSMBusername;
if (g_szSMBpassword.length() > 0)
CStdString SMBPrefix = "smb://";

if (g_szSMBusername.length() > 0)
{
SMBPrefix += ":" + g_szSMBpassword;
SMBPrefix += g_szSMBusername;
if (g_szSMBpassword.length() > 0)
{
SMBPrefix += ":" + g_szSMBpassword;
}
SMBPrefix += "@";
}
SMBPrefix += "@";
}
#ifndef TARGET_WINDOWS
else
{
SMBPrefix += "Guest@";
}
else
{
SMBPrefix += "Guest@";
}
#endif

strXBMCFileName.Replace("\\\\", SMBPrefix);
strXBMCFileName.Replace("\\\\", SMBPrefix);
}
strXBMCFileName.Replace('\\', '/');

return strXBMCFileName;
Expand Down

0 comments on commit 53885af

Please sign in to comment.