TVServerLogger Bug - BugFix Attached (1 Viewer)

TheGangster

Portal Member
March 31, 2009
7
0
Home Country
Portugal Portugal
Using the latest SVN revision 22162, I came up with a problem.

I have uninstalled the TV Server, but it left a log on ProgramData\Team MediaPortal\MediaPortal TV Server\log called un.install_1.0.0.0_2009-03-30_15-35-25.log.

The TVServerLogger is assuming that if I have that directory and if I have a file inside it then I have everything that needs for it to collect the log data.

So WatchDog will crash on:

Code:
new DirectoryInfo(basePath + "\\AnalogCard").GetFiles("*.xml");

Because the directory does not exist.

In order to fix this problem I have added the following lines on line 55 under TvServerLogger.cs on MediaPortal.Support:

Code:
      string analogCardPath = basePath + "\\AnalogCard";
      if (Directory.Exists(analogCardPath))
      {
          FileInfo[] xmlFiles = new DirectoryInfo(analogCardPath).GetFiles("*.xml");
          foreach (FileInfo xmlFile in xmlFiles)
          {
              xmlFile.CopyTo(destinationFolder + "\\tvserver_AnalogCard_" + xmlFile.Name, true);
          }
      }

This will prevent it from crashing, by not assuming that the directory is there.

Modified file attached.

Thanks
 

rekenaar

Retired Team Member
  • Premium Supporter
  • December 17, 2006
    4,421
    805
    Home Country
    South Africa South Africa
    Hi

    Thanks for you contribution. Chemilli already fixed it in on 2009-04-03.
     

    Users who are viewing this thread

    Top Bottom