本文整理汇总了C#中MediaPortal.Video.Database.IMDBMovie.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# IMDBMovie.Reset方法的具体用法?C# IMDBMovie.Reset怎么用?C# IMDBMovie.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.Video.Database.IMDBMovie
的用法示例。
在下文中一共展示了IMDBMovie.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetMovieProperties
private void SetMovieProperties(string path)
{
bool isFile = false;
if (Util.Utils.IsVideo(path))
isFile = true;
IMDBMovie info = new IMDBMovie();
if (path == "..")
{
info.Reset();
info.SetProperties(true);
return;
}
bool isDirectory = false;
bool isMultiMovieFolder = false;
bool isFound = false;
try
{
if (Directory.Exists(path))
{
isDirectory = true;
string[] files = Directory.GetFiles(path);
foreach (string file in files)
{
IMDBMovie movie = new IMDBMovie();
VideoDatabase.GetMovieInfo(file, ref movie);
if (!movie.IsEmpty)
{
if (!isFound)
{
info = movie;
isFound = true;
}
else
{
isMultiMovieFolder = true;
break;
}
}
}
}
else
{
VideoDatabase.GetMovieInfo(path, ref info);
}
if (info.IsEmpty)
{
FetchMatroskaInfo(path, isDirectory, ref info);
}
if (info.IsEmpty && File.Exists(path + @"\VIDEO_TS\VIDEO_TS.IFO")) //still empty and is ripped DVD
{
VideoDatabase.GetMovieInfo(path + @"\VIDEO_TS\VIDEO_TS.IFO", ref info);
isFile = true;
}
if (info.IsEmpty)
{
if (_markWatchedFiles)
{
int fID = VideoDatabase.GetFileId(path);
byte[] resumeData = null;
int timeStopped = VideoDatabase.GetMovieStopTimeAndResumeData(fID, out resumeData);
if (timeStopped > 0 || resumeData != null)
info.Watched = 1;
}
}
if (isMultiMovieFolder || !isFile)
{
info.Reset();
info.SetProperties(true);
return;
}
info.SetProperties(false);
}
catch (Exception) {}
}
示例2: SetMovieProperties
private void SetMovieProperties(string path, string filename)
{
IMDBMovie info = new IMDBMovie();
if (path == ".." || string.IsNullOrEmpty(path) || (!Directory.Exists(path) && !Util.Utils.IsVideo(filename)))
{
info.Reset(true);
info.SetProperties(true, string.Empty);
return;
}
if (Directory.Exists(path) && !Util.Utils.IsVideo(filename))
{
info.SetProperties(true, path);
return;
}
try
{
VideoDatabase.GetMovieInfo(filename, ref info);
// Get recording/nfo xml
if (info.IsEmpty)
{
FetchMatroskaInfo(filename, false, ref info);
if (info.IsEmpty)
{
FetchMovieNfo(path, filename, ref info);
}
}
info.SetProperties(false, filename);
}
catch (Exception)
{
}
}