-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send only updated/changed torrents to the client #6
Open
bendikro
wants to merge
6
commits into
deluge-torrent:develop
Choose a base branch
from
bendikro:develop-only-updated-torrents-torrentfilter-on-client-side-dev
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Send only updated/changed torrents to the client #6
bendikro
wants to merge
6
commits into
deluge-torrent:develop
from
bendikro:develop-only-updated-torrents-torrentfilter-on-client-side-dev
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deluge/core/torrentmanager.py
Outdated
log.info("Finished loading %d torrents.", len(state.torrents)) | ||
|
||
finished = datetime.datetime.now() | ||
log.info("Finished loading %d torrents in %s", (len(state.torrents), str(finished-start))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log takes *args for the string replacement, so there are some extra parens here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: 3fe458d
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
September 10, 2014 21:35
3fe458d
to
df79207
Compare
gazpachoking
force-pushed
the
develop
branch
from
September 22, 2014 18:55
2ff1373
to
8ba0e7c
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
September 30, 2014 13:42
df79207
to
c356ae7
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
3 times, most recently
from
October 10, 2014 14:37
9a8f491
to
74ddd8e
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
December 1, 2014 14:32
74ddd8e
to
3a61089
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
January 26, 2015 10:51
3a61089
to
57b00b7
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
April 3, 2016 16:23
bdb2934
to
63f52e1
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
3 times, most recently
from
April 12, 2016 00:38
889b2bb
to
04f9b5e
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
3 times, most recently
from
April 13, 2016 01:21
f20513d
to
3ac6c86
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
April 19, 2016 23:02
3ac6c86
to
30138e9
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
2 times, most recently
from
April 21, 2016 12:35
1d55cd7
to
a0347a9
Compare
bendikro
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
2 times, most recently
from
November 3, 2016 12:22
81cfb23
to
6fb33ca
Compare
cas--
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
2 times, most recently
from
November 4, 2016 18:10
0b7fd1f
to
735eb98
Compare
Rebased and squashed fixups upon develop |
All the event handle management is done by either EventManager or EventManagerClient. A client can now emit an event that will be triggered by an event handler on the same client using client.emit(...)
…changed Clients can now request a list of torrents that have changed since last request. This reduces the amount of data transferred with the RPC protocol, making it much faster with large amounts of torrents. The UIs can more easily update only the necessary torrent list entires making the UIs render faster. * GKTUI (torrentview) now asks only for changed torrents * Added torrentfilter.py to sessionproxy which handles filtering * Implemented filtering in filtermanager.py and torrentfilter.py using PyDbLite. The new filtering allows for more advanced filter queries to be implemented.
* Added new quick search filter
cas--
force-pushed
the
develop-only-updated-torrents-torrentfilter-on-client-side-dev
branch
from
November 4, 2016 23:59
735eb98
to
2fdae2d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch contains the following modifications:
Feedback is very appreciated. 😉 @gazpachoking
Note: PyDbLite is a separate project: https://pypi.python.org/pypi/PyDbLite
Changes on the server side
deluge/core/core.py
Changed functions:
Removed functions:
deluge/core/filtermanager.py
Most of the functionality of
filtermanager.py
has been moved to the client side (torrentfilter.py
).filtermanager.py
now only filters on the owner so the client will only receive the torrents it is authorized to see.It filters on owner using the new databases in deluge/include/pydblite.
deluge/core/rpcserver.py
Changed functions:
ClientDisconnectedEvent
when client disconnectsdeluge/core/torrent.py
Changed functions:
Now emits
TorrentTrackerStatusChangedEvent
when torrent status is setdeluge/core/torrentmanager.py
Added status_dicts which contains all the torrents for each session. When a torrent is updated (either by libtorrent or a plugin) it is removed from the cache to mark it as updated.
Changed functions:
TorrentsUpdatedEvent
New Functions:
Changes on the client side
deluge/ui/gtkui/torrentview.py
Changed to now only update the necessary rows.
The main difference is that self.status now always contains all the torrents, not only the torrents that are displayed. Which torrents that are currently displayed is stored in the
set
self.visible_torrents
which is updated in _on_get_torrents_status.Changed functions:
Removed functions:
deluge/ui/sessionproxy.py
Has been completely changed. It no longer keeps track of cache times for each value. This was extremely expensive, and is no longer needed as the torrents that have been updated on the server side are now updated automatically.
self.updated_ids contains the torrent ids that have been updated from core and not yet updated in the ui.
All of the filtering previously performed in filtermanager is now performed by self.torrentfilter. This reduces the workload for the daemon tremendously and makes it much faster on the client side to get the filtered results.
Changed functions:
New arguments:
deluge/ui/torrentfilter.py
This does all the filtering on the client side which was previously done in
filtermanager.py
on the server side.torrentfilter.py
uses PyDbLite (which uses SQLite if available, else pure Python) to perform all the filtering. The filtering code should be cleaner and simpler than the old code, and also much more efficient with many torrents.deluge/plugins/Label/deluge/plugins/label/{core.py,gktui/init.py}
Changed to work with the new filtering
Changed to handle “hide owners” in sidebar:
deluge/ui/gtkui/filtertreeview.py
deluge/ui/gtkui/glade/main_window.ui
deluge/ui/gtkui/menubar.py
deluge/ui/web/server.py
deluge/ui/gtkui/gtkui.py
Changes for both client and server
deluge/event.py
PyDbLite for efficient filtering
Added files: