mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
push the destination directory into tr_torrentInit*()
This commit is contained in:
parent
7e09d157cd
commit
40ee651158
1 changed files with 8 additions and 6 deletions
|
@ -497,19 +497,23 @@ opentor( const char * path, const char * hash, uint8_t * data, size_t size,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( dir == NULL )
|
||||||
|
dir = gl_dir;
|
||||||
|
|
||||||
if( NULL != path )
|
if( NULL != path )
|
||||||
{
|
{
|
||||||
tor->tor = tr_torrentInit( gl_handle, path, tor->hash,
|
tor->tor = tr_torrentInit( gl_handle, path, dir,
|
||||||
|
tor->hash,
|
||||||
TR_FLAG_SAVE, &errcode );
|
TR_FLAG_SAVE, &errcode );
|
||||||
}
|
}
|
||||||
else if( NULL != hash )
|
else if( NULL != hash )
|
||||||
{
|
{
|
||||||
tor->tor = tr_torrentInitSaved( gl_handle, hash, 0, &errcode );
|
tor->tor = tr_torrentInitSaved( gl_handle, hash, dir, 0, &errcode );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tor->tor = tr_torrentInitData( gl_handle, data, size, tor->hash,
|
tor->tor = tr_torrentInitData( gl_handle, data, size, dir,
|
||||||
TR_FLAG_SAVE, &errcode );
|
tor->hash, TR_FLAG_SAVE, &errcode );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( NULL == tor->tor )
|
if( NULL == tor->tor )
|
||||||
|
@ -567,8 +571,6 @@ opentor( const char * path, const char * hash, uint8_t * data, size_t size,
|
||||||
inf = tr_torrentInfo( tor->tor );
|
inf = tr_torrentInfo( tor->tor );
|
||||||
memcpy( tor->hash, inf->hash, sizeof tor->hash );
|
memcpy( tor->hash, inf->hash, sizeof tor->hash );
|
||||||
|
|
||||||
tr_torrentSetFolder( tor->tor, ( NULL == dir ? gl_dir : dir ) );
|
|
||||||
|
|
||||||
if( TR_FLAG_PRIVATE & inf->flags )
|
if( TR_FLAG_PRIVATE & inf->flags )
|
||||||
{
|
{
|
||||||
tor->pexset = 1;
|
tor->pexset = 1;
|
||||||
|
|
Loading…
Reference in a new issue