Skip to content

Commit

Permalink
Resharper updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Dec 3, 2021
1 parent b7c2a0b commit 9c8a3f0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
24 changes: 12 additions & 12 deletions TVRename/Forms/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public UI(TVDoc doc, [NotNull] TVRenameSplash splash, bool showUi)
SetupObjectListForScanResults();

UpdateSplashStatus(splash, "Running Auto-scan");

SetStartUpTab();
}

Expand Down Expand Up @@ -273,7 +273,7 @@ public void ShowChildDialog(Form childForm)
}

// ReSharper disable once UnusedMember.Global
public void ShowChild(Form childForm)
public void ShowChild(Form childForm)
{
if (InvokeRequired)
{
Expand Down Expand Up @@ -2863,7 +2863,7 @@ private void AddMovie_Click(object sender, EventArgs e)
{
mDoc.Add(mov.AsList(),false);
FillMyMovies(mov);

mDoc.MoviesAddedOrEdited(true, false, WindowState == FormWindowState.Minimized, this, mov);
FillMyMovies(mov);

Expand Down Expand Up @@ -2895,7 +2895,7 @@ private void bnMyShowsAdd_Click(object sender, EventArgs e)
ShowAddedOrEdited(false, false, si,false);
SelectShow(si);
ShowAddedOrEdited(true, false, si, false);
Logger.Info("Added new show called {0}", si.ShowName);
Logger.Info($"Added new show called {si.ShowName}" );
}
else
{
Expand Down Expand Up @@ -2987,7 +2987,7 @@ private void RemoveFromDisk(string folderName,MediaConfiguration si)
{
return;
}
try {
try {
IEnumerable<string> videofilesThatWouldBeDeleted = Directory
.GetFiles(folderName, "*", SearchOption.AllDirectories)
.Where(f => f.IsMovieFile())
Expand Down Expand Up @@ -3139,7 +3139,7 @@ internal void EditShow([NotNull] ShowConfiguration si)
ShowAddedOrEdited(aes.HasChanged, false, si, true);
SelectShow(si);

Logger.Info("Modified show called {0}", si.ShowName);
Logger.Info($"Modified show called {si.ShowName}");
}

mDoc.AllowAutoScan();
Expand All @@ -3161,7 +3161,7 @@ internal void EditMovie([NotNull] MovieConfiguration si)
FillMyMovies();
SelectMovie(si);

Logger.Info("Modified movie called {0}", si.ShowName);
Logger.Info($"Modified movie called {si.ShowName}" );
}

mDoc.AllowAutoScan();
Expand Down Expand Up @@ -3825,14 +3825,14 @@ private void ActionAction(bool checkedNotSelected, bool unattended, bool doAll)
Token = actionCancellationToken
};

bool showUi = WindowState !=FormWindowState.Minimized && !mDoc.Args.Hide && Visible && Environment.UserInteractive;
bool showUi = WindowState !=FormWindowState.Minimized && !mDoc.Args.Hide && Visible && Environment.UserInteractive;
// If not /hide, show CopyMoveProgress dialog
if (showUi)
{
CopyMoveProgress cmp = new(mDoc,sett, () => actionCancellationToken.Cancel());
ShowChild(cmp);
}

bwAction.RunWorkerAsync(sett);
}

Expand Down Expand Up @@ -3884,7 +3884,7 @@ private void lvAction_MouseClick([NotNull] object sender, [NotNull] MouseEventAr
ItemList lvr = GetSelectedItems();

Item? action = olvAction.FocusedObject as Item;

if (action?.Episode != null && lvr.Count == 1)
{
switchToWhenOpenMyShows = action.Episode;
Expand Down Expand Up @@ -4573,7 +4573,7 @@ private void McbModifyMetadata_Click(object sender, EventArgs e)
private void ThanksToolStripMenuItem_Click(object sender, EventArgs e)
{
ThanksForm form = new();
form.ShowDialog(this);
form.ShowDialog(this);
}

private void TabControl1_DrawItem(object sender, [NotNull] DrawItemEventArgs e)
Expand Down Expand Up @@ -5213,7 +5213,7 @@ private void settingsCheckToolStripMenuItem_Click(object sender, EventArgs e)

SettingsReview form = new(mDoc, this);
form.ShowDialog(this);

mDoc.AllowAutoScan();
LessBusy();
}
Expand Down
6 changes: 3 additions & 3 deletions TVRename/Model/CachePersistor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static void SaveCacheInternal([NotNull] ConcurrentDictionary<int, Cached
di.Create();
}

Logger.Info("Saving Cache to: {0}", cacheFile.FullName);
Logger.Info($"Saving Cache to: {cacheFile.FullName}" );
try
{
RotateCacheFiles(cacheFile);
Expand Down Expand Up @@ -130,7 +130,7 @@ private static void SaveCacheInternal([NotNull] ConcurrentDictionary<int, Cached

public static bool LoadTvCache<T>([NotNull] FileInfo loadFrom, [NotNull] T cache) where T : MediaCache, iTVSource
{
Logger.Info("Loading Cache from: {0}", loadFrom.FullName);
Logger.Info($"Loading Cache from: {loadFrom.FullName}" );
if (!loadFrom.Exists)
{
return true; // that's ok
Expand All @@ -157,7 +157,7 @@ public static bool LoadTvCache<T>([NotNull] FileInfo loadFrom, [NotNull] T cache

public static bool LoadMovieCache<T>([NotNull] FileInfo loadFrom, T cache) where T : MediaCache, iMovieSource
{
Logger.Info("Loading Cache from: {0}", loadFrom.FullName);
Logger.Info($"Loading Cache from: {loadFrom.FullName}" );
if (!loadFrom.Exists)
{
return true; // that's ok
Expand Down
6 changes: 3 additions & 3 deletions TVRename/ScanActivity/FindNewItemsInDownloadFolders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override void DoCheck(SetProgressDelegate prog)
MDoc.TvAddedOrEdited(true, false, false, Settings.Owner, addedTvShows);
//add each new show into the shows being scanned
Settings.Shows.AddRange(addedTvShows);
LOGGER.Info("Added new shows called: {0}", addedTvShows.Select(s => s.ShowName).ToCsv());
LOGGER.Info($"Added new shows called: {addedTvShows.Select(s => s.ShowName).ToCsv()}" );
}

List<MovieConfiguration> addedMovies = addedShowsUnique.OfType<MovieConfiguration>().Distinct().ToList();
Expand All @@ -63,7 +63,7 @@ protected override void DoCheck(SetProgressDelegate prog)
MDoc.Add(addedMovies, true);
MDoc.MoviesAddedOrEdited(true, false, false, Settings.Owner, addedMovies);
Settings.Movies.AddRange(addedMovies);
LOGGER.Info("Added new movies called: {0}", addedMovies.Select(s => s.ShowName).ToCsv());
LOGGER.Info($"Added new movies called: {addedMovies.Select(s => s.ShowName).ToCsv()}");
}
}

Expand Down Expand Up @@ -94,7 +94,7 @@ private IEnumerable<FileInfo> GetPossibleFiles()

foreach (string dirPath in TVSettings.Instance.DownloadFolders.ToArray())
{
LOGGER.Info("Parsing {0} for new shows", dirPath);
LOGGER.Info($"Parsing {dirPath} for new shows" );
if (!Directory.Exists(dirPath))
{
continue;
Expand Down
4 changes: 2 additions & 2 deletions TVRename/TVRename/ActionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void ProcessSingleAction(object infoIn)

Action action = info.TheAction;

Logger.Trace("Triggering Action: {0} - {1} - {2}", action.Name, action.Produces, action.ToString());
Logger.Trace($"Triggering Action: {action.Name} - {action.Produces} - {action}" );
action.Outcome = action.Go(mStats);
if (action.Outcome.Error)
{
Expand Down Expand Up @@ -386,7 +386,7 @@ private static int GetQueueId([NotNull] Action action)
return 0;

default:
Logger.Fatal("No action type found for {0}, Please follow up with a developer.", action.GetType());
Logger.Fatal($"No action type found for {action.GetType()}, Please follow up with a developer." );
// put it in this queue by default
return 3;
}
Expand Down
6 changes: 3 additions & 3 deletions TVRename/TVRename/BulkAddMovieManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public BulkAddMovieManager(TVDoc doc)
foreach (FileInfo newFilm in films)
{
// ....its good!
Logger.Info("Adding {0} as a new Movie", newFilm.FullName);
Logger.Info($"Adding {newFilm.FullName} as a new Movie");
PossibleNewMovie ai = new(newFilm, andGuess, showErrorMsgBox);
AddItems.AddIfNew(ai);
}
Expand All @@ -113,7 +113,7 @@ public BulkAddMovieManager(TVDoc doc)
}
catch (UnauthorizedAccessException)
{
Logger.Info("Can't access {0}, so ignoring it", di2.FullName);
Logger.Info($"Can't access {di2.FullName}, so ignoring it");
return (true, null);
}
}
Expand Down Expand Up @@ -175,7 +175,7 @@ private void CheckFolderForShows([NotNull] DirectoryInfo di, CancellationToken t
{
if (fullLogging)
{
Logger.Info("Rejecting {0} as it's on the ignore list.", di.FullName);
Logger.Info($"Rejecting {di.FullName} as it's on the ignore list." );
}

return;
Expand Down
6 changes: 3 additions & 3 deletions TVRename/TVRename/BulkAddSeriesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ private bool HasSeasonFolders([NotNull] DirectoryInfo di, out DirectoryInfo[]? s
PossibleNewTvShow ai = new(di2, hasSeasonFolders, folderFormat);

AddItems.Add(ai);
Logger.Info("Adding {0} as a new folder", theFolder);
Logger.Info($"Adding {theFolder} as a new folder");
if (andGuess)
{
GuessShowItem(ai, mDoc.TvLibrary, showErrorMsgBox);
Expand All @@ -321,7 +321,7 @@ private bool HasSeasonFolders([NotNull] DirectoryInfo di, out DirectoryInfo[]? s
}
catch (UnauthorizedAccessException)
{
Logger.Info("Can't access {0}, so ignoring it", di2.FullName);
Logger.Info($"Can't access {di2.FullName}, so ignoring it" );
return (true, null);
}
}
Expand Down Expand Up @@ -396,7 +396,7 @@ private void CheckFolderForShows([NotNull] DirectoryInfo di, CancellationToken t
{
if (fullLogging)
{
Logger.Info("Rejecting {0} as it's on the ignore list.", di.FullName);
Logger.Info($"Rejecting {di.FullName} as it's on the ignore list.");
}

return;
Expand Down
4 changes: 2 additions & 2 deletions TVRename/TVRename/TVDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ private void WriteXmlSettingsInternal()
}
// backup old settings before writing new ones
FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName);
Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName);
Logger.Info($"Saving Settings to {PathManager.TVDocSettingsFile.FullName}" );

XmlWriterSettings settings = new()
{
Expand Down Expand Up @@ -620,7 +620,7 @@ private void WriteXmlSettingsInternal()
// ReSharper disable once InconsistentNaming
private bool LoadXMLSettings(FileInfo? from)
{
Logger.Info("Loading Settings from {0}", from?.FullName);
Logger.Info($"Loading Settings from {from?.FullName}" );
if (from is null)
{
return true;
Expand Down
4 changes: 2 additions & 2 deletions TVRename/Utility/Helper/HTTPHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static string HttpRequest([NotNull] string method, [NotNull] string url,
httpWebRequest.Headers.Add("Accept-Language", lang);
}

Logger.Trace("Obtaining {0}", url);
Logger.Trace($"Obtaining {url}" );

if (method == "POST")
{
Expand All @@ -147,7 +147,7 @@ public static string HttpRequest([NotNull] string method, [NotNull] string url,
{
result = streamReader.ReadToEnd();
}
Logger.Trace("Returned {0}", result);
Logger.Trace($"Returned {result}" );
return result;
}

Expand Down
6 changes: 3 additions & 3 deletions TVRename/Utility/Helper/RegistryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ private static bool SetBrowserEmulationVersion(BrowserEmulationVersion browserEm
{
// if it's a valid value, update or create the value
key.SetValue(programName, (int)browserEmulationVersion, RegistryValueKind.DWord);
Logger.Warn("SETTING REGISTRY:{0}-{1}-{2}-{3}", key.Name, programName, (int)browserEmulationVersion, RegistryValueKind.DWord.ToString());
Logger.Warn($"SETTING REGISTRY:{key.Name}-{programName}-{(int)browserEmulationVersion}-{RegistryValueKind.DWord}");
}
else
{
// otherwise, remove the existing value
key.DeleteValue(programName, false);
Logger.Warn("DELETING REGISTRY KEY:{0}-{1}", key.Name, programName);
Logger.Warn($"DELETING REGISTRY KEY:{key.Name}-{programName}");
}

return true;
Expand All @@ -153,7 +153,7 @@ private static bool SetBrowserEmulationVersion(BrowserEmulationVersion browserEm
private static BrowserEmulationVersion GetInternetExplorerVersion()
{
int ieVersion = GetInternetExplorerMajorVersion();
Logger.Info("IE Version {0} is identified", ieVersion);
Logger.Info($"IE Version {ieVersion} is identified");

if (ieVersion >= 11)
{
Expand Down

0 comments on commit 9c8a3f0

Please sign in to comment.