mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 22:07:32 -04:00
New: Add PosterUrl to ReleaseInfo for parsing
This commit is contained in:
parent
a127e5a30f
commit
e304461dfb
11 changed files with 29 additions and 17 deletions
|
@ -238,7 +238,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var torrentId = qDetailsLink.GetAttribute("href").Split('=').Last();
|
||||
var link = _settings.BaseUrl + "torrents.php?action=download&id=" + torrentId;
|
||||
var posterStr = qDetailsLink.GetAttribute("data-cover");
|
||||
var poster = !string.IsNullOrWhiteSpace(posterStr) ? new Uri(qDetailsLink.GetAttribute("data-cover")) : null;
|
||||
var poster = !string.IsNullOrWhiteSpace(posterStr) ? posterStr : null;
|
||||
|
||||
var files = ParseUtil.CoerceInt(row.QuerySelector("td:nth-child(3)").TextContent);
|
||||
var publishDate = DateTimeUtil.FromTimeAgo(row.QuerySelector("td:nth-child(4)").TextContent);
|
||||
|
@ -276,6 +276,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
Categories = category,
|
||||
DownloadUrl = link,
|
||||
InfoUrl = details,
|
||||
PosterUrl = poster,
|
||||
Guid = link,
|
||||
ImdbId = imdb.GetValueOrDefault(),
|
||||
Seeders = seeders,
|
||||
|
|
|
@ -293,6 +293,15 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||
release.TvdbId = (int)ParseUtil.CoerceLong(tvdbId);
|
||||
value = release.TvdbId.ToString();
|
||||
break;
|
||||
case "poster":
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
var poster = ResolvePath(value, searchUrlUri);
|
||||
release.PosterUrl = poster.AbsoluteUri;
|
||||
}
|
||||
|
||||
value = release.PosterUrl;
|
||||
break;
|
||||
|
||||
//case "author":
|
||||
// release.Author = value;
|
||||
|
@ -300,15 +309,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||
//case "booktitle":
|
||||
// release.BookTitle = value;
|
||||
// break;
|
||||
//case "banner":
|
||||
// if (!string.IsNullOrWhiteSpace(value))
|
||||
// {
|
||||
// var bannerurl = ResolvePath(value, searchUrlUri);
|
||||
// release.BannerUrl = bannerurl;
|
||||
// }
|
||||
|
||||
// value = release.BannerUrl.ToString();
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -205,6 +205,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
Title = row.Name,
|
||||
InfoUrl = $"{_settings.BaseUrl}torrents/{row.Id}",
|
||||
DownloadUrl = $"{_settings.BaseUrl}torrent/download/{row.Id}.{jsonResponse.Resource.Rsskey}",
|
||||
PosterUrl = row.PosterImage,
|
||||
PublishDate = row.CreatedAt,
|
||||
Categories = _categories.MapTrackerCatToNewznab(row.CategoryId),
|
||||
Size = row.Size,
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var details = new Uri(_settings.BaseUrl + mainLink.GetAttribute("href"));
|
||||
|
||||
var posterMatch = _posterRegex.Match(mainLink.GetAttribute("onmouseover"));
|
||||
var poster = posterMatch.Success ? new Uri(_settings.BaseUrl + posterMatch.Groups[1].Value.Replace("\\", "/")) : null;
|
||||
var poster = posterMatch.Success ? _settings.BaseUrl + posterMatch.Groups[1].Value.Replace("\\", "/") : null;
|
||||
|
||||
var link = new Uri(_settings.BaseUrl + row.Children[4].FirstElementChild.GetAttribute("href"));
|
||||
var description = row.Children[2].QuerySelector("span").TextContent;
|
||||
|
@ -331,6 +331,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
Guid = details.AbsoluteUri,
|
||||
DownloadUrl = link.AbsoluteUri,
|
||||
InfoUrl = details.AbsoluteUri,
|
||||
PosterUrl = poster,
|
||||
PublishDate = publishDate,
|
||||
Categories = cat,
|
||||
ImdbId = imdb ?? 0,
|
||||
|
|
|
@ -242,6 +242,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
Title = title,
|
||||
Guid = details,
|
||||
InfoUrl = details,
|
||||
PosterUrl = poster.AbsoluteUri,
|
||||
DownloadUrl = link,
|
||||
Categories = new List<IndexerCategory> { TvCategoryFromQualityParser.ParseTvShowQuality(title) },
|
||||
Size = size,
|
||||
|
|
|
@ -378,6 +378,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
Size = torrent.Size,
|
||||
ImdbId = ParseUtil.GetImdbID(torrent.ImdbId).GetValueOrDefault(),
|
||||
DownloadUrl = $"{Settings.BaseUrl}/api/torrent/{torrent.Id}/download",
|
||||
PosterUrl = torrent.Poster,
|
||||
InfoUrl = torrent.Url,
|
||||
Grabs = torrent.TimesCompleted,
|
||||
PublishDate = torrent.CreatedAt,
|
||||
|
|
|
@ -252,10 +252,11 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
|
||||
release.UploadVolumeFactor = 1;
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(row.customcover.ToString()))
|
||||
//{
|
||||
// release.Poster = new Uri(SiteLink + row.customcover);
|
||||
//}
|
||||
if (!string.IsNullOrWhiteSpace(row.customcover.ToString()))
|
||||
{
|
||||
release.PosterUrl = _settings.BaseUrl + row.customcover;
|
||||
}
|
||||
|
||||
if (row.imdbid2 != null && row.imdbid2.ToString().StartsWith("tt"))
|
||||
{
|
||||
release.ImdbId = ParseUtil.CoerceInt(row.imdbid2.ToString().Substring(2));
|
||||
|
@ -267,7 +268,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
descriptions.Add("Rating: " + row.rating);
|
||||
descriptions.Add("Plot: " + row.plot);
|
||||
|
||||
//release.Poster = new Uri(SiteLink + "img/imdb/" + row.imdbid2 + ".jpg");
|
||||
release.PosterUrl = _settings.BaseUrl + "img/imdb/" + row.imdbid2 + ".jpg";
|
||||
}
|
||||
|
||||
if ((int)row.p2p == 1)
|
||||
|
|
|
@ -247,7 +247,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
|
||||
release.InfoUrl = movie.Value<string>("url");
|
||||
|
||||
//release.Poster = new Uri(movie.Value<string>("large_cover_image"));
|
||||
release.PosterUrl = new Uri(movie.Value<string>("large_cover_image")).AbsoluteUri;
|
||||
release.Guid = release.DownloadUrl;
|
||||
|
||||
// map the quality to a newznab category for torznab compatibility (for Radarr, etc)
|
||||
|
|
|
@ -375,6 +375,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
InfoUrl = details.AbsoluteUri,
|
||||
Guid = details.AbsoluteUri,
|
||||
DownloadUrl = link.AbsoluteUri,
|
||||
PosterUrl = poster.AbsoluteUri,
|
||||
PublishDate = publishDate,
|
||||
Categories = cat,
|
||||
Size = size,
|
||||
|
|
|
@ -33,6 +33,8 @@ namespace NzbDrone.Core.Parser.Model
|
|||
public int TmdbId { get; set; }
|
||||
public DateTime PublishDate { get; set; }
|
||||
|
||||
public string PosterUrl { get; set; }
|
||||
|
||||
public string Origin { get; set; }
|
||||
public string Source { get; set; }
|
||||
public string Container { get; set; }
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace Prowlarr.Api.V1.Search
|
|||
public string CommentUrl { get; set; }
|
||||
public string DownloadUrl { get; set; }
|
||||
public string InfoUrl { get; set; }
|
||||
public string PosterUrl { get; set; }
|
||||
public IEnumerable<string> IndexerFlags { get; set; }
|
||||
public ICollection<IndexerCategory> Categories { get; set; }
|
||||
|
||||
|
@ -65,6 +66,7 @@ namespace Prowlarr.Api.V1.Search
|
|||
CommentUrl = releaseInfo.CommentUrl,
|
||||
DownloadUrl = releaseInfo.DownloadUrl,
|
||||
InfoUrl = releaseInfo.InfoUrl,
|
||||
PosterUrl = releaseInfo.PosterUrl,
|
||||
Categories = releaseInfo.Categories,
|
||||
|
||||
//ReleaseWeight
|
||||
|
@ -101,6 +103,7 @@ namespace Prowlarr.Api.V1.Search
|
|||
model.Size = resource.Size;
|
||||
model.DownloadUrl = resource.DownloadUrl;
|
||||
model.InfoUrl = resource.InfoUrl;
|
||||
model.PosterUrl = resource.PosterUrl;
|
||||
model.CommentUrl = resource.CommentUrl;
|
||||
model.IndexerId = resource.IndexerId;
|
||||
model.Indexer = resource.Indexer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue