[fixed] Video thumbnails are not being generated in RC5 (1 Viewer)

Migue

Retired Team Member
  • Premium Supporter
  • January 27, 2006
    381
    305
    Florida
    I suspect this is because of 0002945: Thumbnail creation can generate an exception - MediaPortal Bugtracker

    Looking at the fix I see:
    Code:
    bool isLocal = false;
              if (!String.IsNullOrEmpty(item.Path) && Uri.IsWellFormedUriString(item.Path, UriKind.RelativeOrAbsolute))
              {
                Uri file = new Uri(item.Path);
                if (file.IsUnc || file.IsFile)
                {
                  isLocal = true;
                }
              }
    specifically Uri.IsWellFormedUriString and reading the documentation for it Uri.IsWellFormedUriString Method (System)
    it says:
    The string is considered poorly formed, causing the method to return false, if any of the following conditions occur

    Error
    The string is an absolute Uri that represents an implicit file Uri.
    Example
    c:\\directory\filename
    and item.Path has a value like the example, meaning that it will always return false, therefore thumbnails will not be auto-generated.
     

    kkendall

    Portal Pro
    April 24, 2007
    864
    16
    44
    Gouda
    Home Country
    Netherlands Netherlands
    Same here!
    In RC4 there were wrong thumbs (thumbs of older recordings were displayed with newer recordings), in RC5 there are no thumbnails for the recordings at all...
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Maybe the condition should be changed to use: Path.IsPathRooted-Methode (System.IO) instead of Uri.IsWellFormedUriString Method (System)

    In the end, the thumbnail extract shall only run on files (local or on a network share) correct?

    So, if the item.Path is not null or empty, it must be a non relative path.

    One more thing: the directly following if statement should check the isLocal bool first, makes it faster and safer.


    Can one of you give an example of a video file name (full path to it as MePo sees it) that doesn't get a thumb anymore? I thought that an absolute filepath is also a valid uri?
     

    Migue

    Retired Team Member
  • Premium Supporter
  • January 27, 2006
    381
    305
    Florida
    I was thinking of suggesting Path.GetDirectoryName but Path.IsPathRooted sounds better; I think it also causes less overhead.
     

    Dadeo

    Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Home Country
    Canada Canada
    Can one of you give an example of a video file name (full path to it as MePo sees it) that doesn't get a thumb anymore? I thought that an absolute filepath is also a valid uri?
    Hi offbyone:

    All my video thumbs are, and have always been, stored in thumbs\videos folder, which in my Win7 64 bit with MP 1.1.0 is:
    • C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Videos\1968041737.jpg
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Hi, I meant the path to the video file that doesn't get a thumb created ;)
     

    Dadeo

    Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Home Country
    Canada Canada
    Ahhh sorry, that is the path to the thumbs that don't display - they were generated in previous MP versions. You are correct, the issue states thumbs not generated, but I can confirm that even generated thumbs do not display.
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    50
    Milano, Italy
    Home Country
    Italy Italy
    Ahhh sorry, that is the path to the thumbs that don't display - they were generated in previous MP versions. You are correct, the issue states thumbs not generated, but I can confirm that even generated thumbs do not display.

    The code we are speaking is after

    Code:
    if (!foundVideoThumb)
            {

    so this is executed only if a thumb is not found. Seems we may have 2 different issues.

    Simone
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    50
    Milano, Italy
    Home Country
    Italy Italy
    One more thing: the directly following if statement should check the isLocal bool first, makes it faster and safer.

    If i look at svn code I see:

    Code:
    bool isLocal = false;
              if (!String.IsNullOrEmpty(item.Path) && Uri.IsWellFormedUriString(item.Path, UriKind.RelativeOrAbsolute))
              {
                Uri file = new Uri(item.Path);
                if (file.IsUnc || file.IsFile)
                {
                  isLocal = true;
                }
              }
              if (isLocal && IsVideo(item.Path) && !VirtualDirectory.IsImageFile(Path.GetExtension(item.Path).ToLower()))
              {

    so this is already the first check :p

    Simone
     

    Users who are viewing this thread

    Top Bottom