Ticket #4536: notyetavail.diff

File notyetavail.diff, 3.0 KB (added by Mark Buechler <Mark.Buechler@…>, 16 years ago)

The patch

  • libs/libmythtv/programinfo.h

    diff -rup mythtv.old/libs/libmythtv/programinfo.h mythtv/libs/libmythtv/programinfo.h
    old new enum AvailableStatusType { 
    114114    asPendingDelete,
    115115    asFileNotFound,
    116116    asZeroByte,
    117     asDeleted
     117    asDeleted,
     118    asNotYetAvailable
    118119};
    119120
    120121enum WatchListStatus {
  • programs/mythfrontend/playbackbox.cpp

    diff -rup mythtv.old/programs/mythfrontend/playbackbox.cpp mythtv/programs/mythfrontend/playbackbox.cpp
    old new void PlaybackBox::showActionsSelected() 
    26482648bool PlaybackBox::play(ProgramInfo *rec, bool inPlaylist)
    26492649{
    26502650    bool playCompleted = false;
     2651    ProgramInfo *tmpItem = NULL;
    26512652
    26522653    if (!rec)
    26532654        return false;
    bool PlaybackBox::play(ProgramInfo *rec, 
    26572658
    26582659    rec->pathname = rec->GetPlaybackURL(true);
    26592660
     2661    if (rec->availableStatus == asNotYetAvailable)
     2662    {
     2663        tmpItem = findMatchingProg(rec);
     2664        if (tmpItem)
     2665            tmpItem->availableStatus = asAvailable;
     2666    }
     2667
    26602668    if (fileExists(rec) == false)
    26612669    {
    26622670        QString msg =
    bool PlaybackBox::play(ProgramInfo *rec, 
    26642672            .arg(rec->pathname);
    26652673        VERBOSE(VB_IMPORTANT, msg);
    26662674
    2667         ProgramInfo *tmpItem = findMatchingProg(rec);
     2675        if (!tmpItem)
     2676            tmpItem = findMatchingProg(rec);
     2677
    26682678        if (tmpItem)
    26692679        {
    2670             tmpItem->availableStatus = asFileNotFound;
     2680            if (tmpItem->recstatus == rsRecording)
     2681                tmpItem->availableStatus = asNotYetAvailable;
     2682            else
     2683                tmpItem->availableStatus = asFileNotFound;
     2684
    26712685            showAvailablePopup(tmpItem);
    26722686        }
    26732687
    bool PlaybackBox::play(ProgramInfo *rec, 
    26802694            QString("PlaybackBox::play(): Error, %1 is zero-bytes in size")
    26812695            .arg(rec->pathname));
    26822696
    2683         ProgramInfo *tmpItem = findMatchingProg(rec);
     2697        if (!tmpItem)
     2698            tmpItem = findMatchingProg(rec);
     2699
    26842700        if (tmpItem)
    26852701        {
    2686             tmpItem->availableStatus = asZeroByte;
     2702            if (tmpItem->recstatus == rsRecording)
     2703                tmpItem->availableStatus = asNotYetAvailable;
     2704            else
     2705                tmpItem->availableStatus = asZeroByte;
     2706
    26872707            showAvailablePopup(tmpItem);
    26882708        }
    26892709
    void PlaybackBox::showAvailablePopup(Pro 
    29032923                               QObject::tr("The file for this recording is "
    29042924                                           "empty."));
    29052925                 break;
     2926        case asNotYetAvailable:
     2927                 MythPopupBox::showOkPopup(gContext->GetMainWindow(),
     2928                               QObject::tr("Recording Unavailable"), msg +
     2929                               QObject::tr("This recording is not yet "
     2930                                           "available."));
    29062931    }
    29072932}
    29082933