1. Erik Svensson
  2. transmissionrpc
  3. Issues
Issue #43 resolved

add_torrent Doesn't Return id

pettazz
created an issue

After upgrading from 0.8 to 0.9, add_torrent (and the deprecated add_uri) no longer return objects containing the id of the newly added torrent. In fact, there is no reliably uniquely identifying information returned at all. This is a problem if I want to do something like store an id or reference to the download in a database for some later use.

Comments (4)

  1. pettazz reporter

    I just found the hashString property, which is only mentioned in the examples on the front page of the documentation. This solves my problems, though it would be helpful to add that property to the Torrent object docs.

  2. Erik Svensson repo owner

    The Torrent object have two identifiers, id and hashString, as per the Transmission rpc-spec.txt the resulting object from "torrent-add" has following properties, id, name, and hashString. The documentation doesn't describe all fields since these can be found in the documentation for Transsmissions RPC specification.

    >>> c = transmissionrpc.Client()
    >>> t = c.add_torrent('http://releases.ubuntu.com/12.04/ubuntu-12.04.2-alternate-amd64.iso.torrent')
    >>> t
    <Torrent 834 "ubuntu-12.04.2-alternate-amd64.iso">
    >>> t.id
    834
    >>> t.hashString
    u'a21c45469c565f3fb9595e4e9707e6e9d45abca6'
    >>> t.name
    u'ubuntu-12.04.2-alternate-amd64.iso'
    >>> t._fields
    {u'hashString': Field(value=u'a21c45469c565f3fb9595e4e9707e6e9d45abca6', dirty=False), u'id': Field(value=834, dirty=False), u'name': Field(value=u'ubuntu-12.04.2-alternate-amd64.iso', dirty=False)}
    >>>
    
  3. Log in to comment