Recorded shows dialog, help needed :) (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    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.
    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 :)
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #2
    Nobody seems to care, thats the pitfall when trying to develop to poorly documented code :( So much for Open Source, might as well be closed source when the documentation is non-existant, and the developers doesn't care to comment.
     

    Users who are viewing this thread

    Top Bottom