예제 #1
0
        private ItemStub GetItemStub(BaseItem item, ImageType imageType)
        {
            var stub = new ItemStub
            {
                Id        = _dtoService.GetDtoId(item),
                Name      = item.Name,
                ImageType = imageType
            };

            try
            {
                var tag = _imageProcessor.GetImageCacheTag(item, imageType);

                if (tag.HasValue)
                {
                    stub.ImageTag = tag.Value;
                }
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting image tag for {0}", ex, item.Path);
                return(null);
            }

            return(stub);
        }
예제 #2
0
        private ItemStub GetItemStub(BaseItem item, ImageType imageType)
        {
            var stub = new ItemStub
            {
                Id   = _dtoService.GetDtoId(item),
                Name = item.Name
            };

            var imageManager = Kernel.Instance.ImageManager;

            try
            {
                var imagePath = imageManager.GetImagePath(item, imageType, 0);

                stub.ImageTag = imageManager.GetImageCacheTag(item, imageType, imagePath);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error getting image tag for {0}", ex, item.Path);
                return(null);
            }

            return(stub);
        }