本文整理汇总了C#中IMLItem类的典型用法代码示例。如果您正苦于以下问题:C# IMLItem类的具体用法?C# IMLItem怎么用?C# IMLItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMLItem类属于命名空间,在下文中一共展示了IMLItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SetUpdateFlag
//REFACTOR:
internal static void SetUpdateFlag(IMLItem item)
{
if (String.IsNullOrEmpty
(Helpers.GetTagValueFromItem
(item, "ImdbID")))
{
ClearProcessedFlag(item);
return;
}
if (String.IsNullOrEmpty
(Helpers.GetTagValueFromItem
(item, "Year")))
{
ClearProcessedFlag(item);
return;
}
if (String.IsNullOrEmpty
(Helpers.GetTagValueFromItem
(item, "Title")))
{
ClearProcessedFlag(item);
return;
}
if (String.IsNullOrEmpty
(Helpers.GetTagValueFromItem
(item, "OriginalTitle")))
{
ClearProcessedFlag(item);
return;
}
if (String.IsNullOrEmpty
(Helpers.GetTagValueFromItem
(item, "SortTitle")))
{
ClearProcessedFlag(item);
return;
}
item.Tags["E.F.I.-processed"]
= "--processed--";
item.SaveTags();
}
开发者ID:stavrossk,项目名称:Easy_Film_Importer_for_MeediOS,代码行数:61,代码来源:SetFilmItemProcessingFlags.cs
示例2: ConstructMoveLocation
private static bool ConstructMoveLocation(IMLItem item,
string extension, out string locationToMove)
{
bool cancelMoving;
if (!Settings.SortingDestinationMusic.EndsWith(@"\"))
Settings.SortingDestinationMusic = Settings.SortingDestinationMusic + @"\";
string directoryToMove = ConstructMoveDirectory
(item, out cancelMoving);
string newFilename;
if (ConstructNewFilename(item, out newFilename))
{
locationToMove = null;
return true;
}
if (!directoryToMove.EndsWith(@"\"))
directoryToMove = directoryToMove + @"\";
locationToMove = directoryToMove +
newFilename + extension;
return cancelMoving;
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:MusicTrackItemUpdaterHelpers.cs
示例3: DownloadSeriesInformation
internal static void DownloadSeriesInformation(IMLItem item, string parentDir,
ref string seriesName, ref string seriesID, bool fileServerIsOnline,
bool isUNC, TVDBLib tvdb,string mdfSettingsb, IBaseSystem iBaseSystem )
{
if (String.IsNullOrEmpty(seriesName))
return;
WebClient client = new WebClient();
bool foundSeries;
TVdbTvEpisodeDetailsDownloaderHelpers.NormalizeSeriesName(ref seriesName);
if (TVdbTvEpisodeDetailsDownloaderHelpers.GetSeriesMatchFromSectionOrTVDb(item, ref seriesName, out seriesID,
tvdb, mdfSettingsb, iBaseSystem, out foundSeries))
return;
GetEpisodeKeysFromItemTagsAndPopulateEpisodeMetadata(item, seriesName,
seriesID, fileServerIsOnline, isUNC, tvdb, mdfSettingsb,
iBaseSystem, client, foundSeries);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:26,代码来源:TVDbTvEpisodeDetailsDownloader.cs
示例4: ApplyRulesToItem
public void ApplyRulesToItem(IMLItem item)
{
foreach (ReplacementRulesGroup group in this.ruleGroups)
{
group.ApplyRulesToItem(item);
}
}
开发者ID:stavrossk,项目名称:File_Importer_for_MeediOS,代码行数:7,代码来源:ReplacementRules.cs
示例5: SaveXmlDocument
internal static bool WriteMovieDescriptor
(IMLItem item, string itemTitle,
string imdbid, string filmFolder,
bool fileServerIsOnline, bool isUNC)
{
string movieHash = Helpers.GetTagValueFromItem(item, "Hash");
string title = Helpers.GetTagValueFromItem(item, "Title");
if (!ReturnCases(fileServerIsOnline, isUNC, title, movieHash))
return false;
var xmlpath = ConstructXmlDescriptorFilePath(item, filmFolder, movieHash);
if (DescriptorAlreadyExists(item, xmlpath))
return true;
var doc = ConstructMovieXmlDescriptorFromSectionItem(item, itemTitle, imdbid, movieHash);
return SaveXmlDocument(item, filmFolder, doc, xmlpath);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:28,代码来源:MovieDescriptorWriter.cs
示例6: ConstructExtractedSubtitleFilename
internal static string ConstructExtractedSubtitleFilename(IMLItem item, string zipfilePath, out string subtitleExtension)
{
string subtitleFilename =
RecognizeCorrectSubtitle(zipfilePath);
if (String.IsNullOrEmpty(subtitleFilename))
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
"Could not extract subtitle. The archive is corrupt.");
Debugger.LogMessageToFile("Could not extract subtitle for "
+ item.Name + ". The archive is corrupt.");
Thread.Sleep(Settings.SleepValue);
subtitleExtension = null;
return subtitleFilename;
}
subtitleExtension = subtitleFilename.Remove(0, subtitleFilename.Length - 4);
return subtitleFilename;
}
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:26,代码来源:VideoSubtitleDownloaderHelpers.cs
示例7:
private static void DeleteMediaImagesAndLibraryItem
(IMLSection section, IMLItem item)
{
Debugger.LogMessageToFile(String.Format("The non-existent item {0}will be deleted from section.",
item.Name));
Helpers.UpdateProgress
("Performing Diagnostic Operations",
String.Format("The non-existent item " +
"{0} will be deleted from section.",
item.Name), item);
Thread.Sleep(100);
string imageFile = item.ImageFile;
string fanart = (string) item.Tags["fanart"];
DeleteCoverAndFanartImages
(fanart, imageFile);
section.DeleteItem(item);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:30,代码来源:MissingItemRemover.cs
示例8: UploadVideoHash
public static bool UploadVideoHash(IMLItem Item, string location, string imdbid, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC)
{
if (String.IsNullOrEmpty(imdbid))
{
Debugger.LogMessageToFile("[OSdb movie hash uploader] This video's IMDb ID is not available. Uploading of it's file hash cannot be performed.");
return false;
}
if (!FileServerIsOnline && IsUNC)
{
Debugger.LogMessageToFile("[OSdb movie hash uploader] Your file server is offline. ");
return false;
}
if (!File.Exists(location))
return false;
string moviehash = Helpers.GetTagValueFromItem(Item, "VideoHash");
if (String.IsNullOrEmpty(moviehash))
return false;
#region get file info
Debugger.LogMessageToFile("[OSdb movie hash uploader] Extracting file information for movie hash uploading...");
FileInfo file = new FileInfo(location);
long filesize = file.Length;
string imdbidNumOnly = imdbid.Remove(0, 2);
#endregion
return PerformUploading(Item, moviehash, connectionresult, filesize, imdbidNumOnly);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:OSdbMovieHashUploader.cs
示例9: ReturnCases
private static bool ReturnCases(bool deleteMissingLibraryEntries,
bool isUNC, bool fileServerIsOnline, string location,
IMLItem item)
{
if (!deleteMissingLibraryEntries)
return false;
//if (!location.StartsWith(Settings.DvdDrive) || String.IsNullOrEmpty(Settings.DvdDrive))
//{
if (isUNC && !fileServerIsOnline)
return false;
Debugger.LogMessageToFile(String.Format("Validating item {0}...", item.Name));
Helpers.UpdateProgress("Performing Diagnostic Operations", String.Format("Validating item {0}...", item.Name), item);
return !File.Exists(location);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:25,代码来源:MissingItemRemover.cs
示例10: FileIsInUse
public static void FileIsInUse(string location,
bool fileServerIsOnline,
IMLItem item)
{
if (!fileServerIsOnline)
return;
try
{
Debugger.LogMessageToFile("Checking if file is in use...");
var filestream = File.OpenRead(location);
filestream.Close();
Settings.FileInUse = false;
}
catch (Exception)
{
Debugger.LogMessageToFile(String.Format
("The file {0} is in use by another program.", location));
UpdateProgress
("Performing diagnostics",
String.Format
("This item's media file {0} " +
"is in use by another program." +
" MediFairy can not perform" +
" this operation.", location));
Thread.Sleep(1500);
Settings.FileInUse = true;
}
}
开发者ID:stavrossk,项目名称:Easy_Film_Importer_for_MeediOS,代码行数:33,代码来源:Helpers.cs
示例11: DeleteSubtitleZipFile
internal static bool CheckForExistingSubtitleSetHasSubtitleFlag
(string itemName, IMLItem item, string parentPath,
string subfilePathSrt, string subfilePathSub)
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
"Determining if subtitle exists for " + item.Name);
if (File.Exists(subfilePathSrt) || File.Exists(subfilePathSub))
{
item.Tags["HasSubtitle"] = "True";
item.SaveTags();
DeleteSubtitleZipFile(itemName, parentPath);
return false;
}
return true;
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:26,代码来源:VideoSubtitleDownloaderHelpers.cs
示例12: ParseChildNodes
private static bool ParseChildNodes(IMLItem item, string title, string videoHash, IEnumerable nodelist)
{
foreach (XmlNode childnode in
from XmlNode node in nodelist
where node.HasChildNodes
from XmlNode childnode
in node.ChildNodes
select childnode)
{
if (!ReadVideoHashAndTitle
(item, videoHash,
title, childnode))
return false;
ReadAdditonalDetails
(item, childnode);
item.SaveTags();
}
return true;
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:25,代码来源:MovieDescriptorReader.cs
示例13: PerformUploading
private static bool PerformUploading(IMLItem Item, string moviehash, ConnectionResult connectionresult, long filesize, string imdbidNumOnly)
{
try
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Updating video definitions database...");
InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
imdbidNumOnly);
return true;
}
catch
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
"Osdb database did not respond. Retrying...");
Thread.Sleep(3000);
try
{
InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
imdbidNumOnly);
return true;
}
catch
{
Debugger.LogMessageToFile("Unable to communicate with OSdb. Video hash was not uploaded.");
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
"Unable to communicate with OSdb. Video hash was not uploaded.");
return false;
}
}
}//endof method
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:32,代码来源:OSdbMovieHashUploader.cs
示例14: IdentifyMovieByVideoFingerprint
internal static string IdentifyMovieByVideoFingerprint(IMLItem item, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC, string location, string parent )
{
#region function variables
string moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");
string imdbid = Helpers.GetTagValueFromItem(item,"ImdbID");
#endregion
if (!String.IsNullOrEmpty(imdbid))
return imdbid;
#region Compute Hash
if (String.IsNullOrEmpty(moviehash))
{
//if ( Importer.EnableHashing)
//{
if (!IsUNC || FileServerIsOnline)
{
if (File.Exists(location))
{
Debugger.LogMessageToFile("Computing video fingerprint for " + item.Name + "...");
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Computing video fingerprint for " + item.Name + "...");
Thread.Sleep(200);
moviehash = Hasher.ComputeHash(location, item);
item.Tags["VideoHash"] = moviehash;
item.SaveTags();
}
else
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "The video file in location field was not found. MediaFairy cannot identify this film.");
Thread.Sleep(Settings.SleepValue);
}
}
//}
}
else moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");
item.SaveTags();
#endregion
MovieDescriptorReader.ReadMovieDescriptor(item, moviehash, parent, item.Name );
if (Settings.PrimaryVideoFingerprintMatchingSource == "OSDb")
{
OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
imdbid = TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
}
else
{
TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
imdbid = OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
}
return imdbid;
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:59,代码来源:VideoFingerprintIdentifier.cs
示例15: RetrieveFileHash
internal static void RetrieveFileHash(IMLItem item, string location)
{
if (CheckForExistingHash(item))
return;
CalculateAndSaveHashToLibrary
(item, location);
}
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:8,代码来源:VideoHashConstructor.cs
示例16: foreach
internal static void LinkFilmItemChains
(IMLSection moviesSection,
IMLItemList allFilmItems,
IMLItem Item)
{
if (!MeediFier.Settings
.FilmItemChainLinkerIsEnabled)
return;
if (allFilmItems == null
|| allFilmItems.Count <= 0)
return;
MainImportingEngine.ThisProgress.Progress
(MainImportingEngine.CurrentProgress,
"scanning for un-linked files...");
Application.DoEvents();
foreach (IMLItem item in allFilmItems)
{
string itemImdbID = Helpers
.GetTagValueFromItem
(item, "ImdbID");
string itemToCompareImdbID = Helpers
.GetTagValueFromItem
(Item, "ImdbID");
if (item.Location == Item.Location
|| itemImdbID != itemToCompareImdbID)
continue;
if (item.Location.StartsWith("|")
|| Item.Location.StartsWith("|"))
continue;
Item.Location =
"|" + Item.Location +
"|" + item.Location + "|";
Item.SaveTags();
moviesSection.DeleteItem(item);
}
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:58,代码来源:FilmItemChainLinker.cs
示例17:
private static void GetEpisodeKeysFromItemTagsAndPopulateEpisodeMetadata
(IMLItem item, string seriesName,
string seriesID, bool fileServerIsOnline,
bool isUNC, TVDBLib tvdb, string mdfSettingsb,
IBaseSystem iBaseSystem, WebClient client,
bool foundSeries)
{
if (!foundSeries)
{
MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
"Series with name " + seriesName + " was not found.");
Thread.Sleep(2000);
return;
}
string episodeID = Helpers.GetTagValueFromItem(item, "EpisodeID");
if (!String.IsNullOrEmpty(episodeID))
return;
int episodeNumber;
int seasonNumber;
if (TVdbTvEpisodeDetailsDownloaderHelpers
.GetEpisodeKeysFromItemTags
(item, out episodeNumber, out seasonNumber))
return;
if (seasonNumber == 0 || episodeNumber == 0)
return;
ITVDBEpisode episode;
ITVDBSeries series;
if (TVdbTvEpisodeDetailsDownloaderHelpers
.GetSeriesAndEpisodeFromTVDb(seriesName, seriesID, tvdb,
episodeNumber, seasonNumber,
out episode, out series))
return;
TVdbTvEpisodeDetailsDownloaderHelpers
.PopulateEpisodeMetadata
(item, fileServerIsOnline, isUNC,
mdfSettingsb,
iBaseSystem, seasonNumber, client,
series,
episode);
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:57,代码来源:TVDbTvEpisodeDetailsDownloader.cs
示例18: GetSubtitleForVideo
internal static bool GetSubtitleForVideo(string videoHash, string imdbid,
string language, string logintoken, IMLItem item,
string parentPath, string videoFilename, bool isMovie)
{
#region vars
WebClient webClient = new WebClient();
webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
string firstsub = string.Empty;
FastZip fz = new FastZip();
#endregion
if (string.IsNullOrEmpty(parentPath))
return false;
if (!parentPath.EndsWith(@"\"))
parentPath += @"\";
string zipfilePath = parentPath + videoHash + ".zip";
try
{
firstsub = VideoSubtitleDownloaderHelpers.SearchForSubtitleByVideoHashParent(videoHash, language);
if (!VideoSubtitleDownloaderHelpers.SearchForSubtitleByIMDbIdParent(imdbid, language,
logintoken, item, isMovie, ref firstsub))
return false;
if (!VideoSubtitleDownloaderHelpers.PerformSubtitleDownload(item, zipfilePath, webClient, firstsub))
return false;
}
catch (Exception e)
{
MessageBox.Show(@"An error occured while trying to download
the subtitle on online address: " + firstsub + @" to local location: "
+ zipfilePath + @". The error was: " + e);
Debugger.LogMessageToFile("Error occured in subtitles downloading function: "
+ e + ". The intented subtitle zip location was: " + zipfilePath +
" and oline subtitle location was: " + firstsub);
return false;
}
if (!VideoSubtitleDownloaderHelpers.ValidateDownloadedDataAndRetry(language, item,
firstsub, webClient, zipfilePath))
return false;
VideoSubtitleDownloaderHelpers.ExtractAndRenameSubtitle(language, item, parentPath,
videoFilename, zipfilePath, fz);
return true;
}
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:57,代码来源:VideoSusbtitleDownloader.cs
示例19: DescriptorAlreadyExists
internal static bool DescriptorAlreadyExists(IMLItem item, string xmlpath)
{
if (File.Exists(xmlpath))
{
item.Tags["HasDescriptor"] = "true";
item.SaveTags();
return true;
}
return false;
}
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:10,代码来源:MovieDescriptorWriter.cs
示例20: ApplyRulesToItem
public void ApplyRulesToItem(IMLItem item)
{
foreach (ReplacementRule rule in this.rules)
{
if (rule.ApplyRuleToItem(item))
{
break;
}
}
}
开发者ID:stavrossk,项目名称:File_Importer_for_MeediOS,代码行数:10,代码来源:ReplacementRulesGroup.cs
注:本文中的IMLItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论