diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
index 716666123..78d9e4994 100644
--- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
+++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
@@ -204,7 +204,7 @@
-
+
diff --git a/NzbDrone.Core.Test/TvTests/SeriesProviderTest.cs b/NzbDrone.Core.Test/TvTests/SeriesServiceFixture.cs
similarity index 51%
rename from NzbDrone.Core.Test/TvTests/SeriesProviderTest.cs
rename to NzbDrone.Core.Test/TvTests/SeriesServiceFixture.cs
index 8cf08a429..71334d1fb 100644
Binary files a/NzbDrone.Core.Test/TvTests/SeriesProviderTest.cs and b/NzbDrone.Core.Test/TvTests/SeriesServiceFixture.cs differ
diff --git a/NzbDrone.Core/MediaFiles/Commands/DiskScanCommand.cs b/NzbDrone.Core/MediaFiles/Commands/DiskScanCommand.cs
index 6d5b144fd..db7dd7a04 100644
--- a/NzbDrone.Core/MediaFiles/Commands/DiskScanCommand.cs
+++ b/NzbDrone.Core/MediaFiles/Commands/DiskScanCommand.cs
@@ -13,9 +13,5 @@ namespace NzbDrone.Core.MediaFiles.Commands
SeriesId = seriesId;
}
}
-
- public DiskScanCommand()
- {
- }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/MediaFiles/DiskScanService.cs b/NzbDrone.Core/MediaFiles/DiskScanService.cs
index 2ea1f5c4c..d8d07e967 100644
--- a/NzbDrone.Core/MediaFiles/DiskScanService.cs
+++ b/NzbDrone.Core/MediaFiles/DiskScanService.cs
@@ -9,6 +9,7 @@ using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Tv;
+using NzbDrone.Core.Tv.Events;
namespace NzbDrone.Core.MediaFiles
{
@@ -18,7 +19,7 @@ namespace NzbDrone.Core.MediaFiles
string[] GetVideoFiles(string path, bool allDirectories = true);
}
- public class DiskScanService : IDiskScanService, IExecute
+ public class DiskScanService : IDiskScanService, IExecute, IHandle
{
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private static readonly string[] MediaExtensions = new[] { ".mkv", ".avi", ".wmv", ".mp4", ".mpg", ".mpeg", ".xvid", ".flv", ".mov", ".rm", ".rmvb", ".divx", ".dvr-ms", ".ts", ".ogm", ".m4v", ".strm" };
@@ -143,5 +144,10 @@ namespace NzbDrone.Core.MediaFiles
Scan(series);
}
}
+
+ public void Handle(EpisodeInfoAddedEvent message)
+ {
+ Scan(message.Series);
+ }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/Tv/EpisodeService.cs b/NzbDrone.Core/Tv/EpisodeService.cs
index 28e19f7c9..5ba9c4ae2 100644
--- a/NzbDrone.Core/Tv/EpisodeService.cs
+++ b/NzbDrone.Core/Tv/EpisodeService.cs
@@ -206,7 +206,7 @@ namespace NzbDrone.Core.Tv
if (newList.Any())
{
- _messageAggregator.PublishEvent(new EpisodeInfoAddedEvent(newList));
+ _messageAggregator.PublishEvent(new EpisodeInfoAddedEvent(newList, series));
}
if (updateList.Any())
diff --git a/NzbDrone.Core/Tv/Events/EpisodeInfoAddedEvent.cs b/NzbDrone.Core/Tv/Events/EpisodeInfoAddedEvent.cs
index 8bca207ad..ff6353b9c 100644
--- a/NzbDrone.Core/Tv/Events/EpisodeInfoAddedEvent.cs
+++ b/NzbDrone.Core/Tv/Events/EpisodeInfoAddedEvent.cs
@@ -6,10 +6,12 @@ namespace NzbDrone.Core.Tv.Events
{
public class EpisodeInfoAddedEvent : IEvent
{
+ public Series Series { get; private set; }
public ReadOnlyCollection Episodes { get; private set; }
- public EpisodeInfoAddedEvent(IList episodes)
+ public EpisodeInfoAddedEvent(IList episodes, Series series)
{
+ Series = series;
Episodes = new ReadOnlyCollection(episodes);
}
}
diff --git a/NzbDrone.Core/Tv/SeriesService.cs b/NzbDrone.Core/Tv/SeriesService.cs
index 22e423f30..84311befa 100644
--- a/NzbDrone.Core/Tv/SeriesService.cs
+++ b/NzbDrone.Core/Tv/SeriesService.cs
@@ -101,18 +101,20 @@ namespace NzbDrone.Core.Tv
{
Ensure.That(() => newSeries).IsNotNull();
- if (String.IsNullOrWhiteSpace(newSeries.FolderName))
- {
- newSeries.FolderName = FileNameBuilder.CleanFilename(newSeries.Title);
- _diskProvider.CreateFolder(Path.Combine(_rootFolderService.Get(newSeries.RootFolderId).Path, newSeries.FolderName));
- }
+ newSeries.FolderName = FileNameBuilder.CleanFilename(newSeries.Title);
+ newSeries.RootFolder = _rootFolderService.Get(newSeries.RootFolderId);
+
+ _diskProvider.CreateFolder(newSeries.Path);
_logger.Info("Adding Series [{0}] Path: [{1}]", newSeries.Title, newSeries.Path);
newSeries.Monitored = true;
newSeries.CleanTitle = Parser.Parser.NormalizeTitle(newSeries.Title);
+
if (newSeries.QualityProfileId == 0)
+ {
newSeries.QualityProfileId = _configService.DefaultQualityProfile;
+ }
newSeries.SeasonFolder = _configService.UseSeasonFolder;
newSeries.BacklogSetting = BacklogSettingType.Inherit;
diff --git a/UI/Series/Delete/DeleteSeriesView.js b/UI/Series/Delete/DeleteSeriesView.js
index f3bfdf890..34ef1a907 100644
--- a/UI/Series/Delete/DeleteSeriesView.js
+++ b/UI/Series/Delete/DeleteSeriesView.js
@@ -2,7 +2,7 @@
define(['app', 'Series/SeriesModel'], function () {
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
- template : 'Series/Delete/DeleteSeriesTemplate',
+ template: 'Series/Delete/DeleteSeriesTemplate',
events: {
'click .x-confirm-delete': 'removeSeries'
@@ -18,6 +18,7 @@ define(['app', 'Series/SeriesModel'], function () {
this.model.destroy({
data : { 'deleteFiles': deleteFiles },
+ wait : true,
success: function (model) {
model.collection.remove(model);
}
diff --git a/UI/Series/SeriesCollection.js b/UI/Series/SeriesCollection.js
index 53ecbdff2..78df7bba8 100644
--- a/UI/Series/SeriesCollection.js
+++ b/UI/Series/SeriesCollection.js
@@ -1,6 +1,6 @@
"use strict";
define(['app', 'Series/SeriesModel'], function () {
- NzbDrone.Series.SeriesCollection = Backbone.PageableCollection.extend({
+ NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/series',
model: NzbDrone.Series.SeriesModel,