nicklan / deluge-pieces-plugin Goto Github PK
View Code? Open in Web Editor NEWA plugin to show the status of each piece of a torrent in deluge
A plugin to show the status of each piece of a torrent in deluge
That's confusing. No, really.
If the row width is not a perfect multiple of 'cell size', you end up with partial squares on the end of rows.
I'm working on a PR to fix this.
If you right click a square, this selects the square before showing the context menu. That's fine. If though you then (with that square still selected) click to dismiss the context menu, then right click on a different square, then this additional square is also selected. This behaviour is odd/unexpected.
The behaviour that I would expect is that (prior to showing the context menu):
This would be more in line with selection behaviour in things like my file manager for instance.
I'll see about making a fix.
Symptoms:
Hello! I don't know Python well, so I don't know if it's serious task or trivial. Could you make plugin translatable? I'd provide a few translations if it would be possible.
I am working on improving the priority_thread.py code, so that when selecting "Select priority of first un-downloaded piece to High" 2,5% of the first un-downloaded pieces are set to Highest, 2,5% of the next un-downloaded pieces are set to Higher and 2,5% of the next un-downloaded pieces after that is set to High.
That way any torrent will stream very efficiently. Because just setting High priority on 1 single piece doesn't work well, as is the default in the current code.
But I am unable to change the priority of an amount of pieces relative to the total amount of pieces in the torrent. So currently I have a set amount of pieces that is changed.
Which doesn't work so well when the torrent either have very few or very many of pieces.
Here is what I have done so far.
I have changed this:
__target_priority = 5
(...)
# lf is now the first un-downloaded, desired piece of this torrent
if (tor.handle.piece_priority(lf) < __target_priority):
tor.handle.piece_priority(lf,__target_priority)
__last_first[t] = lf
into this:
__target_priority = 7
__target_priority2 = 5
__target_priority3 = 2
(...)
# lf is now the first un-downloaded, desired piece of this torrent
if (tor.handle.piece_priority(lf) < __target_priority):
for e in range(0, 25):
tor.handle.piece_priority(lf+e,__target_priority)
for e2 in range(25, 51):
tor.handle.piece_priority(lf+e2,__target_priority2)
for e3 in range(51, 77):
tor.handle.piece_priority(lf+e3,__target_priority3)
__last_first[t] = lf
What is the variable for the total amount of pieces, so that I can dynamically calculate the ranges of the for loops?
Hi, I'm using deluged in an environment where gtk is not installed and no python dependency for gtk is present, and when I try to load the plugin in deluged, I get the following error in the logs:
deluge-deluged-1 | 17:34:51 [ERROR ][deluge.pluginmanagerbase :154 ] Unable to instantiate plugin 'Pieces' from '/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg'!
deluge-deluged-1 | 17:34:51 [ERROR ][deluge.pluginmanagerbase :1343] Namespace Gtk not available
deluge-deluged-1 | Traceback (most recent call last):
deluge-deluged-1 | File "/usr/lib/python3/dist-packages/deluge/pluginmanagerbase.py", line 148, in enable_plugin
deluge-deluged-1 | instance = cls(plugin_name.replace('-', '_'))
deluge-deluged-1 | File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/__init__.py", line 46, in __init__
deluge-deluged-1 | from .core import Core as _plugin_cls
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1 | File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/core.py", line 49, in <module>
deluge-deluged-1 | from .colors import Colors
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1 | File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/colors.py", line 40, in <module>
deluge-deluged-1 | from .color import Color
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 971, in _find_and_load
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
deluge-deluged-1 | File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
deluge-deluged-1 | File "/home/deluge/.config/deluge/plugins/Pieces-0.6-py3.6.egg/pieces/color.py", line 42, in <module>
deluge-deluged-1 | gi.require_version("Gtk", "3.0")
deluge-deluged-1 | File "/usr/lib/python3/dist-packages/gi/__init__.py", line 130, in require_version
deluge-deluged-1 | raise ValueError('Namespace %s not available' % namespace)
deluge-deluged-1 | ValueError: Namespace Gtk not available
I think it should be possible to not fail if GTK is missing and not try to load it?
If you carefully move your cursor over the squares you might notice that the area that triggers selection of each square is misaligned such that the selection area for each square is approximately that of the square and all of the space to the right and bottom, whereas it should actually be the square and half of the surrounding space on all sides obviously.
This is directly related to the issue described in #30, coming from the exact same cause. The code dealing with selection area correctly expects the grid of squares, with each cell containing the square and its border, to start at position 0,0. However as described in #30, the squares in the first row and column do not leave room for the border space on the top and left edges respectively, incorrectly drawing the squares right up against the edges, and hence they are misaligned with the selection areas.
I'm preparing a fix.
Its time to support Deluge 2.x and Python 3. Python 2.x is dead..
https://pythonclock.org/ -- 01 Jan 2020
python/devguide#344
After some time of work unable to load WebUI content.
Uncaught TypeError: Cannot read properties of undefined (reading 'get_config')
at constructor.updateConfig (pieces.js:62:25)
at new constructor (pieces.js:42:9)
at S.onEnable (pieces.js:170:23)
at S.enable (deluge-all.js:243:383)
at Object.initialize (deluge-all.js:284:226)
at deluge-all.js:289:440
at ext-all.js:21:2438
at b (ext-all.js:21:19924)
Deluge 2.0.5
libtorrent: 2.0.5.0
pieces: libtorrent: 0.6
Hi, the plugin only makes the first piece to high. But the deluge is downloads 4 parts at the same time. So i would like to ask if the plugin makes next un-downloaded first 4 pieces to high ?
well, %subj% itself
Even though I have selected different colours than default for downloading and completed, when I highlight a piece or multiple pieces in the pieces area, the highlighted ones will show up as the default colours (for example even though i have the completed colour as green, when i highlight a completed piece i can see that it is actually red underneath the highlight).
If you select a torrent with a large number of pieces, such that vertical scrolling is enabled, then switch to a different torrent with fewer pieces, the drawing area does not shrink, thus vertical scrolling can remain when it should not, and the priority checkbox can be separated from the piece squares by a significant chunk of empty space you have to scroll through to get to it.
I'm preparing a fix.
Like the title says, I think it would be nice to have it set the first 5 un-downloaded pieces to high. Having only 1 set to high doesn't do much on a large torrent with many pieces.
hi, I've installed your plug-in into deluge and enabled it, I'm having problems, for example I've ticked set priority of first un-downloaded piece to high, tested on a fast torrent, about 170mb and, when it starts to download it simply downloads random blocks, does not follow from the top down.
please help
thank you
This plugin appears to work fine with the gtk interface however it completely breaks the WebUI. This is actually odd too because when you initially load it (if you have the webui open already) the tab shows up however when you refresh the webui interface it breaks completely.
I would like to see this fixed as the plugin has been useful to me.
It would be very useful, when working with a torrent containing multiple files, to be able to see the pieces separately by individual file. For example, if this is possible, you could add another column to the Files tab, showing the pieces for that file with the different colours etc. That would let you see whether a file has a missing piece at the beginning or end or wherever it is.
as per title :)
For the squares in the top row and left column, half of the border on the top or left edges respectively, is hidden due to being drawn outside of the drawing area. This is due to the border half overlapping the square, and the squares being drawn right up against the edge of the drawing area, without leaving room for the full border to be drawn.
I'm producing a fix.
The changelog in the readme has two entries marked as v0.3.
https://www.reddit.com/r/torrents/comments/cw1xuv/can_i_download_torrent_chunks_at_different/
I need something to do this, or can you please suggest an alternative way ?
This plugin is not coded to work in daemon/client configuration.
TorrentManager(components.get('TorrentManager')) is not available when the gtkui is running in client mode connected to a deamon.
You need to "proxy" the commands to your core.py and get back the information you wish for.
JavaScript console displays error pieces.js:62 Uncaught TypeError: Cannot read property 'get_config' of undefined
This might be a similar problem to omaralvarez/deluge-autoremoveplus#24, which was ultimately fixed by omaralvarez/deluge-autoremoveplus@ef42bae. That could be a good starting point for fixing this plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.