mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
cleanup last commit(s)
This commit is contained in:
parent
c36a007cd4
commit
0b7007088b
1 changed files with 16 additions and 16 deletions
|
@ -1592,7 +1592,6 @@ int trashDataFile(const char * filename)
|
||||||
|
|
||||||
@implementation Torrent (Private)
|
@implementation Torrent (Private)
|
||||||
|
|
||||||
//if a hash is given, attempt to load that; otherwise, attempt to open file at path
|
|
||||||
- (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
|
- (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
|
||||||
publicTorrent: (NSNumber *) publicTorrent
|
publicTorrent: (NSNumber *) publicTorrent
|
||||||
downloadFolder: (NSString *) downloadFolder
|
downloadFolder: (NSString *) downloadFolder
|
||||||
|
@ -1636,29 +1635,30 @@ int trashDataFile(const char * filename)
|
||||||
tr_ctorSetPaused(ctor, TR_FORCE, YES);
|
tr_ctorSetPaused(ctor, TR_FORCE, YES);
|
||||||
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
|
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
|
||||||
|
|
||||||
tr_info info;
|
|
||||||
int result = TR_EINVALID;
|
int result = TR_EINVALID;
|
||||||
if (path)
|
if (path)
|
||||||
{
|
result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
|
||||||
tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
|
|
||||||
result = tr_torrentParse(ctor, &info);
|
//backup - shouldn't be needed after upgrade to 1.62
|
||||||
}
|
if (result != TR_OK && hashString)
|
||||||
if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
|
|
||||||
{
|
|
||||||
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
|
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
|
||||||
result = tr_torrentParse(ctor, &info);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == TR_OK)
|
if (result == TR_OK)
|
||||||
{
|
{
|
||||||
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
|
tr_info info;
|
||||||
? fIncompleteFolder : fDownloadFolder;
|
result = tr_torrentParse(ctor, &info);
|
||||||
tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
|
|
||||||
|
|
||||||
fHandle = tr_torrentNew(ctor, NULL);
|
if (result == TR_OK)
|
||||||
|
{
|
||||||
|
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
|
||||||
|
? fIncompleteFolder : fDownloadFolder;
|
||||||
|
tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
|
||||||
|
|
||||||
|
fHandle = tr_torrentNew(ctor, NULL);
|
||||||
|
}
|
||||||
|
if (result != TR_EINVALID)
|
||||||
|
tr_metainfoFree(&info);
|
||||||
}
|
}
|
||||||
if (result != TR_EINVALID)
|
|
||||||
tr_metainfoFree(&info);
|
|
||||||
|
|
||||||
tr_ctorFree(ctor);
|
tr_ctorFree(ctor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue