Fixed: Trying to add a series when root folders hadn't populated
Fixed #3387
This commit is contained in:
parent
06d57e8f32
commit
a6d0dddaf7
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue