mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
Fixed: Misc UI/Test Fixes
This commit is contained in:
parent
a20222fbef
commit
7698ae00dd
@ -4,7 +4,7 @@ defaults: &defaults
|
|||||||
docker:
|
docker:
|
||||||
- image: gallileo/radarr-cci-primary:5.8.9
|
- image: gallileo/radarr-cci-primary:5.8.9
|
||||||
environment:
|
environment:
|
||||||
BUILD_VERSION: 0.2.0
|
BUILD_VERSION: 2.0.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -25,23 +25,23 @@
|
|||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchForMissingEpisodesLabelContainer {
|
.searchForMissingMovieLabelContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchForMissingEpisodesLabel {
|
.searchForMissingMovieLabel {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchForMissingEpisodesContainer {
|
.searchForMissingMovieContainer {
|
||||||
composes: container from '~Components/Form/CheckInput.css';
|
composes: container from '~Components/Form/CheckInput.css';
|
||||||
|
|
||||||
flex: 0 1 0;
|
flex: 0 1 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchForMissingEpisodesInput {
|
.searchForMissingMovieInput {
|
||||||
composes: input from '~Components/Form/CheckInput.css';
|
composes: input from '~Components/Form/CheckInput.css';
|
||||||
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
@ -23,15 +23,15 @@ class AddNewMovieModalContent extends Component {
|
|||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
searchForMissingEpisodes: false
|
searchForMovie: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
onSearchForMissingEpisodesChange = ({ value }) => {
|
onSearchForMissingMovieChange = ({ value }) => {
|
||||||
this.setState({ searchForMissingEpisodes: value });
|
this.setState({ searchForMovie: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
onQualityProfileIdChange = ({ value }) => {
|
onQualityProfileIdChange = ({ value }) => {
|
||||||
@ -39,7 +39,7 @@ class AddNewMovieModalContent extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
onAddMoviePress = () => {
|
||||||
this.props.onAddMoviePress(this.state.searchForMissingEpisodes);
|
this.props.onAddMoviePress(this.state.searchForMovie);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -142,17 +142,17 @@ class AddNewMovieModalContent extends Component {
|
|||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
||||||
<ModalFooter className={styles.modalFooter}>
|
<ModalFooter className={styles.modalFooter}>
|
||||||
<label className={styles.searchForMissingEpisodesLabelContainer}>
|
<label className={styles.searchForMissingMovieLabelContainer}>
|
||||||
<span className={styles.searchForMissingEpisodesLabel}>
|
<span className={styles.searchForMissingMovieLabel}>
|
||||||
Start search for missing movie
|
Start search for missing movie
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<CheckInput
|
<CheckInput
|
||||||
containerClassName={styles.searchForMissingEpisodesContainer}
|
containerClassName={styles.searchForMissingMovieContainer}
|
||||||
className={styles.searchForMissingEpisodesInput}
|
className={styles.searchForMissingMovieInput}
|
||||||
name="searchForMissingEpisodes"
|
name="searchForMovie"
|
||||||
value={this.state.searchForMissingEpisodes}
|
value={this.state.searchForMovie}
|
||||||
onChange={this.onSearchForMissingEpisodesChange}
|
onChange={this.onSearchForMissingMovieChange}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class AddNewMovieModalContentConnector extends Component {
|
|||||||
this.props.setAddMovieDefault({ [name]: value });
|
this.props.setAddMovieDefault({ [name]: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddMoviePress = (searchForMissingEpisodes) => {
|
onAddMoviePress = (searchForMovie) => {
|
||||||
const {
|
const {
|
||||||
tmdbId,
|
tmdbId,
|
||||||
rootFolderPath,
|
rootFolderPath,
|
||||||
@ -65,7 +65,7 @@ class AddNewMovieModalContentConnector extends Component {
|
|||||||
monitor: monitor.value,
|
monitor: monitor.value,
|
||||||
qualityProfileId: qualityProfileId.value,
|
qualityProfileId: qualityProfileId.value,
|
||||||
tags: tags.value,
|
tags: tags.value,
|
||||||
searchForMissingEpisodes
|
searchForMovie
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +168,7 @@ class MovieDetails extends Component {
|
|||||||
monitored,
|
monitored,
|
||||||
studio,
|
studio,
|
||||||
overview,
|
overview,
|
||||||
|
youTubeTrailerId,
|
||||||
inCinemas,
|
inCinemas,
|
||||||
images,
|
images,
|
||||||
alternateTitles,
|
alternateTitles,
|
||||||
@ -426,6 +427,7 @@ class MovieDetails extends Component {
|
|||||||
<MovieDetailsLinks
|
<MovieDetailsLinks
|
||||||
tmdbId={tmdbId}
|
tmdbId={tmdbId}
|
||||||
imdbId={imdbId}
|
imdbId={imdbId}
|
||||||
|
youTubeTrailerId={youTubeTrailerId}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
@ -551,6 +553,7 @@ MovieDetails.propTypes = {
|
|||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
studio: PropTypes.string,
|
studio: PropTypes.string,
|
||||||
|
youTubeTrailerId: PropTypes.string,
|
||||||
inCinemas: PropTypes.string.isRequired,
|
inCinemas: PropTypes.string.isRequired,
|
||||||
overview: PropTypes.string.isRequired,
|
overview: PropTypes.string.isRequired,
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
@ -8,7 +8,8 @@ import styles from './MovieDetailsLinks.css';
|
|||||||
function MovieDetailsLinks(props) {
|
function MovieDetailsLinks(props) {
|
||||||
const {
|
const {
|
||||||
tmdbId,
|
tmdbId,
|
||||||
imdbId
|
imdbId,
|
||||||
|
youTubeTrailerId
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -28,7 +29,7 @@ function MovieDetailsLinks(props) {
|
|||||||
|
|
||||||
<Link
|
<Link
|
||||||
className={styles.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
|
<Label
|
||||||
className={styles.linkLabel}
|
className={styles.linkLabel}
|
||||||
@ -43,7 +44,7 @@ function MovieDetailsLinks(props) {
|
|||||||
!!imdbId &&
|
!!imdbId &&
|
||||||
<Link
|
<Link
|
||||||
className={styles.link}
|
className={styles.link}
|
||||||
to={`http://imdb.com/title/${imdbId}/`}
|
to={`https://imdb.com/title/${imdbId}/`}
|
||||||
>
|
>
|
||||||
<Label
|
<Label
|
||||||
className={styles.linkLabel}
|
className={styles.linkLabel}
|
||||||
@ -54,13 +55,46 @@ function MovieDetailsLinks(props) {
|
|||||||
</Label>
|
</Label>
|
||||||
</Link>
|
</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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
MovieDetailsLinks.propTypes = {
|
MovieDetailsLinks.propTypes = {
|
||||||
tmdbId: PropTypes.number.isRequired,
|
tmdbId: PropTypes.number.isRequired,
|
||||||
imdbId: PropTypes.string
|
imdbId: PropTypes.string,
|
||||||
|
youTubeTrailerId: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MovieDetailsLinks;
|
export default MovieDetailsLinks;
|
||||||
|
@ -74,7 +74,7 @@ class OrganizePreviewModalContent extends Component {
|
|||||||
isPopulated,
|
isPopulated,
|
||||||
error,
|
error,
|
||||||
items,
|
items,
|
||||||
renameEpisodes,
|
renameMovies,
|
||||||
standardMovieFormat,
|
standardMovieFormat,
|
||||||
path,
|
path,
|
||||||
onModalClose
|
onModalClose
|
||||||
@ -109,7 +109,7 @@ class OrganizePreviewModalContent extends Component {
|
|||||||
!isFetching && isPopulated && !items.length &&
|
!isFetching && isPopulated && !items.length &&
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
renameEpisodes ?
|
renameMovies ?
|
||||||
<div>Success! My work is done, no files to rename.</div> :
|
<div>Success! My work is done, no files to rename.</div> :
|
||||||
<div>Renaming is disabled, nothing to rename</div>
|
<div>Renaming is disabled, nothing to rename</div>
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ OrganizePreviewModalContent.propTypes = {
|
|||||||
error: PropTypes.object,
|
error: PropTypes.object,
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
path: PropTypes.string.isRequired,
|
path: PropTypes.string.isRequired,
|
||||||
renameEpisodes: PropTypes.bool,
|
renameMovies: PropTypes.bool,
|
||||||
standardMovieFormat: PropTypes.string,
|
standardMovieFormat: PropTypes.string,
|
||||||
onOrganizePress: PropTypes.func.isRequired,
|
onOrganizePress: PropTypes.func.isRequired,
|
||||||
onModalClose: PropTypes.func.isRequired
|
onModalClose: PropTypes.func.isRequired
|
||||||
|
@ -19,7 +19,7 @@ function createMapStateToProps() {
|
|||||||
props.isFetching = organizePreview.isFetching || naming.isFetching;
|
props.isFetching = organizePreview.isFetching || naming.isFetching;
|
||||||
props.isPopulated = organizePreview.isPopulated && naming.isPopulated;
|
props.isPopulated = organizePreview.isPopulated && naming.isPopulated;
|
||||||
props.error = organizePreview.error || naming.error;
|
props.error = organizePreview.error || naming.error;
|
||||||
props.renameEpisodes = naming.item.renameEpisodes;
|
props.renameMovies = naming.item.renameMovies;
|
||||||
props.standardMovieFormat = naming.item.standardMovieFormat;
|
props.standardMovieFormat = naming.item.standardMovieFormat;
|
||||||
props.path = movie.path;
|
props.path = movie.path;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class Naming extends Component {
|
|||||||
namingModalOptions
|
namingModalOptions
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const renameEpisodes = hasSettings && settings.renameEpisodes.value;
|
const renameMovies = hasSettings && settings.renameMovies.value;
|
||||||
|
|
||||||
const standardMovieFormatHelpTexts = [];
|
const standardMovieFormatHelpTexts = [];
|
||||||
const standardMovieFormatErrors = [];
|
const standardMovieFormatErrors = [];
|
||||||
@ -112,10 +112,10 @@ class Naming extends Component {
|
|||||||
|
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.CHECK}
|
type={inputTypes.CHECK}
|
||||||
name="renameEpisodes"
|
name="renameMovies"
|
||||||
helpText="Radarr will use the existing file name if renaming is disabled"
|
helpText="Radarr will use the existing file name if renaming is disabled"
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
{...settings.renameEpisodes}
|
{...settings.renameMovies}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class Naming extends Component {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
{
|
{
|
||||||
renameEpisodes &&
|
renameMovies &&
|
||||||
<div>
|
<div>
|
||||||
<FormGroup size={sizes.LARGE}>
|
<FormGroup size={sizes.LARGE}>
|
||||||
<FormLabel>Standard Movie Format</FormLabel>
|
<FormLabel>Standard Movie Format</FormLabel>
|
||||||
|
@ -4,9 +4,15 @@ function getNewMovie(movie, payload) {
|
|||||||
rootFolderPath,
|
rootFolderPath,
|
||||||
monitor,
|
monitor,
|
||||||
qualityProfileId,
|
qualityProfileId,
|
||||||
tags
|
tags,
|
||||||
|
searchForMovie = false
|
||||||
} = payload;
|
} = payload;
|
||||||
|
|
||||||
|
const addOptions = {
|
||||||
|
searchForMovie
|
||||||
|
};
|
||||||
|
|
||||||
|
movie.addOptions = addOptions;
|
||||||
movie.monitored = monitor === 'true';
|
movie.monitored = monitor === 'true';
|
||||||
movie.qualityProfileId = qualityProfileId;
|
movie.qualityProfileId = qualityProfileId;
|
||||||
movie.rootFolderPath = rootFolderPath;
|
movie.rootFolderPath = rootFolderPath;
|
||||||
|
@ -90,8 +90,7 @@ public void should_check_diskspace_for_same_root_folder_only_once()
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
[Ignore("Unknown failure")]
|
public void should_not_check_diskspace_for_missing_movie_folders()
|
||||||
public void should_not_check_diskspace_for_missing_movies_folders()
|
|
||||||
{
|
{
|
||||||
GivenMovies(new Movie { Path = _moviesFolder });
|
GivenMovies(new Movie { Path = _moviesFolder });
|
||||||
|
|
||||||
@ -110,8 +109,6 @@ public void should_not_check_diskspace_for_missing_movies_folders()
|
|||||||
[TestCase("/var/lib/docker")]
|
[TestCase("/var/lib/docker")]
|
||||||
[TestCase("/some/place/docker/aufs")]
|
[TestCase("/some/place/docker/aufs")]
|
||||||
[TestCase("/etc/network")]
|
[TestCase("/etc/network")]
|
||||||
[TestCase("/snap/filebot/9")]
|
|
||||||
[TestCase("/snap/core/5145")]
|
|
||||||
public void should_not_check_diskspace_for_irrelevant_mounts(string path)
|
public void should_not_check_diskspace_for_irrelevant_mounts(string path)
|
||||||
{
|
{
|
||||||
var mount = new Mock<IMount>();
|
var mount = new Mock<IMount>();
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
|
||||||
using NzbDrone.Core.Movies;
|
using NzbDrone.Core.Movies;
|
||||||
|
|
||||||
namespace NzbDrone.Core.DiskSpace
|
namespace NzbDrone.Core.DiskSpace
|
||||||
@ -32,26 +31,29 @@ public DiskSpaceService(IMovieService movieService, IDiskProvider diskProvider,
|
|||||||
|
|
||||||
public List<DiskSpace> GetFreeSpace()
|
public List<DiskSpace> GetFreeSpace()
|
||||||
{
|
{
|
||||||
var diskSpace = new List<DiskSpace>();
|
var importantRootFolders = GetMoviesRootPaths().Distinct().ToList();
|
||||||
diskSpace.AddRange(GetMovieFreeSpace());
|
|
||||||
diskSpace.AddRange(GetFixedDisksFreeSpace());
|
|
||||||
|
|
||||||
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 _movieService.GetAllMovies()
|
||||||
|
.Where(s => _diskProvider.FolderExists(s.Path))
|
||||||
return GetDiskSpace(movieRootPaths);
|
.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 => d.DriveType == DriveType.Fixed)
|
||||||
.Where(d => !_regexSpecialDrive.IsMatch(d.RootDirectory))
|
.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)
|
private IEnumerable<DiskSpace> GetDiskSpace(IEnumerable<string> paths, bool suppressWarnings = false)
|
||||||
|
@ -487,7 +487,7 @@ public Movie MapMovie(MovieResult result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
_logger.Debug("Not a valid date time.");
|
_logger.Debug("Not a valid date time.");
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ public NamingConfigModule(INamingConfigService namingConfigService,
|
|||||||
|
|
||||||
Get["/examples"] = x => GetExamples(this.Bind<NamingConfigResource>());
|
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.StandardMovieFormat).ValidMovieFormat();
|
||||||
SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat();
|
SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat();
|
||||||
}
|
}
|
||||||
@ -94,12 +93,10 @@ private void ValidateFormatResult(NamingConfig nameSpec)
|
|||||||
{
|
{
|
||||||
var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);
|
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>();
|
var validationFailures = new List<ValidationFailure>();
|
||||||
|
|
||||||
//validationFailures.AddIfNotNull(standardMovieValidationResult);
|
|
||||||
|
|
||||||
if (validationFailures.Any())
|
if (validationFailures.Any())
|
||||||
{
|
{
|
||||||
throw new ValidationException(validationFailures.DistinctBy(v => v.PropertyName).ToArray());
|
throw new ValidationException(validationFailures.DistinctBy(v => v.PropertyName).ToArray());
|
||||||
|
@ -5,14 +5,11 @@ namespace Radarr.Api.V2.Config
|
|||||||
{
|
{
|
||||||
public class NamingConfigResource : RestResource
|
public class NamingConfigResource : RestResource
|
||||||
{
|
{
|
||||||
public bool RenameEpisodes { get; set; }
|
public bool RenameMovies { get; set; }
|
||||||
public bool ReplaceIllegalCharacters { get; set; }
|
public bool ReplaceIllegalCharacters { get; set; }
|
||||||
public ColonReplacementFormat ColonReplacementFormat { get; set; }
|
public ColonReplacementFormat ColonReplacementFormat { get; set; }
|
||||||
public string StandardMovieFormat { get; set; }
|
public string StandardMovieFormat { get; set; }
|
||||||
public string MovieFolderFormat { 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 IncludeQuality { get; set; }
|
||||||
public bool ReplaceSpaces { get; set; }
|
public bool ReplaceSpaces { get; set; }
|
||||||
public string Separator { get; set; }
|
public string Separator { get; set; }
|
||||||
|
@ -4,14 +4,6 @@ namespace Radarr.Api.V2.Config
|
|||||||
{
|
{
|
||||||
public class NamingExampleResource
|
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 MovieExample { get; set; }
|
||||||
public string MovieFolderExample { get; set; }
|
public string MovieFolderExample { get; set; }
|
||||||
}
|
}
|
||||||
@ -24,14 +16,11 @@ public static NamingConfigResource ToResource(this NamingConfig model)
|
|||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
|
|
||||||
RenameEpisodes = model.RenameEpisodes,
|
RenameMovies = model.RenameEpisodes,
|
||||||
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
|
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
|
||||||
MultiEpisodeStyle = model.MultiEpisodeStyle,
|
|
||||||
ColonReplacementFormat = model.ColonReplacementFormat,
|
ColonReplacementFormat = model.ColonReplacementFormat,
|
||||||
StandardMovieFormat = model.StandardMovieFormat,
|
StandardMovieFormat = model.StandardMovieFormat,
|
||||||
MovieFolderFormat = model.MovieFolderFormat,
|
MovieFolderFormat = model.MovieFolderFormat,
|
||||||
//IncludeSeriesTitle
|
|
||||||
//IncludeEpisodeTitle
|
|
||||||
//IncludeQuality
|
//IncludeQuality
|
||||||
//ReplaceSpaces
|
//ReplaceSpaces
|
||||||
//Separator
|
//Separator
|
||||||
@ -41,8 +30,6 @@ public static NamingConfigResource ToResource(this NamingConfig model)
|
|||||||
|
|
||||||
public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource)
|
public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource)
|
||||||
{
|
{
|
||||||
resource.IncludeSeriesTitle = basicNamingConfig.IncludeSeriesTitle;
|
|
||||||
resource.IncludeEpisodeTitle = basicNamingConfig.IncludeEpisodeTitle;
|
|
||||||
resource.IncludeQuality = basicNamingConfig.IncludeQuality;
|
resource.IncludeQuality = basicNamingConfig.IncludeQuality;
|
||||||
resource.ReplaceSpaces = basicNamingConfig.ReplaceSpaces;
|
resource.ReplaceSpaces = basicNamingConfig.ReplaceSpaces;
|
||||||
resource.Separator = basicNamingConfig.Separator;
|
resource.Separator = basicNamingConfig.Separator;
|
||||||
@ -55,9 +42,8 @@ public static NamingConfig ToModel(this NamingConfigResource resource)
|
|||||||
{
|
{
|
||||||
Id = resource.Id,
|
Id = resource.Id,
|
||||||
|
|
||||||
RenameEpisodes = resource.RenameEpisodes,
|
RenameEpisodes = resource.RenameMovies,
|
||||||
ReplaceIllegalCharacters = resource.ReplaceIllegalCharacters,
|
ReplaceIllegalCharacters = resource.ReplaceIllegalCharacters,
|
||||||
MultiEpisodeStyle = resource.MultiEpisodeStyle,
|
|
||||||
ColonReplacementFormat = resource.ColonReplacementFormat,
|
ColonReplacementFormat = resource.ColonReplacementFormat,
|
||||||
StandardMovieFormat = resource.StandardMovieFormat,
|
StandardMovieFormat = resource.StandardMovieFormat,
|
||||||
MovieFolderFormat = resource.MovieFolderFormat,
|
MovieFolderFormat = resource.MovieFolderFormat,
|
||||||
|
@ -13,22 +13,26 @@ public class RenameMovieModule : RadarrRestModule<RenameMovieResource>
|
|||||||
private readonly IRenameMovieFileService _renameMovieFileService;
|
private readonly IRenameMovieFileService _renameMovieFileService;
|
||||||
|
|
||||||
public RenameMovieModule(IRenameMovieFileService renameMovieFileService)
|
public RenameMovieModule(IRenameMovieFileService renameMovieFileService)
|
||||||
: base("renameMovie")
|
: base("rename")
|
||||||
{
|
{
|
||||||
_renameMovieFileService = renameMovieFileService;
|
_renameMovieFileService = renameMovieFileService;
|
||||||
|
|
||||||
GetResourceAll = GetMovies; //TODO: GetResourceSingle?
|
GetResourceAll = GetMovies;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<RenameMovieResource> 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");
|
throw new BadRequestException("movieId is missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
var movieId = (int)Request.Query.MovieId;
|
|
||||||
|
|
||||||
return _renameMovieFileService.GetRenamePreviews(movieId).ToResource();
|
return _renameMovieFileService.GetRenamePreviews(movieId).ToResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user