Fixed: Trying to add a series when root folders hadn't populated

Fixed #3387
This commit is contained in:
Mark McDowall 2019-11-14 08:32:54 -08:00
parent 06d57e8f32
commit a6d0dddaf7
2 changed files with 24 additions and 0 deletions

View File

@ -95,6 +95,27 @@ class RootFolderSelectInputConnector extends Component {
}
}
componentDidUpdate(prevProps) {
const {
name,
value,
values,
onChange
} = this.props;
if (prevProps.values === values) {
return;
}
if (!value && values.length && values.some((v) => !!v.key && v.key !== ADD_NEW_KEY)) {
const defaultValue = values[0];
if (defaultValue.key !== ADD_NEW_KEY) {
onChange({ name, value: defaultValue.key });
}
}
}
//
// Listeners

View File

@ -25,6 +25,9 @@ namespace Sonarr.Api.V3.Series
if (seriesResource == null) return true;
var rootFolderPath = context.PropertyValue.ToString();
if (rootFolderPath.IsNullOrWhiteSpace()) return true;
var rootFolder = new DirectoryInfo(rootFolderPath).Name;
var series = seriesResource.ToModel();
var seriesFolder = _fileNameBuilder.GetSeriesFolder(series);