Ejemplo n.º 1
0
        public async Task <ItemUpdateType> FetchAsync(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
        {
            if (!Supports(item))
            {
                return(ItemUpdateType.None);
            }

            var updateType = ItemUpdateType.None;

            if (SupportedImages.Contains(ImageType.Primary))
            {
                var primaryResult = await FetchAsync(item, ImageType.Primary, options, cancellationToken).ConfigureAwait(false);

                updateType = updateType | primaryResult;
            }

            if (SupportedImages.Contains(ImageType.Thumb))
            {
                var thumbResult = await FetchAsync(item, ImageType.Thumb, options, cancellationToken).ConfigureAwait(false);

                updateType = updateType | thumbResult;
            }

            return(updateType);
        }
Ejemplo n.º 2
0
        public bool HasChanged(BaseItem item, IDirectoryService directoryServicee)
        {
            if (!Supports(item))
            {
                return(false);
            }

            if (SupportedImages.Contains(ImageType.Primary) && HasChanged(item, ImageType.Primary))
            {
                return(true);
            }
            if (SupportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb))
            {
                return(true);
            }

            return(false);
        }