[Videos] Ftp Video Folder as Default fails (1 Viewer)

DieBagger

Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    MediaPortal Version: 1.10 Beta 1
    MediaPortal Skin: StreamedMP
    Windows Version: Windows XP SP3
    CPU Type: Intel(R) Core(TM)2 Duo E8400 @ 3.00 GHz
    HDD: 1x HITACHI Deskstar 7K80 HDS728080PLA380, 7x Samsung Spinpoint (500 GB - 1 TB)
    Memory: 4 GB Corsair XMS2 CM2X2048-6400C5
    Motherboard: Gigabyte GA-EP45-UD3P
    Video Card: MSI NX7300GT-EH (MS-V041), NVIDIA GeForce 7300 GT (256 MB)
    Video Card Driver:
    Sound Card: Soundkarte Realtek ALC889A @ Intel 82801JB ICH10 - High Definition Audio Controller
    Sound Card AC3: no AC3
    Sound Card Driver:
    1. TV Card: FloppyDTV S2
    1. TV Card Type: DVB-S
    1. TV Card Driver:
    h.264 Video Codec: CoreAVC 1.9.5.0
    Satelite/CableTV Provider:
    HTPC Case:
    Cooling:
    Power Supply:
    Remote:
    TV:
    TV - HTPC Connection:


    When I add a video folder from a ftp location and set this folder as default it will break "My Videos".

    Steps to reproduce
    1. Add ftp folder
    2. set as default
    3. start mediaportal
    4. enter myvideos

    ftp_fail.PNG


    Going throw the logs, the problem seems to be:

    2009-11-16 23:21:25.668945 [Info.][MPMain]: Error initializing window:MediaPortal.GUI.Video.GUIVideoFiles Illegal characters in path. mscorlib at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
    at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
    at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
    at System.IO.DirectoryInfo..ctor(String path)
    at MediaPortal.GUI.Video.GUIVideoFiles.LoadSettings()
    at MediaPortal.GUI.Video.GUIVideoFiles.Init()
    at MediaPortal.GUI.Library.PluginManager.LoadWindowPlugin(String strFile)

    I was able to reproduce this on two different machines (W7 and XP SP3), both running latest svn build.

    Logs: View attachment 50365
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    can you please try the attached .dll? put it into mediaportal\plugins\windowplugins
     

    Attachments

    • WindowPlugins.zip
      30.6 KB

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    I can confirm that this fixes the problem on my machines...

    :D
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    I worked a bit on it and fixed the problem.
    I just see that mantis has been updated.
    Therefore, I found many other problems related with remote FTP.
    If more information are needed....
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    If there are more bugs in FTP handling then a patch is always welcome. :)
    Well, I'm not sure if it's a bad fix from my side or not.
    I fixed this way :

    In GUIVideoFiles.cs, in LoadSettings() method, in the _history.Set test, I replaced :

    Code:
          if (_currentFolder.Length > 0)
    by
    Code:
          if (_currentFolder.Length > 0 && !_virtualDirectory.DefaultShare.IsFtpShare)
    and, I found other things related to thumbnails and subtitles, for example.

    Then I also modified in Util.cs and VirtualDirectory.cs.

    If morpheus_xx confirm he handled the bug in the same way in GUIVideoFiles.cs, I will post others changes
    otherwise, I suppose it's not necessary.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    in priciple I did the same:
    Code:
    if (_currentFolder.Length > 0 && !_virtualDirectory.IsRemote(_currentFolder))

    which is a bit more generic approach
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    in priciple I did the same:
    Code:
    if (_currentFolder.Length > 0 && !_virtualDirectory.IsRemote(_currentFolder))
    which is a bit more generic approach
    Well, if you want, as already said, many differents ways to fix problems but the most important is fixing them without breaking other things, finally. ;)

    OK, you provided only the WindowPlugins.dll and, with your confirmation code, I'm afraid it's not enough :
    After own tests, I found that the thumbnails process also made exception.

    Then to avoid, I modified Utils.cs (the one in Core\Util folder, not Core\guilib folder nor MpeCore folder) this way in GetVideoThumb(object i) method :

    Code:
          if (path.Contains("VIDEO_TS\\VIDEO_TS.IFO"))
    by

    Code:
          if (path.Contains("VIDEO_TS\\VIDEO_TS.IFO") || path.Contains("remote:"))
    I also modified VirtualDirectory.cs for other problems like a log error "VirtualDirectory: Could not fetch folder contents for..." in the catch (Exception ex) stuff inside HandleLocalFilesInDir(string aDirectory, ref List<GUIListItem> aItemsList, bool aHasRedbookDetails)

    Then, I changed, in GetDirectoryUnProtectedExt(string strDir, bool useExtensions) method :


    Code:
            HandleLocalFilesInDir(strDir, ref items, false);
    by

    Code:
          if (!IsRemote(strDir))
          {
            HandleLocalFilesInDir(strDir, ref items, false);
          }
    Note :
    It's not needed to do the same in the call :

    Code:
             HandleLocalFilesInDir(strDir, ref items, doesContainRedBookData);
    in GetDirectoryExt(string strDir) method because, if (IsRemote(strDir)) test already exist.

    Hope it helps.
    But maybe, there are others problems, I stopped dev when I saw you worked on it. ;)
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    ok, I see your points.

    can you provide a patch file for the issue you've found? because other devs are currently working on the thumbnail parts, so we can review all places :D
     

    Users who are viewing this thread

    Top Bottom