Opened 7 years ago

Closed 7 years ago

#4757 closed Bug (invalid)

"trash-original-torrent-files" doesn't work in daemon mode

Reported by: pukakk Owned by:
Priority: Normal Milestone: None Set
Component: Daemon Version: 2.42
Severity: Normal Keywords: trash-original-torrent-files, regression daemon
Cc:

Description

"trash-original-torrent-files" option doesn't work in daemon-mode.

I have found that this problem is caused by not using TR_PREFS_KEY_TRASH_ORIGINAL key in daemon.c

static void
onFileAdded( tr_session * session, const char * dir, const char * file )
{
    char * filename = tr_buildPath( dir, file, NULL );
    tr_ctor * ctor = tr_ctorNew( session );
    int err = tr_ctorSetMetainfoFromFile( ctor, filename );

    if( !err )
    {
        tr_torrentNew( ctor, &err );

        if( err == TR_PARSE_ERR )
            tr_err( "Error parsing .torrent file \"%s\"", file );
        else
        {
            bool trash = false;
            int test = tr_ctorGetDeleteSource( ctor, &trash );

            tr_inf( "Parsing .torrent file successful \"%s\"", file );

            if( !test && trash )
            {
                tr_inf( "Deleting input .torrent file \"%s\"", file );
                if( remove( filename ) )
                    tr_err( "Error deleting .torrent file: %s", tr_strerror( errno ) );
            }
            else
            {
                char * new_filename = tr_strdup_printf( "%s.added", filename );
                rename( filename, new_filename );
                tr_free( new_filename );
            }
        }
    }

    tr_ctorFree( ctor );
    tr_free( filename );
}

daemon.c has set just "bool trash = false", instead of using TR_PREFS_KEY_TRASH_ORIGINAL key from settings.json

Change History (7)

comment:1 follow-up: Changed 7 years ago by gunzip

  • Keywords regression added

i can confirm this regression using recent nightly build transmission-daemon 2.42+ (13204)

comment:2 Changed 7 years ago by cfpp2p

??? I don't know ??? no problems for me.

WORKING for me 2.42+ (13203) * $Id: daemon.c 12476 2011-05-30 15:28:55Z jordan $

the only change since has been the recent * $Id: daemon.c 13195 2012-02-03 21:21:52Z jordan $

but I don't see any way that that r13195 changeset could be causing this for you if that's what your using...

comment:3 in reply to: ↑ 1 Changed 7 years ago by gunzip

Replying to myself:

i can confirm this regression using recent nightly build transmission-daemon 2.42+ (13204)

well i have to retract that. it seems "trash-original-torrent-files" only applies to torrents added in the watch directory, not torrents added in general.

perhaps this is invalid bug?

comment:4 Changed 7 years ago by x190

trash-original-torrent-files: Boolean (default = false) Delete torrents added from the watch directory.

I think the confusion may be with the Mac Client which does not limit this action to the watch directory.

https://forum.transmissionbt.com/download/file.php
I guess daemon users are expected to RTFM? :-)

Last edited 7 years ago by x190 (previous) (diff)

comment:5 Changed 7 years ago by jordan

similar ticket: #4036

comment:6 Changed 7 years ago by x190

This issue has been resolved in the forum so this ticket may now be set to "invalid".

comment:7 Changed 7 years ago by livings124

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.