- Moderator
- #1
Hi there
I'm doing a plugin to show the recorded TV-shows in a popup to allow a fast way of playing back all your recorded TV. Now, the code below should in theory work (as far as I can tell), but the array containing recorded tv doesn't have any elements in it, despite the fact that I have recorded several shows, and these come up by navigating the old fahion way.
The plugin compiles and I can pop the dialog, but there's nothing in the array, when calling TVDatabase.GetRecordedTV(ref recordings);, hence it is returning 0 (when I count the array).
This code is used in a couple of other places in MediaPortal, and I have included
Help appreciated
I'm doing a plugin to show the recorded TV-shows in a popup to allow a fast way of playing back all your recorded TV. Now, the code below should in theory work (as far as I can tell), but the array containing recorded tv doesn't have any elements in it, despite the fact that I have recorded several shows, and these come up by navigating the old fahion way.
Code:
// Shows recorded TV in a dialog
private void oneClickPlayRecordings()
{
List<TVRecorded> recordings = new List<TVRecorded>();
TVDatabase.GetRecordedTV(ref recordings);
List<GUIListItem> itemlist = new List<GUIListItem>();
int GetID = (int)GUIWindow.Window.WINDOW_TVFULLSCREEN;
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading("PowerPlay :)");
dlg.Add(recordings.Count.ToString());
foreach (TVRecorded rec in recordings)
{
GUIListItem item = new GUIListItem();
item.Label = rec.Title;
item.TVTag = rec;
itemlist.Add(item);
dlg.Add(item);
dlg.AddLocalizedString(655);
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
}
The plugin compiles and I can pop the dialog, but there's nothing in the array, when calling TVDatabase.GetRecordedTV(ref recordings);, hence it is returning 0 (when I count the array).
This code is used in a couple of other places in MediaPortal, and I have included
Code:
using MediaPortal.TV.Database;
using MediaPortal.TV.Recording;
Help appreciated