Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coveo Image Url #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Dianoga/NextGenFormats/MediaProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
public class MediaProvider : Sitecore.Resources.Media.MediaProvider
{

public override string GetMediaUrl(MediaItem item, MediaUrlOptions options)

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

Member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' overrides obsolete member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'. Add the Obsolete attribute to 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'.

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

Member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' overrides obsolete member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'. Add the Obsolete attribute to 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'.

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

Member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' overrides obsolete member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'. Add the Obsolete attribute to 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'.

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

Member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' overrides obsolete member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'. Add the Obsolete attribute to 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'.

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaUrlOptions' is obsolete: 'Please use Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions instead.'

Check warning on line 12 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

Member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' overrides obsolete member 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'. Add the Obsolete attribute to 'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)'.
{
var url = base.GetMediaUrl(item, options);

Check warning on line 14 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' is obsolete: 'Please use GetMediaUrl(MediaItem, MediaUrlBuilderOptions) instead.'

Check warning on line 14 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' is obsolete: 'Please use GetMediaUrl(MediaItem, MediaUrlBuilderOptions) instead.'

Check warning on line 14 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' is obsolete: 'Please use GetMediaUrl(MediaItem, MediaUrlBuilderOptions) instead.'

Check warning on line 14 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' is obsolete: 'Please use GetMediaUrl(MediaItem, MediaUrlBuilderOptions) instead.'

Check warning on line 14 in src/Dianoga/NextGenFormats/MediaProvider.cs

View workflow job for this annotation

GitHub Actions / build

'MediaProvider.GetMediaUrl(MediaItem, MediaUrlOptions)' is obsolete: 'Please use GetMediaUrl(MediaItem, MediaUrlBuilderOptions) instead.'

url = GetMediaUrl(item, url);

Expand All @@ -31,8 +31,11 @@

protected virtual string GetMediaUrl(MediaItem item, string url)
{

var helpers = new Helpers();
if (item.MimeType.StartsWith("image") && !url.Contains("extension"))
if (HttpContext.Current != null
&& item.MimeType.StartsWith("image")
&& !url.Contains("extension"))
{
var extensions = helpers.GetSupportedFormats(new HttpContextWrapper(HttpContext.Current));
if (!string.IsNullOrEmpty(extensions))
Expand Down
Loading