本文整理汇总了C#中JMMServer.Repositories.VideoLocalRepository.GetVideosWithoutVideoInfo方法的典型用法代码示例。如果您正苦于以下问题:C# VideoLocalRepository.GetVideosWithoutVideoInfo方法的具体用法?C# VideoLocalRepository.GetVideosWithoutVideoInfo怎么用?C# VideoLocalRepository.GetVideosWithoutVideoInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JMMServer.Repositories.VideoLocalRepository
的用法示例。
在下文中一共展示了VideoLocalRepository.GetVideosWithoutVideoInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunImport_IntegrityCheck
public static void RunImport_IntegrityCheck()
{
VideoLocalRepository repVidLocals = new VideoLocalRepository();
AniDB_FileRepository repAniFile = new AniDB_FileRepository();
AniDB_EpisodeRepository repAniEps = new AniDB_EpisodeRepository();
AniDB_AnimeRepository repAniAnime = new AniDB_AnimeRepository();
// files which don't have a valid import folder
List<VideoLocal> filesToDelete = repVidLocals.GetVideosWithoutImportFolder();
foreach (VideoLocal vl in filesToDelete)
repVidLocals.Delete(vl.VideoLocalID);
// files which have not been hashed yet
// or files which do not have a VideoInfo record
List<VideoLocal> filesToHash = repVidLocals.GetVideosWithoutHash();
Dictionary<int, VideoLocal> dictFilesToHash = new Dictionary<int, VideoLocal>();
foreach (VideoLocal vl in filesToHash)
{
dictFilesToHash[vl.VideoLocalID] = vl;
CommandRequest_HashFile cmd = new CommandRequest_HashFile(vl.FullServerPath, false);
cmd.Save();
}
List<VideoLocal> filesToRehash = repVidLocals.GetVideosWithoutVideoInfo();
Dictionary<int, VideoLocal> dictFilesToRehash = new Dictionary<int, VideoLocal>();
foreach (VideoLocal vl in filesToHash)
{
dictFilesToRehash[vl.VideoLocalID] = vl;
// don't use if it is in the previous list
if (!dictFilesToHash.ContainsKey(vl.VideoLocalID))
{
try
{
CommandRequest_HashFile cmd = new CommandRequest_HashFile(vl.FullServerPath, false);
cmd.Save();
}
catch (Exception ex)
{
string msg = string.Format("Error RunImport_IntegrityCheck XREF: {0} - {1}", vl.ToStringDetailed(), ex.ToString());
logger.Info(msg);
}
}
}
// files which have been hashed, but don't have an associated episode
List<VideoLocal> filesWithoutEpisode = repVidLocals.GetVideosWithoutEpisode();
Dictionary<int, VideoLocal> dictFilesWithoutEpisode = new Dictionary<int, VideoLocal>();
foreach (VideoLocal vl in filesWithoutEpisode)
dictFilesWithoutEpisode[vl.VideoLocalID] = vl;
// check that all the episode data is populated
List<VideoLocal> filesAll = repVidLocals.GetAll();
Dictionary<string, VideoLocal> dictFilesAllExisting = new Dictionary<string, VideoLocal>();
foreach (VideoLocal vl in filesAll)
{
try
{
dictFilesAllExisting[vl.FullServerPath] = vl;
}
catch (Exception ex)
{
string msg = string.Format("Error RunImport_IntegrityCheck XREF: {0} - {1}", vl.ToStringDetailed(), ex.ToString());
logger.Error(msg);
continue;
}
// check if it has an episode
if (dictFilesWithoutEpisode.ContainsKey(vl.VideoLocalID))
{
CommandRequest_ProcessFile cmd = new CommandRequest_ProcessFile(vl.VideoLocalID, false);
cmd.Save();
continue;
}
// if the file is not manually associated, then check for AniDB_File info
AniDB_File aniFile = repAniFile.GetByHash(vl.Hash);
foreach (CrossRef_File_Episode xref in vl.EpisodeCrossRefs)
{
if (xref.CrossRefSource != (int)CrossRefSource.AniDB) continue;
if (aniFile == null)
{
CommandRequest_ProcessFile cmd = new CommandRequest_ProcessFile(vl.VideoLocalID, false);
cmd.Save();
continue;
}
}
if (aniFile == null) continue;
// the cross ref is created before the actually episode data is downloaded
// so lets check for that
bool missingEpisodes = false;
foreach (CrossRef_File_Episode xref in aniFile.EpisodeCrossRefs)
{
AniDB_Episode ep = repAniEps.GetByEpisodeID(xref.EpisodeID);
if (ep == null) missingEpisodes = true;
//.........这里部分代码省略.........