Skip to content

Commit

Permalink
Fix for #362
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Mar 19, 2018
1 parent 0fe036b commit e6d8488
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
15 changes: 12 additions & 3 deletions TVRename#/ItemsAndActions/ActionCopyMoveRename.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,19 @@ public override bool Go(ref bool pause, TVRenameStats stats)
// ignored
}

if (Operation == Op.Move && _tidyup != null && _tidyup.DeleteEmpty)
try
{
logger.Info($"Testing {From.Directory.FullName } to see whether it should be tidied up");
DoTidyup(From.Directory );
if (Operation == Op.Move && _tidyup != null && _tidyup.DeleteEmpty)
{
logger.Info($"Testing {From.Directory.FullName} to see whether it should be tidied up");
DoTidyup(From.Directory);
}
}
catch (Exception e)
{
Done = true;
Error = true;
ErrorText = e.Message;
}

return !Error;
Expand Down
2 changes: 1 addition & 1 deletion TVRename#/ItemsAndActions/ActionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected void DeleteOrRecycleFolder(DirectoryInfo di)
else
{
logger.Info($"Deleting {di.FullName}");
di.Delete();
di.Delete(true,true);
}
}

Expand Down
3 changes: 3 additions & 0 deletions TVRename#/TVRename/TVDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,9 @@ public void ActionProcessor(Object queuesIn)
catch (Exception e)
{
logger.Fatal(e,"Unhandled Exception in ActionProcessor");
foreach (Thread t in this.ActionWorkers)
t.Abort();
this.WaitForAllActionThreadsAndTidyUp();
return;
}
}
Expand Down

0 comments on commit e6d8488

Please sign in to comment.