当前位置: 首页>>代码示例>>C#>>正文


C# ItemUpdateType类代码示例

本文整理汇总了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;
        }
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:31,代码来源:ArtistXmlSaver.cs

示例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);
            }
        }
开发者ID:t-andre,项目名称:Emby,代码行数:28,代码来源:EntryPoint.cs

示例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;
        }
开发者ID:0sm0,项目名称:MediaBrowser,代码行数:37,代码来源:FolderXmlSaver.cs

示例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;
        }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:32,代码来源:ArtistXmlSaver.cs

示例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);
            }
        }
开发者ID:WWWesten,项目名称:MediaBrowser.Plugins,代码行数:25,代码来源:EntryPoint.cs

示例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;
        }
开发者ID:redteamcpu,项目名称:Emby,代码行数:15,代码来源:PlaylistXmlSaver.cs

示例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;
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:15,代码来源:AlbumXmlSaver.cs

示例8: IsEnabledFor

        public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
        {
            if (!item.SupportsLocalMetadata)
            {
                return false;
            }

            return item is Episode && updateType >= MinimumUpdateType;
        }
开发者ID:ratanparai,项目名称:Emby,代码行数:9,代码来源:EpisodeNfoSaver.cs

示例9: IsEnabledFor

        public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
        {
            if (!item.SupportsLocalMetadata)
            {
                return false;
            }

            return item is Series && updateType >= ItemUpdateType.ImageUpdate;
        }
开发者ID:Ceten,项目名称:MediaBrowser,代码行数:9,代码来源:SeriesNfoSaver.cs

示例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;
        }
开发者ID:rrb008,项目名称:MediaBrowser.Plugins,代码行数:11,代码来源:ArtistXmlSaver.cs

示例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;
        }
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:19,代码来源:PersonXmlSaver.cs

示例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;
        }
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:19,代码来源:BoxSetXmlSaver.cs

示例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;
        }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:19,代码来源:GameSystemXmlSaver.cs

示例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;
        }
开发者ID:JasoonJ,项目名称:MediaBrowser,代码行数:19,代码来源:SeriesXmlSaver.cs

示例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)));
        }
开发者ID:Ceten,项目名称:MediaBrowser,代码行数:14,代码来源:SeasonNfoSaver.cs


注:本文中的ItemUpdateType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。