core: refactor http webclient part 1 #8529 (#7652)

Rename WebClientStringResult.Content to WebClientStringResult.ContentString
This commit is contained in:
Cory
2020-06-09 19:36:57 +02:00
committed by ngosang
parent cf34dfec8e
commit d760350dc0
90 changed files with 380 additions and 380 deletions

View File

@@ -73,18 +73,18 @@ namespace Jackett.Server
// TODO: fix deprecation warning (remove #pragma to see the build warning)
Mapper.Initialize(cfg =>
{
cfg.CreateMap<WebClientByteResult, WebClientStringResult>().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((be, str) =>
cfg.CreateMap<WebClientByteResult, WebClientStringResult>().ForMember(x => x.ContentString, opt => opt.Ignore()).AfterMap((be, str) =>
{
var encoding = be.Request.Encoding ?? Encoding.UTF8;
str.Content = encoding.GetString(be.Content);
str.ContentString = encoding.GetString(be.Content);
});
cfg.CreateMap<WebClientStringResult, WebClientByteResult>().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((str, be) =>
{
if (!string.IsNullOrEmpty(str.Content))
if (!string.IsNullOrEmpty(str.ContentString))
{
var encoding = str.Request.Encoding ?? Encoding.UTF8;
be.Content = encoding.GetBytes(str.Content);
be.Content = encoding.GetBytes(str.ContentString);
}
});