Page tree


Search

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.23 
            Releasenews | Download
 MediaPortal 2.2.2
            Releasenews | Download

Purpose

  • Required:  If plugins use Recorded TV thumbnails
  • Type of Change:  Feature

Beginning with MP version 1.4 the Recorded TV thumbnails are created on the server. They are stored in the TV Server's ProgramData path (usually C:\ProgramData\Team MediaPortal\MediaPortal TV Server\thumbs). MP client plugins can load the Recorded TV thumbnails from the TV Server by remoting.

The Recorded TV thumbs folder on the client (C:\ProgramData\Team MediaPortal\MediaPortal\thumbs\tv\recorded) is used as a cache now and is cleared on every start of the MP TV plugin. It cannot be relied on to be up to date and to contain all Recorded TV thumbnails.

Settings for Recorded TV thumbnails are now made in the TV Server Configuration. The MediaPortal Configuration thumbnail settings refer to video thumbnails only. To reflect these changes the thumbnail setting tags in MediaPortal.xml have been renamed from "tvrecorded..." to "video...".      

Description of Change

Loading Recorded TV Thumbs by Remoting

Plugins can load Recorded TV thumbnails from the TV server by callling the GetRecordingThumbnail() remoting method.

using TvControl;
...

byte[] thumbData = RemoteControl.Instance.GetRecordingThumbnail(thumbnailFilename);

Checking the Local Recorded TV Thumbs folder

Plugins cannot rely on a Recorded TV thumbnail being stored in the client's Recorded TV thumbs folder (C:\ProgramData\Team MediaPortal\MediaPortal\thumbs\tv\recorded). Therefore they should check its existence by calling the FileExistsInCache() method.

using MediaPortal.Util;
...

if (Utils.FileExistsInCache(thumbnailFilename))
{
  ...

Renamed Thumbnail Tags in MediaPortal.xml

The thumbnail setting tags in the thumbnails section of MediaPortal.xml have been renamed:

tvrecordedsharepreview ⇒ videosharepreview

tvrecordedondemand ⇒ videoondemand

tvthumbcols ⇒ videothumbcols

tvthumbrows ⇒ videothumbrows    

Additional Information and References

Mantis Issue:

4060: Enable thumbnail generation for TV recordings on multiseat network clients

Related xml(s):

 

Windows IDs:

 

Related GUI control:

 

Author:

michael_t

Date added:

Tue, 09 Apr 2013

Code Sample

This code sample checks for the existence of a Recorded TV thumbnail and loads it from the TV Server if it is not available locally.

using MediaPortal.GUI.Library;
using MediaPortal.Util;
...

string thumbnailFilename = "My Favorite Recording.jpg"
string previewThumb = Thumbs.TVRecorded + "\\" + thumbnailFilename;

if (!Utils.FileExistsInCache(PreviewThumb))
{
  Log.Debug("Thumbnail {0} does not exist in local thumbs folder - get it from TV server", thumbnailFilename);
  try
  {
    byte[] thumbData = RemoteControl.Instance.GetRecordingThumbnail(thumbnailFilename);

    if (thumbData.Length > 0)
    {
      using (FileStream fs = new FileStream(PreviewThumb, FileMode.Create))
      {
        fs.Write(thumbData, 0, thumbData.Length);
        fs.Close();
        fs.Dispose();
      }
      Utils.DoInsertExistingFileIntoCache(PreviewThumb);
    }
    else
    {
      Log.Debug("Thumbnail {0} not found on TV server", thumbnailFilename);
    }
  }
  catch (Exception ex)
  {
    Log.Error("Error fetching thumbnail {0} from TV server - {1}", thumbnailFilename, ex.Message);
  }
}

if (Utils.FileExistsInCache(PreviewThumb))
  GUIPropertyManager.SetProperty("#mypluginthumb", PreviewThumb);
else
  GUIPropertyManager.SetProperty("#mypluginthumb", String.Empty);

   

 

This page has no comments.