only create temporary torrent if import failed
This commit is contained in:
parent
cd0b6875da
commit
d5ca0624a4
|
@ -509,6 +509,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
{
|
||||
NSString * torrentPath;
|
||||
Torrent * torrent;
|
||||
|
||||
//determine next file that can be opened
|
||||
do
|
||||
{
|
||||
if ([files count] == 0) //recursive base case
|
||||
|
@ -1569,14 +1571,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
{
|
||||
if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
|
||||
{
|
||||
int error;
|
||||
tr_torrent_t * tempTor = tr_torrentInit(fLib, [[path stringByAppendingPathComponent: file] UTF8String],
|
||||
0, & error);
|
||||
|
||||
if (tempTor)
|
||||
{
|
||||
tr_torrentClose(fLib, tempTor);
|
||||
|
||||
int count = [fTorrents count];
|
||||
[self openFiles: [NSArray arrayWithObject: [path stringByAppendingPathComponent: file]]];
|
||||
|
||||
|
@ -1587,12 +1581,21 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
"Growl notification title") description: file
|
||||
notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//create a temporary torrent to check if it didn't import because of error
|
||||
int error;
|
||||
tr_torrent_t * tempTor = tr_torrentInit(fLib, [[path stringByAppendingPathComponent: file] UTF8String],
|
||||
0, & error);
|
||||
|
||||
if (tempTor)
|
||||
tr_torrentClose(fLib, tempTor);
|
||||
else if (error != TR_EUNSUPPORTED && error != TR_EDUPLICATE)
|
||||
[fAutoImportedNames removeObjectIdenticalTo: file]; //failed to import for unknown reason, so try again later
|
||||
[fAutoImportedNames removeObjectIdenticalTo: file]; //can try to import later
|
||||
else;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[newNames release];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue