TVServerLogger Bug - BugFix Attached

Discussion in '1.0 final and SVN Builds' started by TheGangster, April 5, 2009.

  1. TheGangster

    TheGangster Portal Member

    Joined:
    March 31, 2009
    Messages:
    7
    Likes Received:
    0
    Ratings:
    +0 / 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 (Text):
    1.  
    2. new DirectoryInfo(basePath + "\\AnalogCard").GetFiles("*.xml");
    3.  
    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 (Text):
    1.  
    2.       string analogCardPath = basePath + "\\AnalogCard";
    3.       if (Directory.Exists(analogCardPath))
    4.       {
    5.           FileInfo[] xmlFiles = new DirectoryInfo(analogCardPath).GetFiles("*.xml");
    6.           foreach (FileInfo xmlFile in xmlFiles)
    7.           {
    8.               xmlFile.CopyTo(destinationFolder + "\\tvserver_AnalogCard_" + xmlFile.Name, true);
    9.           }
    10.       }
    11.  
    This will prevent it from crashing, by not assuming that the directory is there.

    Modified file attached.

    Thanks
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. rekenaar
    • Team MediaPortal

    rekenaar Retired Team Member

    Joined:
    December 17, 2006
    Messages:
    4,421
    Likes Received:
    782
    Ratings:
    +785 / 0
    Home Country:
    South Africa South Africa
    Hi

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

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!