本文整理汇总了C#中ItemUpdateType类的典型用法代码示例。如果您正苦于以下问题:C# ItemUpdateType类的具体用法?C# ItemUpdateType怎么用?C# ItemUpdateType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemUpdateType类属于命名空间,在下文中一共展示了ItemUpdateType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on
if (_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded))
{
if (item is MusicArtist)
{
return true;
}
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if (wasMetadataDownloaded || wasMetadataEdited)
{
if (item is Artist)
{
return true;
}
}
return false;
}
示例2: SaveMetadataForItem
private async void SaveMetadataForItem(BaseItem item, ItemUpdateType updateReason)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote ||
locationType == LocationType.Virtual)
{
return;
}
if (!item.SupportsLocalMetadata)
{
return;
}
if (!item.IsSaveLocalMetadataEnabled())
{
return;
}
try
{
await _providerManager.SaveMetadata(item, updateReason, new[] { BaseNfoSaver.SaverName }).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error saving metadata for {0}", ex, item.Path ?? item.Name);
}
}
示例3: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
if (!(item is Folder))
{
return false;
}
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
if ((_config.Configuration.SaveLocalMeta && wasMetadataDownloaded) || wasMetadataEdited)
{
if (!(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) &&
!(item is Season))
{
return true;
}
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if (wasMetadataDownloaded || wasMetadataEdited)
{
if (item is AggregateFolder || item is UserRootFolder || item is CollectionFolder)
{
return true;
}
}
return false;
}
示例4: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on
if (item.IsSaveLocalMetadataEnabled() && (wasMetadataEdited || wasMetadataDownloaded))
{
if (item is MusicArtist)
{
return true;
}
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if (wasMetadataDownloaded || wasMetadataEdited)
{
var artist = item as MusicArtist;
if (artist != null && artist.IsAccessedByName)
{
return true;
}
}
return false;
}
示例5: SaveMetadataForItem
private async void SaveMetadataForItem(BaseItem item, ItemUpdateType updateReason)
{
var userId = Plugin.Instance.Configuration.UserId;
if (!userId.HasValue)
{
return;
}
var locationType = item.LocationType;
if (locationType == LocationType.Remote ||
locationType == LocationType.Virtual)
{
return;
}
try
{
await _providerManager.SaveMetadata(item, updateReason).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error saving metadata for {0}", ex, item.Path ?? item.Name);
}
}
示例6: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
return item is Playlist && updateType >= ItemUpdateType.MetadataImport;
}
示例7: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
return item is MusicAlbum && updateType >= ItemUpdateType.MetadataDownload;
}
示例8: IsEnabledFor
public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
return item is Episode && updateType >= MinimumUpdateType;
}
示例9: IsEnabledFor
public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
return item is Series && updateType >= ItemUpdateType.ImageUpdate;
}
示例10: IsEnabledFor
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
return item is MusicArtist;
}
return false;
}
示例11: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((wasMetadataEdited || wasMetadataDownloaded))
{
return item is Person;
}
return false;
}
示例12: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on
if (_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded))
{
return item is BoxSet;
}
return false;
}
示例13: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on
if (item.IsSaveLocalMetadataEnabled() && (wasMetadataEdited || wasMetadataDownloaded))
{
return item is GameSystem;
}
return false;
}
示例14: IsEnabledFor
/// <summary>
/// Determines whether [is enabled for] [the specified item].
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
{
return item is Series;
}
return false;
}
示例15: IsEnabledFor
public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
if (!(item is Season))
{
return false;
}
return updateType >= ItemUpdateType.ImageUpdate || (updateType >= ItemUpdateType.MetadataImport && File.Exists(GetSavePath(item)));
}