-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ignore failed folders: treat them appropriately
Folders can unfail at any point. Don't fetch ignores for failed folders, but do fetch ignores when they unfail. Don't watch failed folders. Fixes #187
- Loading branch information
Showing
9 changed files
with
91 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections.Generic; | ||
using NLog; | ||
using SyncTrayzor.SyncThing.ApiClient; | ||
|
||
namespace SyncTrayzor.SyncThing | ||
{ | ||
public static class FolderStateTransformer | ||
{ | ||
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); | ||
|
||
private static readonly Dictionary<string, FolderSyncState> folderSyncStateLookup = new Dictionary<string, FolderSyncState>() | ||
{ | ||
{ "syncing", FolderSyncState.Syncing }, | ||
{ "idle", FolderSyncState.Idle }, | ||
{ "error", FolderSyncState.Error }, | ||
}; | ||
|
||
public static FolderSyncState SyncStateFromStatus(string state) | ||
{ | ||
FolderSyncState syncState; | ||
if (folderSyncStateLookup.TryGetValue(state, out syncState)) | ||
return syncState; | ||
|
||
logger.Warn($"Unknown folder sync state {state}. Defaulting to Idle"); | ||
|
||
// Default | ||
return FolderSyncState.Idle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters