Buenas...
Como en
bugs.amule.org he visto que nadie está trabajando en esto (ya he visto que hay otros bugs más críticos que este), he estado investigando este problema, que a mi también me interesa que funcione, y creo que he dado con la solución. He modificado la función CDownloadQueue::StartNextFile en el fichero DownloadQueue.cpp y por lo que llevo probado de momento parece que funciona.
Para el que quiera probarlo, dejo aquí la función completa que habría que sustituir en DownloadQueue.cpp, y si a alguno de los desarrolladores le parece que esto arregla el problema, que lo incluya en el código tranquilamente.
void CDownloadQueue::StartNextFile(CPartFile* oldfile)
{
if ( thePrefs::StartNextFile() ) {
m_mutex.Lock();
CPartFile* tFile = NULL;
if ( ! thePrefs::StartNextFileSame() ) {
// do not use categories
for ( uint16 i = 0; i < m_filelist.size(); i++ ) {
CPartFile* file = m_filelist[i];
if ( file->GetStatus() == PS_PAUSED ) {
if (!tFile) {
// select first file
tFile = file;
} else {
// tfile already selected, compare priorities
if (file->GetDownPriority() > tFile->GetDownPriority()) {
// select new file
tFile = file;
}
}
// if has high priority then we are done
if (tFile->GetDownPriority() == PR_HIGH) {
break;
}
}
}
} else {
// use categories
for ( uint16 i = 0; i < m_filelist.size(); i++ ) {
CPartFile* file = m_filelist[i];
if ( file->GetStatus() == PS_PAUSED ) {
if (!tFile) {
// select first file
tFile = file;
} else {
// file already selected
if (tFile->GetCategory() == oldfile->GetCategory()) {
// already found a file for this category
if (file->GetCategory() == oldfile->GetCategory()) {
// new file is also for this category, check priorities
if (file->GetDownPriority() > tFile->GetDownPriority()) {
// higher priority, select new file
tFile = file;
}
}
} else {
// no file selected for the category
if ((file->GetCategory() == oldfile->GetCategory()) || (file->GetDownPriority() > tFile->GetDownPriority())) {
// new file is for the category or has higher priority, so select it
tFile = file;
}
}
}
// if has high priority and is for the category then we are done
if ((tFile->GetDownPriority() == PR_HIGH) && (file->GetCategory() == oldfile->GetCategory())) {
break;
}
}
}
}
m_mutex.Unlock();
if ( tFile ) {
tFile->ResumeFile();
}
}
}
Ahora solo faltaría poder tener más flexibilidad con las prioridades en una categoría, en lugar de tener sólo prioridad baja, normal y alta, para poder ordenar los ficheros de una categoría según el orden en que queremos que se vayan activando a medida que se van completando otros de la misma categoría.
Hasta luego.