Fixed the broken tests

This commit is contained in:
Mark McDowall 2013-11-22 08:59:03 -08:00
parent 5659a3c496
commit c90d010cd8
4 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using FluentValidation.Results;
@ -56,6 +57,12 @@ namespace NzbDrone.Api.Config
{
var nameSpec = _namingConfigService.GetConfig();
var resource = nameSpec.InjectTo<NamingConfigResource>();
if (String.IsNullOrWhiteSpace(resource.StandardEpisodeFormat))
{
return resource;
}
var basicConfig = _filenameBuilder.GetBasicNamingConfig(nameSpec);
resource.InjectFrom(basicConfig);

View File

@ -181,6 +181,11 @@ namespace NzbDrone.Core.Organizer
{
var episodeFormat = GetEpisodeFormat(nameSpec.StandardEpisodeFormat);
if (episodeFormat == null)
{
return new BasicNamingConfig();
}
var basicNamingConfig = new BasicNamingConfig
{
Separator = episodeFormat.Separator,

View File

@ -5,9 +5,8 @@ define(
'vent',
'marionette',
'Settings/MediaManagement/Naming/NamingSampleModel',
'Settings/MediaManagement/Naming/Wizard/NamingWizardModel',
'Mixins/AsModelBoundView'
], function (_, vent, Marionette, NamingSampleModel, NamingWizardModel, AsModelBoundView) {
], function (_, vent, Marionette, NamingSampleModel, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/MediaManagement/Naming/Basic/BasicNamingViewTemplate',

View File

@ -37,8 +37,8 @@ define(
this.ui.namingOptions.hide();
}
this.basicNamingView = new BasicNamingView({ model: this.model });
this.basicNamingRegion.show(this.basicNamingView);
var basicNamingView = new BasicNamingView({ model: this.model });
this.basicNamingRegion.show(basicNamingView);
this.namingSampleModel = new NamingSampleModel();
this.listenTo(this.model, 'change', this._updateSamples);