Powered by Invision Power Board

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> feature for leecher with short-term memory loss, reask on download for a known files

xrmb
May 15 2004, 23:31
+Quote Post





Group: Members
Posts: 41
Joined: 21-March 04



It happend to me again, I was downloading the same file again what I downloaded one year ago already... to prevent this I added a Yes/No reask if you try to redownload a file that is already in your knownfiles. And yes that is something new, because at the moment e+ only checks in the shared files, where it makes no sense to reload it because the file still exists. But the knownfiles is more like your darkhistory that you should delete before opening the door smile.gif

here the code, its almost 3x the same code and I hope I found all places where this check makes sense... sorry, but the e+ code is already pretty much f*ck*d up because of all the mods/devs like me wink.gif

And for my dev-friends out there... take a look at the auto_ptr template class, it might save the one or other delete or even catch some missed ones...

it's 3x in DownloadQueue.cpp:

CODE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CDownloadQueue::AddSearchToDownload(CSearchFile *pNewSearchFile, EnumCategories eCatID /*=CAT_NONE*/)
{
EMULE_TRY

if (pNewSearchFile->GetFileSize() == 0)
{
 AddLogLine(true, RGB_LOG_ERROR + GetResString(IDS_SKIPZEROLENGTHFILE), pNewSearchFile->GetFileName());
 return;
}
if (FileExists(pNewSearchFile->GetFileHash()))
 return;

//--- xrmb+:pdd ---
//--- prevent duplicate downloads ---
if(CKnownFile *pKnownFile = g_eMuleApp.m_pKnownFilesList->FindKnownFileByID(pNewSearchFile->GetFileHash()))
{
 CString msg;
 msg.Format("You downloaded '%s' already, download it again?", pKnownFile->GetFileName());
 if(AfxMessageBox(msg, MB_YESNO) != IDYES)
  return;
}
//--- :xrmb+/pdd ---

CPartFile *pNewPartFile = new CPartFile(pNewSearchFile);
...


CODE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CDownloadQueue::AddSearchToDownload(CString strE2DKLink, EnumCategories eCatID /*=CAT_NONE*/)
{
EMULE_TRY

//--- xrmb+:pdd---
//--- prevent duplicate downloads ---
auto_ptr<CED2KLink> pLink(CED2KLink::CreateLinkFromUrl(strE2DKLink));
CED2KFileLink* pFileLink=pLink->GetFileLink();
if(pFileLink==NULL)
 throw GetResString(IDS_ERR_NOTAFILELINK);

CKnownFile* pKnownFile=g_eMuleApp.m_pKnownFilesList->FindKnownFileByID(pFileLink->GetHashKey());
if(pKnownFile)
{
 CString msg;
 msg.Format("You downloaded '%s' already, download it again?", pKnownFile->GetFileName());
 if(AfxMessageBox(msg, MB_YESNO) != IDYES)
  return;
}
//--- :xrmb+/pdd ---

CPartFile * pNewPartFile = new CPartFile(strE2DKLink);

...


CODE

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CDownloadQueue::AddFileLinkToDownload(CED2KFileLink *pLink, EnumCategories eCatID)
{
EMULE_TRY

//--- xrmb+:ppd ---
//--- prevent duplicate downloads ---
CED2KFileLink* pFileLink=pLink->GetFileLink();
if(pFileLink==NULL)
 throw GetResString(IDS_ERR_NOTAFILELINK);

CKnownFile* pKnownFile=g_eMuleApp.m_pKnownFilesList->FindKnownFileByID(pFileLink->GetHashKey());
if(pKnownFile)
{
 CString msg;
 msg.Format("You downloaded '%s' already, download it again?", pKnownFile->GetFileName());
 if(AfxMessageBox(msg, MB_YESNO) != IDYES)
  return;
}
//--- :xrmb+/ppd ---

CPartFile *pNewPartFile = new CPartFile(pLink);

...
User is offlineProfile CardPM
Go to the top of the page
Post #1
Fuxie - DK
May 15 2004, 23:48
+Quote Post





Group: Managers
Posts: 4800
Joined: 21-January 03
From: Copenhagen, Denmark



Sounds nice... biggrin.gif

But I really don't think that I'm the only person that cleans up my known.met file.. tongue.gif

Once you clean up in known.met the information is gone.. unsure.gif

If this is to work, a seperate database for completed files should be created.. cool.gif
User is offlineProfile CardPM
Go to the top of the page
Post #2
xrmb
May 16 2004, 00:57
+Quote Post





Group: Members
Posts: 41
Joined: 21-March 04



Well my known.met ist already 4mb and contains all my downlaods from the last (how many years is emule old?) years. Or in other words 5000 files smile.gif I don't delete it because its a good reference which xxx movie I saw already smile.gif
User is offlineProfile CardPM
Go to the top of the page
Post #3
Fuxie - DK
May 16 2004, 02:25
+Quote Post





Group: Managers
Posts: 4800
Joined: 21-January 03
From: Copenhagen, Denmark



Some people clean up... Other don't laugh.gif
User is offlineProfile CardPM
Go to the top of the page
Post #4

Reply to this topicTopic OptionsStart new topic
 

Lo-Fi Version Time is now: 20th May 2013 - 21:19