Convert functions and properties to expression bodies when able (#7312)

Convert functions and properties to expression bodies when able
This commit is contained in:
Cory
2020-02-25 10:08:03 -06:00
committed by GitHub
parent 2f91d99e19
commit 889a8da4e5
136 changed files with 726 additions and 1512 deletions

View File

@@ -19,17 +19,17 @@ namespace Jackett.Common.Indexers
{
public class AnimeBytes : BaseCachingWebIndexer
{
private string ScrapeUrl { get { return SiteLink + "scrape.php"; } }
private string TorrentsUrl { get { return SiteLink + "torrents.php"; } }
public bool AllowRaws { get { return configData.IncludeRaw.Value; } }
public bool PadEpisode { get { return configData.PadEpisode != null && configData.PadEpisode.Value; } }
public bool AddSynonyms { get { return configData.AddSynonyms.Value; } }
public bool FilterSeasonEpisode { get { return configData.FilterSeasonEpisode.Value; } }
private string ScrapeUrl => SiteLink + "scrape.php";
private string TorrentsUrl => SiteLink + "torrents.php";
public bool AllowRaws => configData.IncludeRaw.Value;
public bool PadEpisode => configData.PadEpisode != null && configData.PadEpisode.Value;
public bool AddSynonyms => configData.AddSynonyms.Value;
public bool FilterSeasonEpisode => configData.FilterSeasonEpisode.Value;
private new ConfigurationDataAnimeBytes configData
{
get { return (ConfigurationDataAnimeBytes)base.configData; }
set { base.configData = value; }
get => (ConfigurationDataAnimeBytes)base.configData;
set => base.configData = value;
}
public AnimeBytes(IIndexerConfigurationService configService, Utils.Clients.WebClient client, Logger l, IProtectionService ps)
@@ -74,12 +74,10 @@ namespace Jackett.Common.Indexers
AddCategoryMapping("printedtype[artbook]", TorznabCatType.BooksComics, "Artbook");
}
// Prevent filtering
protected override IEnumerable<ReleaseInfo> FilterResults(TorznabQuery query, IEnumerable<ReleaseInfo> input) =>
protected override IEnumerable<ReleaseInfo> FilterResults(TorznabQuery query, IEnumerable<ReleaseInfo> input)
{
// Prevent filtering
return input;
}
input;
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{
@@ -365,24 +363,26 @@ namespace Jackett.Common.Indexers
releaseTitle = string.Format("{0}{1} {2} {3}", releasegroup, title, releaseInfo, infoString);
}
var release = new ReleaseInfo();
release.MinimumRatio = 1;
release.MinimumSeedTime = MinimumSeedTime;
release.Title = releaseTitle;
release.Comments = CommentsLinkUri;
release.Guid = new Uri(CommentsLinkUri + "&nh=" + StringUtil.Hash(title)); // Sonarr should dedupe on this url - allow a url per name.
release.Link = LinkUri;
release.BannerUrl = ImageUrl;
release.PublishDate = PublushDate;
release.Category = Category;
release.Description = Description;
release.Size = Size;
release.Seeders = Seeders;
release.Peers = Peers;
release.Grabs = Snatched;
release.Files = FileCount;
release.DownloadVolumeFactor = RawDownMultiplier;
release.UploadVolumeFactor = RawUpMultiplier;
var release = new ReleaseInfo
{
MinimumRatio = 1,
MinimumSeedTime = MinimumSeedTime,
Title = releaseTitle,
Comments = CommentsLinkUri,
Guid = new Uri(CommentsLinkUri + "&nh=" + StringUtil.Hash(title)), // Sonarr should dedupe on this url - allow a url per name.
Link = LinkUri,
BannerUrl = ImageUrl,
PublishDate = PublushDate,
Category = Category,
Description = Description,
Size = Size,
Seeders = Seeders,
Peers = Peers,
Grabs = Snatched,
Files = FileCount,
DownloadVolumeFactor = RawDownMultiplier,
UploadVolumeFactor = RawUpMultiplier
};
releases.Add(release);
}