|
@ -5,11 +5,7 @@ using eShopOnContainers.Core.Models.Catalog; |
|
|
using eShopOnContainers.Core.Services.RequestProvider; |
|
|
using eShopOnContainers.Core.Services.RequestProvider; |
|
|
using eShopOnContainers.Core.Extensions; |
|
|
using eShopOnContainers.Core.Extensions; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using eShopOnContainers.ViewModels.Base; |
|
|
|
|
|
using eShopOnContainers.Core.Helpers; |
|
|
using eShopOnContainers.Core.Helpers; |
|
|
using Xamarin.Forms; |
|
|
|
|
|
using eShopOnContainers.Core.Services.IPAddress; |
|
|
|
|
|
using System.Text.RegularExpressions; |
|
|
|
|
|
|
|
|
|
|
|
namespace eShopOnContainers.Core.Services.Catalog |
|
|
namespace eShopOnContainers.Core.Services.Catalog |
|
|
{ |
|
|
{ |
|
@ -61,22 +57,7 @@ namespace eShopOnContainers.Core.Services.Catalog |
|
|
|
|
|
|
|
|
if (catalog?.Data != null) |
|
|
if (catalog?.Data != null) |
|
|
{ |
|
|
{ |
|
|
// TODO: Experimental
|
|
|
|
|
|
if (!ViewModelLocator.Instance.UseMockService && Settings.UrlBase != GlobalSetting.DefaultEndpoint) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var catalogItem in catalog?.Data) |
|
|
|
|
|
{ |
|
|
|
|
|
//string ipaddress = DependencyService.Get<IIPAddressService>().GetIPAddress();
|
|
|
|
|
|
Regex ip = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"); |
|
|
|
|
|
MatchCollection result = ip.Matches(catalogItem.PictureUri); |
|
|
|
|
|
|
|
|
|
|
|
if (result.Count != -1) |
|
|
|
|
|
{ |
|
|
|
|
|
var serviceIp = result[0].Value; |
|
|
|
|
|
catalogItem.PictureUri = catalogItem.PictureUri.Replace(serviceIp, Settings.UrlBase); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ServicesHelper.FixCatalogItemPictureUri(catalog?.Data); |
|
|
|
|
|
|
|
|
return catalog?.Data.ToObservableCollection(); |
|
|
return catalog?.Data.ToObservableCollection(); |
|
|
} |
|
|
} |
|
|