AddNew is functional, using jquery for adding and display changes.

This commit is contained in:
Mark McDowall
2011-03-15 08:29:14 -07:00
parent 5a8842e3db
commit 3d81bc8770
6 changed files with 104 additions and 43 deletions

View File

@@ -65,7 +65,7 @@ namespace NzbDrone.Core.Providers
public bool BeginSyncUnmappedFolders(List<SeriesMappingModel> unmapped)
{
Logger.Debug("User has request series folder scan");
Logger.Debug("User has requested series folder scan");
if (_seriesSyncThread == null || !_seriesSyncThread.IsAlive)
{
Logger.Debug("Initializing background scan of series folder.");
@@ -90,6 +90,42 @@ namespace NzbDrone.Core.Providers
return true;
}
public bool BeginAddNewSeries(string dir, int seriesId, string seriesName)
{
Logger.Debug("User has requested adding of new series");
if (_seriesSyncThread == null || !_seriesSyncThread.IsAlive)
{
Logger.Debug("Initializing background add of of series folder.");
_seriesSyncThread = new Thread(SyncUnmappedFolders)
{
Name = "SyncUnmappedFolders",
Priority = ThreadPriority.Lowest
};
_syncList = new List<SeriesMappingModel>();
var path = dir + Path.DirectorySeparatorChar + seriesName;
//Create a directory for this new series
_diskProvider.CreateDirectory(path);
//Add it to the list so it will be processed
_syncList.Add(new SeriesMappingModel { Path = path, TvDbId = seriesId });
_seriesSyncThread.Start();
}
else
{
Logger.Warn("Series folder scan already in progress. Ignoring request.");
//return false if sync was already running, then we can tell the user to try again later
return false;
}
//return true if sync has started
return true;
}
private void SyncUnmappedFolders()
{
Logger.Info("Starting Series folder scan");