Ticket #4537: no-data-found-override.patch

File no-data-found-override.patch, 1.9 KB (added by cfpp2p, 9 years ago)
  • torrent.c

     
    775775    if( disappeared )
    776776    {
    777777        tr_deeplog_tor( tor, "%s", "[LAZY] uh oh, the files disappeared" );
    778         tr_torrentSetLocalError( tor, "%s", _( "No data found! Ensure your drives are connected or use \"Set Location\". To re-download, remove the torrent and re-add it." ) );
     778        tr_torrentSetLocalError( tor, "%s", _( "No data found! Ensure drives connected or use \"Set Location\". To re-download, remove/re-add torrent OR re-verify" ) );
    779779    }
    780780
    781781    return disappeared;
    782782}
    783783
     784static bool
     785localErrFilesDisappearedUE( tr_torrent * tor )
     786{
     787    const bool disappeared = ( tr_cpHaveTotal( &tor->completion ) > 0 ) && !hasAnyLocalData( tor );
     788
     789    if( disappeared )
     790    {
     791        tr_deeplog_tor( tor, "%s", "[LAZY] uh oh WARNING, the files disappeared" );
     792        tr_torrentSetLocalError( tor, "%s", _( "WARNING! possible user error! files MAYBE disappeared!!! to IGNORE: after verify use Start/Resume Now" ) );
     793    }
     794
     795    return disappeared;
     796}
     797
    784798static void
    785799torrentInit( tr_torrent * tor, const tr_ctor * ctor )
    786800{
     
    16501664    }
    16511665
    16521666    /* don't allow the torrent to be started if the files disappeared */
    1653     if( setLocalErrorIfFilesDisappeared( tor ) )
     1667    /* IGNORE the error and start if Start/Resume Now issued */
     1668    if( !bypass_queue && localErrFilesDisappearedUE( tor ) )
    16541669        return;
    16551670
    16561671    /* otherwise, start it now... */
     
    17291744        tor->startAfterVerify = startAfter;
    17301745    }
    17311746
    1732     if( setLocalErrorIfFilesDisappeared( tor ) )
     1747    if( localErrFilesDisappearedUE( tor ) )
    17331748        tor->startAfterVerify = false;
    1734     else
    1735         tr_verifyAdd( tor, torrentRecheckDoneCB );
    17361749
     1750    tr_verifyAdd( tor, torrentRecheckDoneCB );
     1751
    17371752    tr_sessionUnlock( tor->session );
    17381753}
    17391754