本文整理汇总了C#中Title.CopyMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# Title.CopyMetadata方法的具体用法?C# Title.CopyMetadata怎么用?C# Title.CopyMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Title
的用法示例。
在下文中一共展示了Title.CopyMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetadataSearchUsingPreferred
/// <summary>
/// Looksup the preferred metadata on the passed in title
/// </summary>
/// <param name="title"></param>
/// <returns></returns>
public bool MetadataSearchUsingPreferred(Title title)
{
Title SearchResult;
int? SeasonNo = null;
int? EpisodeNo = null;
bool retval = false;
if (((title.TitleType & TitleTypes.Episode) != 0) ||
((title.TitleType & TitleTypes.Season) != 0) ||
((title.TitleType & TitleTypes.TVShow) != 0))
{
// TV Search
if (title.SeasonNumber != null) SeasonNo = title.SeasonNumber.Value;
if (title.EpisodeNumber != null) EpisodeNo = title.EpisodeNumber.Value;
string Showname = null;
// Try to find show name be looking up the folder structure.
Title parenttitle = title;
while ((parenttitle.TitleType & TitleTypes.Root) == 0)
{
// Get parent
parenttitle = parenttitle.ParentTitle;
if ((parenttitle.TitleType & TitleTypes.TVShow) != 0)
{
Showname = parenttitle.Name;
break;
}
}
if (string.IsNullOrEmpty(Showname))
{
// Cannot find a show name in the folder structure
//return StartMetadataImport(title, plugin, coverArtOnly, title.Name, "", SeasonNo, EpisodeNo);
retval = MetadataSearchUsingPreferred(title.TitleType, title.Name, "", SeasonNo, EpisodeNo, out SearchResult);
}
else
{
//return StartMetadataImport(title, plugin, coverArtOnly, Showname, title.Name, SeasonNo, EpisodeNo);
retval = MetadataSearchUsingPreferred(title.TitleType, Showname, title.Name, SeasonNo, EpisodeNo, out SearchResult);
}
}
else
{
// Movie Search
//return StartMetadataImport(title, plugin, coverArtOnly, title.Name, "", SeasonNo, EpisodeNo);
retval = MetadataSearchUsingPreferred(title.TitleType, title.Name, "", SeasonNo, EpisodeNo, out SearchResult);
}
if (retval)
{
// Successful lookup, process
if (((title.TitleType & TitleTypes.Season) != 0) ||
((title.TitleType & TitleTypes.TVShow) != 0) ||
((title.TitleType & TitleTypes.Episode) != 0))
{
// Use the preferred overwrite settings for TV
title.CopyMetadata(SearchResult, OMLEngine.Settings.OMLSettings.MetadataLookupOverwriteExistingDataPrefTV,
OMLEngine.Settings.OMLSettings.MetadataLookupUpdateNamePrefTV,
OMLEngine.Settings.OMLSettings.MetadataLookupOverwriteExistingDataPrefTV);
}
else
{
// Use the preferred overwrite settings for Movies
title.CopyMetadata(SearchResult, OMLEngine.Settings.OMLSettings.MetadataLookupOverwriteExistingDataPrefMovies,
OMLEngine.Settings.OMLSettings.MetadataLookupUpdateNamePrefMovies,
OMLEngine.Settings.OMLSettings.MetadataLookupOverwriteExistingDataPrefMovies);
}
//LoadFanart(mds.FanArt, title); -- Do this in the calling program (may need to provide user feedback of progress
}
return retval;
}