mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-03 22:57:18 +02:00
Fixed: Reprocessing custom formats for file in Manual Import
This commit is contained in:
parent
9dd31be7b3
commit
b6b809f473
@ -11,7 +11,6 @@ import Tooltip from 'Components/Tooltip/Tooltip';
|
|||||||
import type DownloadProtocol from 'DownloadClient/DownloadProtocol';
|
import type DownloadProtocol from 'DownloadClient/DownloadProtocol';
|
||||||
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||||
import Language from 'Language/Language';
|
import Language from 'Language/Language';
|
||||||
import IndexerFlags from 'Movie/IndexerFlags';
|
|
||||||
import MovieFormats from 'Movie/MovieFormats';
|
import MovieFormats from 'Movie/MovieFormats';
|
||||||
import MovieLanguage from 'Movie/MovieLanguage';
|
import MovieLanguage from 'Movie/MovieLanguage';
|
||||||
import MovieQuality from 'Movie/MovieQuality';
|
import MovieQuality from 'Movie/MovieQuality';
|
||||||
@ -91,7 +90,7 @@ interface InteractiveSearchRowProps {
|
|||||||
customFormats: CustomFormat[];
|
customFormats: CustomFormat[];
|
||||||
customFormatScore: number;
|
customFormatScore: number;
|
||||||
mappedMovieId?: number;
|
mappedMovieId?: number;
|
||||||
indexerFlags: number;
|
indexerFlags: string[];
|
||||||
rejections: string[];
|
rejections: string[];
|
||||||
downloadAllowed: boolean;
|
downloadAllowed: boolean;
|
||||||
isGrabbing: boolean;
|
isGrabbing: boolean;
|
||||||
@ -126,7 +125,7 @@ function InteractiveSearchRow(props: InteractiveSearchRowProps) {
|
|||||||
customFormatScore,
|
customFormatScore,
|
||||||
customFormats,
|
customFormats,
|
||||||
mappedMovieId,
|
mappedMovieId,
|
||||||
indexerFlags = 0,
|
indexerFlags = [],
|
||||||
rejections = [],
|
rejections = [],
|
||||||
downloadAllowed,
|
downloadAllowed,
|
||||||
isGrabbing = false,
|
isGrabbing = false,
|
||||||
@ -282,11 +281,17 @@ function InteractiveSearchRow(props: InteractiveSearchRowProps) {
|
|||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
|
|
||||||
<TableRowCell className={styles.indexerFlags}>
|
<TableRowCell className={styles.indexerFlags}>
|
||||||
{indexerFlags ? (
|
{indexerFlags.length ? (
|
||||||
<Popover
|
<Popover
|
||||||
anchor={<Icon name={icons.FLAG} kind={kinds.PRIMARY} />}
|
anchor={<Icon name={icons.FLAG} kind={kinds.PRIMARY} />}
|
||||||
title={translate('IndexerFlags')}
|
title={translate('IndexerFlags')}
|
||||||
body={<IndexerFlags indexerFlags={indexerFlags} />}
|
body={
|
||||||
|
<ul>
|
||||||
|
{indexerFlags.map((flag, index) => {
|
||||||
|
return <li key={index}>{flag}</li>;
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
position={tooltipPositions.LEFT}
|
position={tooltipPositions.LEFT}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -112,21 +112,21 @@ public ManualImportItem ReprocessItem(string path, string downloadId, int movieI
|
|||||||
_logger.Debug("Language couldn't be parsed from release, fallback to movie original language: {0}", movie.MovieMetadata.Value.OriginalLanguage.Name);
|
_logger.Debug("Language couldn't be parsed from release, fallback to movie original language: {0}", movie.MovieMetadata.Value.OriginalLanguage.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
var localMovie = new LocalMovie
|
var localMovie = new LocalMovie();
|
||||||
{
|
localMovie.Movie = movie;
|
||||||
Movie = movie,
|
localMovie.FileMovieInfo = Parser.Parser.ParseMoviePath(path);
|
||||||
FileMovieInfo = Parser.Parser.ParseMoviePath(path),
|
localMovie.DownloadClientMovieInfo = downloadClientItem == null ? null : Parser.Parser.ParseMovieTitle(downloadClientItem.Title);
|
||||||
DownloadClientMovieInfo = downloadClientItem == null ? null : Parser.Parser.ParseMovieTitle(downloadClientItem.Title),
|
localMovie.DownloadItem = downloadClientItem;
|
||||||
DownloadItem = downloadClientItem,
|
localMovie.Path = path;
|
||||||
Path = path,
|
localMovie.SceneSource = SceneSource(movie, rootFolder);
|
||||||
SceneSource = SceneSource(movie, rootFolder),
|
localMovie.ExistingFile = movie.Path.IsParentPath(path);
|
||||||
ExistingFile = movie.Path.IsParentPath(path),
|
localMovie.Size = _diskProvider.GetFileSize(path);
|
||||||
Size = _diskProvider.GetFileSize(path),
|
localMovie.ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup;
|
||||||
ReleaseGroup = releaseGroup.IsNullOrWhiteSpace() ? Parser.Parser.ParseReleaseGroup(path) : releaseGroup,
|
localMovie.Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages;
|
||||||
Languages = languages?.Count <= 1 && (languages?.SingleOrDefault() ?? Language.Unknown) == Language.Unknown ? languageParse : languages,
|
localMovie.Quality = (quality?.Quality ?? Quality.Unknown) == Quality.Unknown ? QualityParser.ParseQuality(path) : quality;
|
||||||
Quality = (quality?.Quality ?? Quality.Unknown) == Quality.Unknown ? QualityParser.ParseQuality(path) : quality,
|
localMovie.IndexerFlags = (IndexerFlags)indexerFlags;
|
||||||
IndexerFlags = (IndexerFlags)indexerFlags
|
localMovie.CustomFormats = _formatCalculator.ParseCustomFormat(localMovie);
|
||||||
};
|
localMovie.CustomFormatScore = localMovie.Movie?.QualityProfile?.CalculateCustomFormatScore(localMovie.CustomFormats) ?? 0;
|
||||||
|
|
||||||
return MapItem(_importDecisionMaker.GetDecision(localMovie, downloadClientItem), rootFolder, downloadId, null);
|
return MapItem(_importDecisionMaker.GetDecision(localMovie, downloadClientItem), rootFolder, downloadId, null);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class ReleaseResource : RestResource
|
|||||||
public int? Seeders { get; set; }
|
public int? Seeders { get; set; }
|
||||||
public int? Leechers { get; set; }
|
public int? Leechers { get; set; }
|
||||||
public DownloadProtocol Protocol { get; set; }
|
public DownloadProtocol Protocol { get; set; }
|
||||||
public int IndexerFlags { get; set; }
|
public IEnumerable<string> IndexerFlags { get; set; }
|
||||||
|
|
||||||
// Sent when queuing an unknown release
|
// Sent when queuing an unknown release
|
||||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||||
@ -76,7 +76,7 @@ public static ReleaseResource ToResource(this DownloadDecision model)
|
|||||||
var parsedMovieInfo = model.RemoteMovie.ParsedMovieInfo;
|
var parsedMovieInfo = model.RemoteMovie.ParsedMovieInfo;
|
||||||
var remoteMovie = model.RemoteMovie;
|
var remoteMovie = model.RemoteMovie;
|
||||||
var torrentInfo = (model.RemoteMovie.Release as TorrentInfo) ?? new TorrentInfo();
|
var torrentInfo = (model.RemoteMovie.Release as TorrentInfo) ?? new TorrentInfo();
|
||||||
var indexerFlags = torrentInfo.IndexerFlags;
|
var indexerFlags = torrentInfo.IndexerFlags.ToString().Split(new[] { ", " }, 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?)
|
// 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
|
return new ReleaseResource
|
||||||
@ -118,7 +118,7 @@ public static ReleaseResource ToResource(this DownloadDecision model)
|
|||||||
Seeders = torrentInfo.Seeders,
|
Seeders = torrentInfo.Seeders,
|
||||||
Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null,
|
Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null,
|
||||||
Protocol = releaseInfo.DownloadProtocol,
|
Protocol = releaseInfo.DownloadProtocol,
|
||||||
IndexerFlags = (int)indexerFlags
|
IndexerFlags = indexerFlags
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user