本文整理汇总了C#中MediaPortal.Util.VirtualDirectory.GetDirectoryUnProtectedExt方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualDirectory.GetDirectoryUnProtectedExt方法的具体用法?C# VirtualDirectory.GetDirectoryUnProtectedExt怎么用?C# VirtualDirectory.GetDirectoryUnProtectedExt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.Util.VirtualDirectory
的用法示例。
在下文中一共展示了VirtualDirectory.GetDirectoryUnProtectedExt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVideoFiles
public void GetVideoFiles(string path, ref ArrayList availableFiles)
{
//
// Count the files in the current directory
//
try
{
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(Util.Utils.VideoExtensions);
ArrayList imagePath = new ArrayList();
// Thumbs creation spam no1 causing this call
//
// Temporary disable thumbcreation
//
using (Settings xmlReaderWriter = new MPSettings())
{
_currentCreateVideoThumbs = xmlReaderWriter.GetValueAsBool("thumbnails", "tvrecordedondemand", true);
xmlReaderWriter.SetValueAsBool("thumbnails", "tvrecordedondemand", false);
}
List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
if (item.Label != "..")
{
if (item.Path.ToUpperInvariant().IndexOf(@"\VIDEO_TS") >= 0)
{
string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
availableFiles.Add(strFile);
}
else if (item.Path.ToUpperInvariant().IndexOf(@"\BDMV") >= 0)
{
string strFile = String.Format(@"{0}\index.bdmv", item.Path);
availableFiles.Add(strFile);
}
else
{
GetVideoFiles(item.Path, ref availableFiles);
}
}
}
else
{
bool skipDuplicate = false;
if (VirtualDirectory.IsImageFile(Path.GetExtension(item.Path)))
{
string filePath = Path.GetDirectoryName(item.Path) + @"\" + Path.GetFileNameWithoutExtension(item.Path);
if (!imagePath.Contains(filePath))
{
imagePath.Add(filePath);
}
else
{
skipDuplicate = true;
}
}
if (!skipDuplicate)
{
string extension = Path.GetExtension(item.Path);
if (extension != null && extension.ToUpperInvariant() != @".IFO" && extension.ToUpperInvariant() != ".BDMV")
{
availableFiles.Add(item.Path);
}
}
}
}
}
catch (Exception e)
{
Log.Info("VideoDatabase: Exception counting video files:{0}", e);
}
finally
{
// Restore thumbcreation setting
using (Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", _currentCreateVideoThumbs);
}
}
}
示例2: AddVideoFiles
private static void AddVideoFiles(string path, ref ArrayList availableFiles)
{
//
// Count the files in the current directory
//
bool currentCreateVideoThumbs = false;
try
{
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(Util.Utils.VideoExtensions);
// Temporary disable thumbcreation
using (Profile.Settings xmlreader = new MPSettings())
{
currentCreateVideoThumbs = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
}
using (Profile.Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "videoondemand", false);
}
List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
if (item.Label != "..")
{
if (item.Path.ToUpperInvariant().IndexOf("VIDEO_TS") >= 0)
{
string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
availableFiles.Add(strFile);
}
if (item.Path.ToUpperInvariant().IndexOf("BDMV") >= 0)
{
string strFile = String.Format(@"{0}\index.bdmv", item.Path);
availableFiles.Add(strFile);
}
else
{
AddVideoFiles(item.Path, ref availableFiles);
}
}
}
else
{
availableFiles.Add(item.Path);
}
}
}
catch (Exception e)
{
Log.Info("Exception counting files:{0}", e);
// Ignore
}
finally
{
// Restore thumbcreation setting
using (Profile.Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "videoondemand", currentCreateVideoThumbs);
}
}
}
示例3: ListFilesForUpdateMediaInfo
private void ListFilesForUpdateMediaInfo(GUIListItem item, ref List<GUIListItem> itemlist)
{
if (item != null)
{
// Process the list of files found in the directory.
VirtualDirectory virtualDirectory = new VirtualDirectory();
virtualDirectory.SetExtensions(Util.Utils.VideoExtensions);
List<GUIListItem> inertItemlist = virtualDirectory.GetDirectoryUnProtectedExt(item.Path, true);
foreach (GUIListItem subItem in inertItemlist)
{
if (!subItem.IsFolder)
{
itemlist.Add(subItem);
}
else
{
if (subItem.Label != "..")
{
ListFilesForUpdateMediaInfo(subItem, ref itemlist);
}
}
}
}
}
示例4: GetInfoFromIMDB
public static bool GetInfoFromIMDB(IMDB.IProgress progress, ref IMDBMovie movieDetails, bool isFuzzyMatching,
bool getActors)
{
string file;
string path = movieDetails.Path;
string filename = movieDetails.File;
if (path != string.Empty)
{
if (path.EndsWith(@"\"))
{
path = path.Substring(0, path.Length - 1);
movieDetails.Path = path;
}
if (filename.StartsWith(@"\"))
{
filename = filename.Substring(1);
movieDetails.File = filename;
}
file = path + Path.DirectorySeparatorChar + filename;
}
else
{
file = filename;
}
bool addToDB = true;
int id = movieDetails.ID;
if (id < 0)
{
if (File.Exists(file))
{
id = VideoDatabase.AddMovieFile(file);
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(Util.Utils.VideoExtensions);
// Thumb creation spam no2 causing this call
//
// Temporary disable thumbcreation
//
using (Settings xmlreader = new MPSettings())
{
_currentCreateVideoThumbs = xmlreader.GetValueAsBool("thumbnails", "tvrecordedondemand", true);
}
using (Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", false);
}
List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
continue;
}
if (Util.Utils.ShouldStack(item.Path, file) && item.Path != file)
{
string strPath, strFileName;
DatabaseUtility.Split(item.Path, out strPath, out strFileName);
DatabaseUtility.RemoveInvalidChars(ref strPath);
DatabaseUtility.RemoveInvalidChars(ref strFileName);
int pathId = VideoDatabase.AddPath(strPath);
VideoDatabase.AddFile(id, pathId, strFileName);
}
}
// Restore thumbcreation setting
using (Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", _currentCreateVideoThumbs);
}
movieDetails.ID = id;
}
else
{
Log.Info("File doesn't exists. So no info is stored in db.");
getActors = false;
addToDB = false;
}
}
if (RefreshIMDB(progress, ref movieDetails, isFuzzyMatching, getActors, addToDB))
{
if (movieDetails != null)
{
return true;
}
}
return false;
}
示例5: CountFiles
private static void CountFiles(string path, ref ArrayList availableFiles)
{
//
// Count the files in the current directory
//
try
{
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(Util.Utils.PictureExtensions);
List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
if (item.Label != "..")
{
CountFiles(item.Path, ref availableFiles);
CreateThumbsAndAddPictureToDBFolderThread ManualThumbBuilderFolder =
new CreateThumbsAndAddPictureToDBFolderThread(item.Path);
}
}
else
{
availableFiles.Add(item.Path);
}
}
}
catch (Exception e)
{
Log.Info("Exception counting files:{0}", e);
// Ignore
}
}
示例6: CountFiles
/// <summary>
///
/// </summary>
/// <param name="path"></param>
/// <param name="availableFiles"></param>
private static void CountFiles(string path, ref ArrayList availableFiles)
{
//
// Count the files in the current directory
//
try
{
VirtualDirectory dir = new VirtualDirectory();
dir.SetExtensions(Util.Utils.VideoExtensions);
// Thumbs creation spam no1 causing this call
//
// Temporary disable thumbcreation
//
using (Settings xmlreader = new MPSettings())
{
_currentCreateVideoThumbs = xmlreader.GetValueAsBool("thumbnails", "tvrecordedondemand", true);
}
using (Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", false);
}
List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
foreach (GUIListItem item in items)
{
if (item.IsFolder)
{
if (item.Label != "..")
{
if (item.Path.ToLower().IndexOf("video_ts") >= 0)
{
string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
availableFiles.Add(strFile);
}
else
{
CountFiles(item.Path, ref availableFiles);
}
}
}
else
{
availableFiles.Add(item.Path);
}
}
}
catch (Exception e)
{
Log.Info("Exception counting files:{0}", e);
// Ignore
}
finally
{
// Restore thumbcreation setting
using (Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", _currentCreateVideoThumbs);
}
}
}