Fixed: Misc UI/Test Fixes

pull/3718/head
Qstick 5 years ago
parent a20222fbef
commit 7698ae00dd

@ -4,7 +4,7 @@ defaults: &defaults
docker:
- image: gallileo/radarr-cci-primary:5.8.9
environment:
BUILD_VERSION: 0.2.0
BUILD_VERSION: 2.0.0
jobs:
build:

@ -25,23 +25,23 @@
margin-left: 8px;
}
.searchForMissingEpisodesLabelContainer {
.searchForMissingMovieLabelContainer {
display: flex;
margin-top: 2px;
}
.searchForMissingEpisodesLabel {
.searchForMissingMovieLabel {
margin-right: 8px;
font-weight: normal;
}
.searchForMissingEpisodesContainer {
.searchForMissingMovieContainer {
composes: container from '~Components/Form/CheckInput.css';
flex: 0 1 0;
}
.searchForMissingEpisodesInput {
.searchForMissingMovieInput {
composes: input from '~Components/Form/CheckInput.css';
margin-top: 0;

@ -23,15 +23,15 @@ class AddNewMovieModalContent extends Component {
super(props, context);
this.state = {
searchForMissingEpisodes: false
searchForMovie: false
};
}
//
// Listeners
onSearchForMissingEpisodesChange = ({ value }) => {
this.setState({ searchForMissingEpisodes: value });
onSearchForMissingMovieChange = ({ value }) => {
this.setState({ searchForMovie: value });
}
onQualityProfileIdChange = ({ value }) => {
@ -39,7 +39,7 @@ class AddNewMovieModalContent extends Component {
}
onAddMoviePress = () => {
this.props.onAddMoviePress(this.state.searchForMissingEpisodes);
this.props.onAddMoviePress(this.state.searchForMovie);
}
//
@ -142,17 +142,17 @@ class AddNewMovieModalContent extends Component {
</ModalBody>
<ModalFooter className={styles.modalFooter}>
<label className={styles.searchForMissingEpisodesLabelContainer}>
<span className={styles.searchForMissingEpisodesLabel}>
<label className={styles.searchForMissingMovieLabelContainer}>
<span className={styles.searchForMissingMovieLabel}>
Start search for missing movie
</span>
<CheckInput
containerClassName={styles.searchForMissingEpisodesContainer}
className={styles.searchForMissingEpisodesInput}
name="searchForMissingEpisodes"
value={this.state.searchForMissingEpisodes}
onChange={this.onSearchForMissingEpisodesChange}
containerClassName={styles.searchForMissingMovieContainer}
className={styles.searchForMissingMovieInput}
name="searchForMovie"
value={this.state.searchForMovie}
onChange={this.onSearchForMissingMovieChange}
/>
</label>

@ -50,7 +50,7 @@ class AddNewMovieModalContentConnector extends Component {
this.props.setAddMovieDefault({ [name]: value });
}
onAddMoviePress = (searchForMissingEpisodes) => {
onAddMoviePress = (searchForMovie) => {
const {
tmdbId,
rootFolderPath,
@ -65,7 +65,7 @@ class AddNewMovieModalContentConnector extends Component {
monitor: monitor.value,
qualityProfileId: qualityProfileId.value,
tags: tags.value,
searchForMissingEpisodes
searchForMovie
});
}

@ -168,6 +168,7 @@ class MovieDetails extends Component {
monitored,
studio,
overview,
youTubeTrailerId,
inCinemas,
images,
alternateTitles,
@ -426,6 +427,7 @@ class MovieDetails extends Component {
<MovieDetailsLinks
tmdbId={tmdbId}
imdbId={imdbId}
youTubeTrailerId={youTubeTrailerId}
/>
}
</span>
@ -551,6 +553,7 @@ MovieDetails.propTypes = {
monitored: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
studio: PropTypes.string,
youTubeTrailerId: PropTypes.string,
inCinemas: PropTypes.string.isRequired,
overview: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -8,7 +8,8 @@ import styles from './MovieDetailsLinks.css';
function MovieDetailsLinks(props) {
const {
tmdbId,
imdbId
imdbId,
youTubeTrailerId
} = props;
return (
@ -28,7 +29,7 @@ function MovieDetailsLinks(props) {
<Link
className={styles.link}
to={`http://trakt.tv/search/tvdb/${tmdbId}?id_type=show`}
to={`https://trakt.tv/search/tvdb/${tmdbId}?id_type=show`}
>
<Label
className={styles.linkLabel}
@ -43,7 +44,7 @@ function MovieDetailsLinks(props) {
!!imdbId &&
<Link
className={styles.link}
to={`http://imdb.com/title/${imdbId}/`}
to={`https://imdb.com/title/${imdbId}/`}
>
<Label
className={styles.linkLabel}
@ -54,13 +55,46 @@ function MovieDetailsLinks(props) {
</Label>
</Link>
}
{
!!imdbId &&
<Link
className={styles.link}
to={` https://moviechat.org/${imdbId}/`}
>
<Label
className={styles.linkLabel}
kind={kinds.INFO}
size={sizes.LARGE}
>
Movie Chat
</Label>
</Link>
}
{
!!youTubeTrailerId &&
<Link
className={styles.link}
to={` https://www.youtube.com/watch?v=${youTubeTrailerId}/`}
>
<Label
className={styles.linkLabel}
kind={kinds.DANGER}
size={sizes.LARGE}
>
Trailer
</Label>
</Link>
}
</div>
);
}
MovieDetailsLinks.propTypes = {
tmdbId: PropTypes.number.isRequired,
imdbId: PropTypes.string
imdbId: PropTypes.string,
youTubeTrailerId: PropTypes.string
};
export default MovieDetailsLinks;

@ -74,7 +74,7 @@ class OrganizePreviewModalContent extends Component {
isPopulated,
error,
items,
renameEpisodes,
renameMovies,
standardMovieFormat,
path,
onModalClose
@ -109,7 +109,7 @@ class OrganizePreviewModalContent extends Component {
!isFetching && isPopulated && !items.length &&
<div>
{
renameEpisodes ?
renameMovies ?
<div>Success! My work is done, no files to rename.</div> :
<div>Renaming is disabled, nothing to rename</div>
}
@ -191,7 +191,7 @@ OrganizePreviewModalContent.propTypes = {
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
path: PropTypes.string.isRequired,
renameEpisodes: PropTypes.bool,
renameMovies: PropTypes.bool,
standardMovieFormat: PropTypes.string,
onOrganizePress: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired

@ -19,7 +19,7 @@ function createMapStateToProps() {
props.isFetching = organizePreview.isFetching || naming.isFetching;
props.isPopulated = organizePreview.isPopulated && naming.isPopulated;
props.error = organizePreview.error || naming.error;
props.renameEpisodes = naming.item.renameEpisodes;
props.renameMovies = naming.item.renameMovies;
props.standardMovieFormat = naming.item.standardMovieFormat;
props.path = movie.path;

@ -71,7 +71,7 @@ class Naming extends Component {
namingModalOptions
} = this.state;
const renameEpisodes = hasSettings && settings.renameEpisodes.value;
const renameMovies = hasSettings && settings.renameMovies.value;
const standardMovieFormatHelpTexts = [];
const standardMovieFormatErrors = [];
@ -112,10 +112,10 @@ class Naming extends Component {
<FormInputGroup
type={inputTypes.CHECK}
name="renameEpisodes"
name="renameMovies"
helpText="Radarr will use the existing file name if renaming is disabled"
onChange={onInputChange}
{...settings.renameEpisodes}
{...settings.renameMovies}
/>
</FormGroup>
@ -132,7 +132,7 @@ class Naming extends Component {
</FormGroup>
{
renameEpisodes &&
renameMovies &&
<div>
<FormGroup size={sizes.LARGE}>
<FormLabel>Standard Movie Format</FormLabel>

@ -4,9 +4,15 @@ function getNewMovie(movie, payload) {
rootFolderPath,
monitor,
qualityProfileId,
tags
tags,
searchForMovie = false
} = payload;
const addOptions = {
searchForMovie
};
movie.addOptions = addOptions;
movie.monitored = monitor === 'true';
movie.qualityProfileId = qualityProfileId;
movie.rootFolderPath = rootFolderPath;

@ -90,8 +90,7 @@ namespace NzbDrone.Core.Test.DiskSpace
}
[Test]
[Ignore("Unknown failure")]
public void should_not_check_diskspace_for_missing_movies_folders()
public void should_not_check_diskspace_for_missing_movie_folders()
{
GivenMovies(new Movie { Path = _moviesFolder });
@ -110,8 +109,6 @@ namespace NzbDrone.Core.Test.DiskSpace
[TestCase("/var/lib/docker")]
[TestCase("/some/place/docker/aufs")]
[TestCase("/etc/network")]
[TestCase("/snap/filebot/9")]
[TestCase("/snap/core/5145")]
public void should_not_check_diskspace_for_irrelevant_mounts(string path)
{
var mount = new Mock<IMount>();

@ -5,7 +5,6 @@ using System.Linq;
using System.Text.RegularExpressions;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Movies;
namespace NzbDrone.Core.DiskSpace
@ -32,26 +31,29 @@ namespace NzbDrone.Core.DiskSpace
public List<DiskSpace> GetFreeSpace()
{
var diskSpace = new List<DiskSpace>();
diskSpace.AddRange(GetMovieFreeSpace());
diskSpace.AddRange(GetFixedDisksFreeSpace());
var importantRootFolders = GetMoviesRootPaths().Distinct().ToList();
return diskSpace.DistinctBy(d => d.Path).ToList();
var optionalRootFolders = GetFixedDisksRootPaths().Except(importantRootFolders).Distinct().ToList();
var diskSpace = GetDiskSpace(importantRootFolders).Concat(GetDiskSpace(optionalRootFolders, true)).ToList();
return diskSpace;
}
private IEnumerable<DiskSpace> GetMovieFreeSpace()
private IEnumerable<string> GetMoviesRootPaths()
{
var movieRootPaths = _movieService.GetAllMovies().Select(s => _diskProvider.GetPathRoot(s.Path)).Distinct();
return GetDiskSpace(movieRootPaths);
return _movieService.GetAllMovies()
.Where(s => _diskProvider.FolderExists(s.Path))
.Select(s => _diskProvider.GetPathRoot(s.Path))
.Distinct();
}
private IEnumerable<DiskSpace> GetFixedDisksFreeSpace()
private IEnumerable<string> GetFixedDisksRootPaths()
{
return GetDiskSpace(_diskProvider.GetMounts()
return _diskProvider.GetMounts()
.Where(d => d.DriveType == DriveType.Fixed)
.Where(d => !_regexSpecialDrive.IsMatch(d.RootDirectory))
.Select(d => d.RootDirectory), true);
.Select(d => d.RootDirectory);
}
private IEnumerable<DiskSpace> GetDiskSpace(IEnumerable<string> paths, bool suppressWarnings = false)

@ -487,7 +487,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
}
}
}
catch (Exception ex)
catch (Exception)
{
_logger.Debug("Not a valid date time.");
}

@ -35,7 +35,6 @@ namespace Radarr.Api.V2.Config
Get["/examples"] = x => GetExamples(this.Bind<NamingConfigResource>());
SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 5);
SharedValidator.RuleFor(c => c.StandardMovieFormat).ValidMovieFormat();
SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat();
}
@ -94,12 +93,10 @@ namespace Radarr.Api.V2.Config
{
var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);
//var standardMovieValidationResult = _filenameValidationService.ValidateMovieFilename(movieSampleResult); For now, let's hope the user is not stupid enough :/
var standardMovieValidationResult = _filenameValidationService.ValidateMovieFilename(movieSampleResult);
var validationFailures = new List<ValidationFailure>();
//validationFailures.AddIfNotNull(standardMovieValidationResult);
if (validationFailures.Any())
{
throw new ValidationException(validationFailures.DistinctBy(v => v.PropertyName).ToArray());

@ -5,14 +5,11 @@ namespace Radarr.Api.V2.Config
{
public class NamingConfigResource : RestResource
{
public bool RenameEpisodes { get; set; }
public bool RenameMovies { get; set; }
public bool ReplaceIllegalCharacters { get; set; }
public ColonReplacementFormat ColonReplacementFormat { get; set; }
public string StandardMovieFormat { get; set; }
public string MovieFolderFormat { get; set; }
public int MultiEpisodeStyle { get; set; }
public bool IncludeSeriesTitle { get; set; }
public bool IncludeEpisodeTitle { get; set; }
public bool IncludeQuality { get; set; }
public bool ReplaceSpaces { get; set; }
public string Separator { get; set; }

@ -4,14 +4,6 @@ namespace Radarr.Api.V2.Config
{
public class NamingExampleResource
{
//public string SingleEpisodeExample { get; set; }
//public string MultiEpisodeExample { get; set; }
//public string DailyEpisodeExample { get; set; }
//public string AnimeEpisodeExample { get; set; }
//public string AnimeMultiEpisodeExample { get; set; }
//public string SeriesFolderExample { get; set; }
//public string SeasonFolderExample { get; set; }
public string MovieExample { get; set; }
public string MovieFolderExample { get; set; }
}
@ -24,14 +16,11 @@ namespace Radarr.Api.V2.Config
{
Id = model.Id,
RenameEpisodes = model.RenameEpisodes,
RenameMovies = model.RenameEpisodes,
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
MultiEpisodeStyle = model.MultiEpisodeStyle,
ColonReplacementFormat = model.ColonReplacementFormat,
StandardMovieFormat = model.StandardMovieFormat,
MovieFolderFormat = model.MovieFolderFormat,
//IncludeSeriesTitle
//IncludeEpisodeTitle
//IncludeQuality
//ReplaceSpaces
//Separator
@ -41,8 +30,6 @@ namespace Radarr.Api.V2.Config
public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource)
{
resource.IncludeSeriesTitle = basicNamingConfig.IncludeSeriesTitle;
resource.IncludeEpisodeTitle = basicNamingConfig.IncludeEpisodeTitle;
resource.IncludeQuality = basicNamingConfig.IncludeQuality;
resource.ReplaceSpaces = basicNamingConfig.ReplaceSpaces;
resource.Separator = basicNamingConfig.Separator;
@ -55,9 +42,8 @@ namespace Radarr.Api.V2.Config
{
Id = resource.Id,
RenameEpisodes = resource.RenameEpisodes,
RenameEpisodes = resource.RenameMovies,
ReplaceIllegalCharacters = resource.ReplaceIllegalCharacters,
MultiEpisodeStyle = resource.MultiEpisodeStyle,
ColonReplacementFormat = resource.ColonReplacementFormat,
StandardMovieFormat = resource.StandardMovieFormat,
MovieFolderFormat = resource.MovieFolderFormat,

@ -6,11 +6,11 @@ namespace Radarr.Api.V2.Config
public class NetImportConfigResource : RestResource
{
public int NetImportSyncInterval { get; set; }
public string ListSyncLevel { get; set; }
public string ImportExclusions { get; set; }
public string TraktAuthToken { get; set; }
public string TraktRefreshToken { get; set; }
public int TraktTokenExpiry { get; set; }
public string ListSyncLevel { get; set; }
public string ImportExclusions { get; set; }
public string TraktAuthToken { get; set; }
public string TraktRefreshToken { get; set; }
public int TraktTokenExpiry { get; set; }
}
public static class NetImportConfigResourceMapper
@ -20,11 +20,11 @@ namespace Radarr.Api.V2.Config
return new NetImportConfigResource
{
NetImportSyncInterval = model.NetImportSyncInterval,
ListSyncLevel = model.ListSyncLevel,
ImportExclusions = model.ImportExclusions,
TraktAuthToken = model.TraktAuthToken,
TraktRefreshToken = model.TraktRefreshToken,
TraktTokenExpiry = model.TraktTokenExpiry,
ListSyncLevel = model.ListSyncLevel,
ImportExclusions = model.ImportExclusions,
TraktAuthToken = model.TraktAuthToken,
TraktRefreshToken = model.TraktRefreshToken,
TraktTokenExpiry = model.TraktTokenExpiry,
};
}
}

@ -13,22 +13,26 @@ namespace Radarr.Api.V2.Movies
private readonly IRenameMovieFileService _renameMovieFileService;
public RenameMovieModule(IRenameMovieFileService renameMovieFileService)
: base("renameMovie")
: base("rename")
{
_renameMovieFileService = renameMovieFileService;
GetResourceAll = GetMovies; //TODO: GetResourceSingle?
GetResourceAll = GetMovies;
}
private List<RenameMovieResource> GetMovies()
{
if(!Request.Query.MovieId.HasValue)
int movieId;
if(Request.Query.MovieId.HasValue)
{
movieId = (int)Request.Query.MovieId;
}
else
{
throw new BadRequestException("movieId is missing");
}
var movieId = (int)Request.Query.MovieId;
return _renameMovieFileService.GetRenamePreviews(movieId).ToResource();
}

Loading…
Cancel
Save