Skip to content
Permalink
Browse files

Merge remote-tracking branch 'remotes/origin/MP1-4495-BUG-Recordings_…

…in_Subfolders_failed_UNC_used_on_Multi-Seat'
  • Loading branch information...
Sebastiii committed Jun 15, 2014
2 parents 03e2e75 + dce4f08 commit 745e6f4961539c784cd2af3c22ff7bffec9ff533
Showing with 25 additions and 0 deletions.
  1. +25 −0 TvEngine3/TVLibrary/TvPlugin/TvPlugin/TVUtil.cs
@@ -328,6 +328,31 @@ public static string GetFileNameForRecording(Recording rec)
string parentFolderName = dirInfo.Name;
fileName = TVHome.RecordingPath() + "\\" + parentFolderName + "\\" + fileName;
}

fileExists = File.Exists(fileName);

//check with foldername from set UNC Path
if (!fileExists)
{
//Get last foldername of RecordingPath
string parentFolderNameRecording =
Path.GetFileName(TVHome.RecordingPath().TrimEnd(Path.DirectorySeparatorChar));
parentFolderNameRecording = @"\" + parentFolderNameRecording.Replace(@"\", "\"\"") + @"\";
//Replace "\" with "" and add a "\" at the beginning and end (good for searching the path in the recording filename)

//Search the last folder of the set recording path in var rec.FileName
int iPos = rec.FileName.IndexOf(parentFolderNameRecording);
if (iPos != -1)
{
//We have found the last Folder of the set recording path in var rec.FileName

//Cut the first string (ussaly the TV Server Local Path) and remove the last Recording Folder from string
fileName = rec.FileName.Substring(iPos).Replace(parentFolderNameRecording, "");

//Add the recording path
fileName = TVHome.RecordingPath() + "\\" + fileName;
}
}
}
else
{

0 comments on commit 745e6f4

Please sign in to comment.
You can’t perform that action at this time.