Page 1 of 6

[Plugin] Pieces Plugin

Posted: Sat Jan 09, 2010 4:10 am
by nick
I've written a plugin to show the status of each piece of a torrent. You can find it here: http://dev.deluge-torrent.org/wiki/Plugins/Pieces

This works in both client/server and Classic mode. Webui is also supported, although you cannot see or set individual piece priorities.

(Jan 18 2011) Version 0.5 Released
  • Support client/server mode (i.e. not "Classic" mode)
  • Webui support (only displays piece status, no priority info/setting)
  • Some minor bug fixes


    Questions/Comments welcome. Hope you enjoy!

    Main Tab:
    Main Pieces Tab
    Main Pieces Tab
    pss.png (69.42 KiB) Viewed 43877 times
    Prefs Window:
    Prefs Window
    Prefs Window
    pprefs.png (35.95 KiB) Viewed 43876 times
    Tooltip:
    Tooltip Screenshot
    Tooltip Screenshot
    tooltip.png (4.59 KiB) Viewed 43687 times

    --- Old News---
    (Jan 5 2011) Version 0.4 Released
    • Fix a nasty segfault bug from 0.3
    • Easy select of multiple pieces using Shift/Ctrl
    • Big speed improvement for torrents with lots of pieces
    • Ability to always set first un-downloaded piece priority to high to enable watching of movies before they are completely downloaded.
(1/15/2010) Version 0.2 Released:
- Finished/Seeding torrents now display correctly
- Tooltip to show which piece you are hovering over
- Ability to set priorities for individual pieces (via right click menu)

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Sun Jan 10, 2010 2:12 am
by loki
I like it, it works, I'm not sure about your specific colors but if it works for you...
One thing though, once a file finishes downloading the pieces disappear, not that it's particularly needed anymore but is this expected behavior?

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Sun Jan 10, 2010 9:24 pm
by nick
Thanks, but leave my color choices alone :)

The reason the pieces disappear is that libtorrent returns an empty list of pieces for torrents that are seeding and/or completed. What I'll probably do is check when the list is empty if the torrent is complete and just draw all the pieces as downloaded, but for now it sees the empty list and just doesn't draw anything.

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Mon Jan 11, 2010 7:28 pm
by yunihiko
I'm trying to use this plugin, but when clicking on the Pieces tab get these errors in the console

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/deluge/ui/gtkui/torrentdetails.py", line 383, in _on_switch_page
    self.update(page_num)
  File "/usr/lib/pymodules/python2.6/deluge/ui/gtkui/torrentdetails.py", line 367, in update
    self.tabs[name].update()
  File "/home/as/.config/deluge/plugins/Pieces-0.1-py2.6.egg/pieces/gtkui.py", line 191, in update
  File "/usr/lib/pymodules/python2.6/deluge/component.py", line 245, in get
    return _ComponentRegistry.get(component)
  File "/usr/lib/pymodules/python2.6/deluge/component.py", line 113, in get
    return self.components[name]
KeyError: 'TorrentManager'
and nothing else. What up? Deluge 1.2.0, python-libtorrent 0.14.6-1 from ubuntu repos.

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Fri Jan 15, 2010 11:11 pm
by nick
yunihiko wrote:I'm trying to use this plugin, but when clicking on the Pieces tab get these errors in the console

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/deluge/ui/gtkui/torrentdetails.py", line 383, in _on_switch_page
    self.update(page_num)
  File "/usr/lib/pymodules/python2.6/deluge/ui/gtkui/torrentdetails.py", line 367, in update
    self.tabs[name].update()
  File "/home/as/.config/deluge/plugins/Pieces-0.1-py2.6.egg/pieces/gtkui.py", line 191, in update
  File "/usr/lib/pymodules/python2.6/deluge/component.py", line 245, in get
    return _ComponentRegistry.get(component)
  File "/usr/lib/pymodules/python2.6/deluge/component.py", line 113, in get
    return self.components[name]
KeyError: 'TorrentManager'
and nothing else. What up? Deluge 1.2.0, python-libtorrent 0.14.6-1 from ubuntu repos.
This is odd. It means the core isn't able to find the TorrentManager component which is a central part of the system. I haven't been able to reproduce this, but I'm working on it and will update when I figure it out.

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Tue Jan 19, 2010 7:33 pm
by yunihiko
nick wrote:I haven't been able to reproduce this
The plugin works in the classic mode, but does not work when using deluge in the daemon mode with a separate gtk-ui.

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Wed Jan 20, 2010 5:51 am
by ariafan
I want to make a russian translation of your plugin. How?

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Wed Jan 20, 2010 7:54 pm
by nick
yunihiko wrote:
nick wrote:I haven't been able to reproduce this
The plugin works in the classic mode, but does not work when using deluge in the daemon mode with a separate gtk-ui.

Ahh ha, that makes a lot of sense. I'll investigate getting that fixed when I have some time. Thanks for the report!

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Wed Jan 20, 2010 8:58 pm
by nick
ariafan wrote:I want to make a russian translation of your plugin. How?
Well, right now you could get the source from github and just translate all the strings and make a new .egg, but that's a pretty gross way to do it. What I should do is take strings directly out of the code and use .po files, which I'll look at getting done.

Re: Pieces Plugin for 1.2 (gtkui)

Posted: Wed Jan 27, 2010 6:38 pm
by elcamilo
very nice plugin, nick!

regards.