Skip to content

Commit

Permalink
Merge pull request #193 from MarkSummerville/master
Browse files Browse the repository at this point in the history
Fix for #191 and logging updates to reduce AppVeyor noise
  • Loading branch information
SirSparkles authored Dec 22, 2017
2 parents 3da39a6 + dc3ec1d commit 5ab7f1f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion TVRename#/Forms/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ private void ScanRecent()
private void Scan(List<ShowItem> shows)
{
logger.Info("*******************************");
logger.Info("Starting Scan for {0} shows...",shows.Count>0? shows.Count.ToString() :"all");
logger.Info("Starting Scan for {0} shows...",shows?.Count>0? shows.Count.ToString() :"all");
this.MoreBusy();
this.mDoc.ActionGo(shows);
this.LessBusy();
Expand Down
1 change: 0 additions & 1 deletion TVRename#/TVRename#.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="App\Version.cs" />
<Compile Include="Utility\Win32FileIO.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App\app.ico" />
Expand Down
8 changes: 4 additions & 4 deletions TVRename#/TVRename/TVDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public class TVDoc
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
private static NLog.Logger threadslogger = NLog.LogManager.GetLogger("threads");

private bool DebugThreads = false;

private List<Finder> Finders;

string[] SeasonWords = new[] { "Season", // EN
Expand Down Expand Up @@ -1896,6 +1894,8 @@ public bool CheckAllFoldersExist(List<ShowItem> showlist)
}
catch (System.IO.IOException ioe)
{
logger.Info("Could not directory: {0}", folder);
logger.Info(ioe);
}
goAgain = true;

Expand Down Expand Up @@ -2136,7 +2136,7 @@ public bool fileNeeded(FileInfo fi, ShowItem si, DirFilesCache dfc)
return false;
}
}
catch (SeriesInfo.EpisodeNotFoundException ex)
catch (SeriesInfo.EpisodeNotFoundException)
{
//Ignore execption, we may need the file
return true;
Expand Down Expand Up @@ -2167,7 +2167,7 @@ public bool fileNeeded(DirectoryInfo di, ShowItem si, DirFilesCache dfc)
return false;
}
}
catch (SeriesInfo.EpisodeNotFoundException ex)
catch (SeriesInfo.EpisodeNotFoundException )
{
//Ignore execption, we may need the file
return true;
Expand Down
1 change: 1 addition & 0 deletions TVRename#/TheTVDB/Episode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ private void loadJSON(int seriesId, JObject r)
}
catch (Exception e)
{
logger.Debug(e, "Failed to parse firstAired");
this.FirstAired = null;

}
Expand Down
16 changes: 12 additions & 4 deletions TVRename#/TheTVDB/TheTVDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ public bool GetUpdates()
catch (WebException ex)
{
logger.Warn("Error obtaining " + uri + ": from lastupdated query -since(local) " + Helpers.FromUnixTime(epochTime).ToLocalTime());
logger.Warn(ex.Message);
logger.Warn(ex);
this.Say("");
this.LastError = ex.Message;
moreUpdates = false;
Expand Down Expand Up @@ -1128,7 +1128,8 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo
}
catch (WebException ex)
{
logger.Error("Error obtaining " + uri + ": " + ex.Message);
logger.Error("Error obtaining {0}", uri);
logger.Error (ex);
this.Say("");
this.LastError = ex.Message;
return null;
Expand Down Expand Up @@ -1251,9 +1252,12 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo
}
catch (WebException ex) {
//no images for chosen language
logger.Trace("No images found for {0} in language {1}", APIRoot + "/series/" + code + "/images", TVSettings.Instance.PreferredLanguage);
logger.Warn(ex.Message);

}



foreach (string imageType in imageTypes)
{
Expand All @@ -1265,6 +1269,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo
catch (WebException WebEx)
{
logger.Info("Looking for " + imageType + " images (in local language), but none found for seriesId " + code);
logger.Info(WebEx);
}

}
Expand All @@ -1286,6 +1291,8 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo
}
catch (WebException ex)
{
logger.Info("Looking for images, but none found for seriesId {0} in {1}", code ,DefaultLanguage );

//no images for chosen language
}

Expand All @@ -1300,6 +1307,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo
catch (WebException WebEx)
{
logger.Info("Looking for " + imageType + " images, but none found for seriesId " + code);
logger.Info(WebEx);
}
}

Expand Down
3 changes: 3 additions & 0 deletions TVRename#/Utility/BT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ private static class BTPrio { public const int Normal = 0x08, Skip = 0x80; }
public bool TestMode;
public string Type;

private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

public BTResume(SetProgressDelegate setprog, string resumeDatFile)
: base(setprog)
{
Expand Down Expand Up @@ -1111,6 +1113,7 @@ public System.Collections.Generic.List<TorrentEntry> AllFilesBeingDownloaded()
catch (PathTooLongException ptle)
{
//this is not the file we are looking for
logger.Debug(ptle);
}
}
c++;
Expand Down

0 comments on commit 5ab7f1f

Please sign in to comment.