diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js index 2c664676e..fa7eb85c7 100644 --- a/frontend/src/Helpers/Props/icons.js +++ b/frontend/src/Helpers/Props/icons.js @@ -58,6 +58,7 @@ import { faFileInvoice as farFileInvoice, faFilm as fasFilm, faFilter as fasFilter, + faFlag as fasFlag, faFolderOpen as fasFolderOpen, faForward as fasForward, faHeart as fasHeart, @@ -144,6 +145,7 @@ export const EXTERNAL_LINK = fasExternalLinkAlt; export const FATAL = fasTimesCircle; export const FILE = farFile; export const FILTER = fasFilter; +export const FLAG = fasFlag; export const FOLDER = farFolder; export const FOLDER_OPEN = fasFolderOpen; export const GROUP = farObjectGroup; diff --git a/frontend/src/InteractiveSearch/InteractiveSearchContent.js b/frontend/src/InteractiveSearch/InteractiveSearchContent.js index 3292c7cdb..15f69aac1 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearchContent.js +++ b/frontend/src/InteractiveSearch/InteractiveSearchContent.js @@ -63,6 +63,12 @@ const columns = [ isSortable: true, isVisible: true }, + { + name: 'indexerFlags', + label: React.createElement(Icon, { name: icons.FLAG }), + isSortable: true, + isVisible: true + }, { name: 'rejections', label: React.createElement(Icon, { name: icons.DANGER }), diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.css b/frontend/src/InteractiveSearch/InteractiveSearchRow.css index 1a1ff2075..fd37e6736 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearchRow.css +++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.css @@ -21,6 +21,7 @@ } .rejected, +.indexerFlags, .download { composes: cell from '~Components/Table/Cells/TableRowCell.css'; diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.js b/frontend/src/InteractiveSearch/InteractiveSearchRow.js index 1521857bf..bb1a5f2c0 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearchRow.js +++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.js @@ -114,6 +114,7 @@ class InteractiveSearchRow extends Component { leechers, quality, languages, + indexerFlags, rejections, downloadAllowed, isGrabbing, @@ -180,6 +181,35 @@ class InteractiveSearchRow extends Component { /> + + { + !!indexerFlags.length && + + } + title="Indexer Flags" + body={ + + } + position={tooltipPositions.LEFT} + /> + } + + { !!rejections.length && @@ -251,6 +281,7 @@ InteractiveSearchRow.propTypes = { quality: PropTypes.object.isRequired, languages: PropTypes.arrayOf(PropTypes.object).isRequired, rejections: PropTypes.arrayOf(PropTypes.string).isRequired, + indexerFlags: PropTypes.arrayOf(PropTypes.string).isRequired, downloadAllowed: PropTypes.bool.isRequired, isGrabbing: PropTypes.bool.isRequired, isGrabbed: PropTypes.bool.isRequired, diff --git a/frontend/src/Store/Actions/releaseActions.js b/frontend/src/Store/Actions/releaseActions.js index 5a88df5f6..24e869e55 100644 --- a/frontend/src/Store/Actions/releaseActions.js +++ b/frontend/src/Store/Actions/releaseActions.js @@ -35,6 +35,17 @@ export const defaultState = { return seeders * 1000000 + leechers; }, + indexerFlags: function(item, direction) { + const indexerFlags = item.indexerFlags; + const releaseWeight = item.releaseWeight; + + if (indexerFlags.length === 0) { + return releaseWeight + 1000000; + } + + return releaseWeight; + }, + rejections: function(item, direction) { const rejections = item.rejections; const releaseWeight = item.releaseWeight; diff --git a/src/Radarr.Api.V3/Indexers/ReleaseResource.cs b/src/Radarr.Api.V3/Indexers/ReleaseResource.cs index 514974ecb..de44aea7c 100644 --- a/src/Radarr.Api.V3/Indexers/ReleaseResource.cs +++ b/src/Radarr.Api.V3/Indexers/ReleaseResource.cs @@ -40,6 +40,7 @@ namespace Radarr.Api.V3.Indexers public string InfoUrl { get; set; } public bool DownloadAllowed { get; set; } public int ReleaseWeight { get; set; } + public IEnumerable IndexerFlags { get; set; } public string MagnetUrl { get; set; } public string InfoHash { get; set; } @@ -47,11 +48,6 @@ namespace Radarr.Api.V3.Indexers public int? Leechers { get; set; } public DownloadProtocol Protocol { get; set; } - public bool IsDaily { get; set; } - public bool IsAbsoluteNumbering { get; set; } - public bool IsPossibleSpecialEpisode { get; set; } - public bool Special { get; set; } - // Sent when queuing an unknown release [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int? MovieId { get; set; } @@ -65,6 +61,7 @@ namespace Radarr.Api.V3.Indexers var parsedMovieInfo = model.RemoteMovie.ParsedMovieInfo; var remoteMovie = model.RemoteMovie; var torrentInfo = (model.RemoteMovie.Release as TorrentInfo) ?? new TorrentInfo(); + var indexerFlags = torrentInfo.IndexerFlags.ToString().Split(new string[] { ", " }, StringSplitOptions.None).Where(x => x != "0"); // TODO: Clean this mess up. don't mix data from multiple classes, use sub-resources instead? (Got a huge Deja Vu, didn't we talk about this already once?) return new ReleaseResource @@ -100,7 +97,8 @@ namespace Radarr.Api.V3.Indexers InfoHash = torrentInfo.InfoHash, Seeders = torrentInfo.Seeders, Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null, - Protocol = releaseInfo.DownloadProtocol + Protocol = releaseInfo.DownloadProtocol, + IndexerFlags = indexerFlags }; }