summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [WebUI] Accept network interface name as well as IP addressHEADdevelopNiluge_KiWi2024-09-102-12/+6
| | | | | | | | | | | | | | Deluge & libtorrent actually accept both IP address and device/interface namesgq as listen_interface: 540d557c which patched ui/ console & gkt3, but not web, this fixes it. (Inspired by https://github.com/deluge-torrent/deluge/pull/300) (Translation should be ok: this string already exists) Also, resync listen & outgoing widths: they hold the same data types. Closes: https://github.com/deluge-torrent/deluge/pull/458
* [Console] Fix 'move' command hanging when doneMartin Hertz2024-09-101-6/+2
| | | | | | | | | Console.get_torrent_name() expects string, but was given list from console.match_torrent(), so NoneType breaking join() in move message. Console.get_torrent_name() expects string, but was given list from console.match_torrent(), so NoneType breaking join() in move message. Simplified and fixed now. Co-authored-by: Calum Lind <calumlind+deluge@gmail.com> Closes: https://github.com/deluge-torrent/deluge/pull/447
* [Docs] Replace black/flake8 with pre-commitCalum Lind2024-09-083-24/+11
|
* [Lint] Format code with ruffCalum Lind2024-09-0834-132/+148
| | | | `pre-commit run --all-files`
* [Lint] Fix ruff lint gettext and type comparisonCalum Lind2024-09-0810-35/+37
| | | | | | | | The gettext strings cannot be formatted until after the function return from gettext. Refs: https://docs.astral.sh/ruff/rules/f-string-in-get-text-func-call/ Refs: https://docs.astral.sh/ruff/rules/printf-in-get-text-func-call/
* [Typing] Add pyright config to suppress warningsCalum Lind2024-09-082-0/+10
| | | | | | | | | | | | | | VSCode uses pylance/pyright, a performant type checker. So setup the builtins used by Deluge and set missing imports to informational due to OS-specific imports. It might be possible using extraPaths with extra stubs or use defineConstants to make pyright not check Windows or Macos conditional paths but that would require changing all usage so leaving for another time. Refs: https://github.com/microsoft/pyright/blob/main/docs/configuration.md Refs: https://github.com/microsoft/pyright/blob/main/docs/builtins.md
* [Lint] Replace black/flake8/isort with ruffCalum Lind2024-09-085-58/+47
| | | | Use ruff as a single performant tool to lint and format Python code.
* [Console] Block interactive-mode on Windows even with windows-cursesMartin Hertz2024-09-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Testing with window-curses results in hangs on initial loading with background error: File "C:\Users\Docker\Deluge\.venv\lib\site-packages\twisted\internet\selectreactor.py", line 39, in win32select r, w, e = select.select(r, w, w, timeout) builtins.OSError: [WinError 10038] An operation was attempted on something that is not a socket This is due to passing a Console class to addReader but this fails since select on Windows cannot handle non-socket file object unlike Unix which accepts sockets and file objects. There is likely a further issue where windows-curses has not implemented resizeterm so would need to use resize_term instead. Refs: https://docs.python.org/3/library/select.html#select.select Refs: https://stackoverflow.com/questions/11731175/python-twisted-addreader-works-in-linux-but-not-windows Refs: https://github.com/zephyrproject-rtos/windows-curses/issues/40 Refs: https://docs.python.org/3/library/curses.html#curses.resize_term Closes: https://github.com/deluge-torrent/deluge/pull/457 Co-authored-by: Calum Lind <calumlind+deluge@gmail.com>
* [CI] Fix accidental revert of Twisted pin for WindowsCalum Lind2024-09-081-0/+1
| | | | | | | In commit 9d802b2 I pushed a change to tests which included a revert of Windows pinned dependencies which was an accident. The actual change should only have reverted setup.py pinned dependency since we down want a release to not be able to use a later fixed version of Twisted.
* [UI] Replace deprecated cgi module with emailMamoru TASAKA2024-09-083-9/+15
| | | | | | | | | | | | | | | | | | | As PEP 594 says, cgi module is marked as deprecated in python 3.11, and will be removed in 3.13 (actually removed at least in 3.13 rc1). As suggested on PEP 594, replace cgi.parse_header with email.message.EmailMessage introduced in python 3.6. Updated test modify test_download_with_rename_sanitised - With RFC2045 specification, Content-Disposition filenames parameter containing slash (directory separator) must be quoted, so changing as such. Ref: https://peps.python.org/pep-0594/#deprecated-modules Ref: https://peps.python.org/pep-0594/#cgi Closes: https://github.com/deluge-torrent/deluge/pull/462
* [UI][Common] Wrap torrent comment and tracker status URLs in HTML (clickable)zakary2024-09-083-5/+18
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/460
* [Tests] Fix missing __qualname__ for mock callbackCalum Lind2024-09-063-4/+3
| | | | | | | | | | | | | test_pop_alerts raised the following error: File "/home/runner/work/deluge/deluge/deluge/core/alertmanager.py", line 177, in handle_alerts handler=handler.__qualname__, File "lib/python3.10/unittest/mock.py", line 645, in __getattr__ raise AttributeError(name) AttributeError: __qualname__ Mocks don't generate dunder methods like `__qualname__` attribute so we need to manually specify it.
* [Console] endwin() not needed when using wrapperGregorio Litenstein2024-08-261-1/+0
| | | | | | Using it anyway produces a crash because it returns an error if called two times without any intervening updates. Closes: https://github.com/deluge-torrent/deluge/pull/461
* [Console] Improve interactive-mode preferences savingMartin Hertz2024-08-261-3/+14
| | | | | | | The bottom options for cancel/apply/ok where confusing for end-users as being checkboxes needing spacebar prepended to activate firstly, before return/enter to activate said previous selection, but changed now to omit. Also fixed not showing canceled options as sticking. Co-authored-by: Calum Lind <calumlind+deluge@gmail.com> Closes: https://github.com/deluge-torrent/deluge/pull/445
* [Build] Fix Ubuntu dependency for appindicatorkenstir2024-08-263-4/+4
| | | | | | | | | Change name to gir1.2-appindicator3-0.1. Tested on Ubuntu 22.04.4 LTS and Ubuntu 20.04.6 LTS. Replace appindicator3 refs with newer ayatanaappindicator3 Replace broken python-appindicator link with working jammy link. Closes: https://github.com/deluge-torrent/deluge/pull/459
* [UI] Replace deprecated Pillow Image.Antialias with LanczosCalum Lind2024-08-261-1/+1
| | | | | | | ANTIALIAS was removed in Pillow 10.0.0 so replace with suggested alternative. Ref: https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#constants
* [i18n] Update po files from launchpadCalum Lind2024-08-2580-269668/+270056
|
* [Console] Fix ports typoJacob Siverskog2024-08-242-12/+4
| | | | | | incomming -> incoming. Closes: https://github.com/deluge-torrent/deluge/pull/442
* [AutoAdd] Fix Windows display scaling breaking WebUI elementsMartin Hertz2024-08-241-1/+3
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/444
* [CI] Update actions to latest version (node 16 deprecation)zakary2024-08-244-14/+14
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/453
* [Packaging] NSIS x64 reg-keys into proper placeMartin Hertz2024-08-241-1/+3
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/455
* [Util] Refactor reset language env varsCalum Lind2024-08-241-3/+2
|
* [3635][WebUI] fix language change to system defaultDjLegolas2024-08-241-0/+3
| | | | | | | | | | | | When setting a language, we set 2 environment variables at run time. Setting the language back to `System Default`, we don't clean those env variables. In the WebUI, the page only reloads, and we still use the env variables to set the language back to the previous one. This does not affect GTK. Closes: https://dev.deluge-torrent.org/ticket/3635 Closes: https://github.com/deluge-torrent/deluge/pull/450
* [Build] Prevent usage of twisted>=23 on WindowsDjLegolas2024-08-242-2/+4
| | | | | | | | | | | | with newer versions of twisted, a regression was added for the GTK reactor on Windows. it effects all versions, including latest (currently 24.3.0). So will prevent the upgrade on Windows only. Issue: https://dev.deluge-torrent.org/ticket/3634 Related: https://github.com/twisted/twisted/issues/11987 Closes: https://github.com/deluge-torrent/deluge/pull/448
* [WebUI] Fix gettext _ importsCalum Lind2024-08-242-2/+1
|
* [WebUI] Fix error stopping daemon in connection managerCalum Lind2024-08-242-53/+22
| | | | The wrong number of arguments was being parsed from get_host_info.
* [CI] Disable failing alertmanager test on WindowsCalum Lind2024-08-191-0/+5
| | | | | | | | | | | The test_pause_not_pop_alert test passes on Linux but is consistently failing in CI pipeline for Windows: AssertionError: Expected 'mock' to not have been called. Called 1 times. Calls: [call.deferred.cancel(), call(LtAlertMock(type=1, name='mock_alert1', message='Alert 1'))]. Disabling the test until it can be resolved.
* Add deluge.pot to repo for new translation appCalum Lind2024-07-152-1/+6220
| | | | Attempting to move to weblate but need deluge.pot in the repo
* [GtkUI] Reword preferences to prefer dark themeCalum Lind2024-02-194-79/+50
| | | | | | The GTK option for dark theme only provides a preference to use the dark theme, there is not a similar option for light theme so the settings should only refer to 'prefer dark theme' and whether it's on or off.
* [WebUI] Refactor changing themeCalum Lind2024-02-192-14/+22
| | | | | | | Simplify searching for themes and ensure theme is ordered last. Ideally themes would be set client-side but seems to be quite tricky to accomplish with ExtJS.
* [GtkUI] Add a way to change themesDjLegolas2024-02-194-5/+101
| | | | | | | | Currently, the only way to change the themes is by manually set a value in the command line or set it as env variable. Closes: https://dev.deluge-torrent.org/ticket/3536 Closes: https://github.com/deluge-torrent/deluge/pull/392
* [WebUI] Add a way to change themesDjLegolas2024-02-193-6/+94
| | | | | | | Currently, the only way to change the themes is by manually set a value in the `web.conf` file itself. Closes: https://dev.deluge-torrent.org/ticket/3536
* [WebUI] Fix tracker icon to fit within tracker column rowsChris Ross2024-01-211-1/+1
| | | | | | | | | | | For me at least, Safari on Mac OS X, the tracker icon significantly overflows in the Tracker column of the torrent list. (It does show the correct size in the Trackers filter, though. Different CSS.) This change causes it to constrain down to the height of the column and display correctly. Closes: https://github.com/deluge-torrent/deluge/pull/440
* [WebUI] Fix progress divide by 0 error with empty dirfreddy26592024-01-211-1/+4
| | | | | | | | | | | | | | If a dir exists with no contents then the following error occurred: ``` Traceback (most recent call last): ... File "/usr/lib/python3.10/site-packages/deluge/ui/web/json_api.py", line 608, in _on_got_files dirinfo['progress'] = sum(progresses) / dirinfo['size'] * 100 builtins.ZeroDivisionError: float division by zero ``` Closes: https://github.com/deluge-torrent/deluge/pull/439
* [Docs] Bump sphinx version requirementsCalum Lind2024-01-211-5/+5
| | | | | There are still warnings that need to be resolved but the build is passing.
* [Alerts] Fix alert handler segfault on lt.pop_alertsCalum Lind2024-01-211-30/+29
| | | | | | | | | | | | | | | We cannot handle an alert after calling lt.pop_alerts for a subsequent time since the alert objects are invalidated and with cause a segfault. To resolve this issue add a timeout to the handler calls and wait in the alert thread for either the handlers to be called or eventually be cancelled before getting more alerts. This is still not an ideal solution and might leave to backlog of alerts but this is better than crashing the application. Perhaps the timeout could be tweaked to be shorter for certain alert types such as stats. Related: https://github.com/arvidn/libtorrent/issues/6437
* [GTK3] Fix changing torrent ownershipCalum Lind2023-12-022-31/+14
| | | | | | | | | | | | The change ownership menu item was broken due to Gtk deprecation changes in commit #bcaaeac. Fixed by correctly setting the RadioMenuItem group Refactored to simplify the code Removed dead or unneeded code Fixes: https://dev.deluge-torrent.org/ticket/3610
* [Core] Remove usage of deprecated torrent status.pausedCalum Lind2023-12-021-2/+2
| | | | | | | | | | Noticed mismatch with current lt docs and found usage of deprecated status.paused. The actual check here is not required we should just attempt to pause the torrent. Issue: https://dev.deluge-torrent.org/ticket/3499
* [Tests] Refactor parse_human_size testCalum Lind2023-11-301-10/+11
|
* [Common] Fix order of size_units for parse_human_sizeCalum Lind2023-11-271-5/+5
| | | | The previous commit changed the order of the size
* [Common] Add extra size units suffixes for user inputArkadiusz Bulski2023-11-271-14/+34
| | | | | | Minor updates to docstrings Closes: https://github.com/deluge-torrent/deluge/pull/437
* [Tests] Fix unhandled ProcessTerminated trying to kill daemon in cleanCalum Lind2023-11-271-2/+5
| | | | | | | | | | The GitHub CI tests on Linux were failing due to ProcessTerminated > await daemon.kill() E twisted.internet.error.ProcessTerminated: A process has ended with a probable error condition: process ended by signal 6. Added a try..except in daemon as a quick solution but might need to investigate the ProcessOutputHandler.kill method.
* [Core] Refactor Alertmanager to retry unhandled alertsCalum Lind2023-11-272-58/+89
| | | | | | | | | | | | | | | We are currently creating a copy of each alert to avoid segfaults when the next pop_alerts invalidates the lt alert objects we are holding for handler callbacks. However these alert copies are not deep enough since need to also resolve the alert object methods e.g. message() therefore it is still possible to result in lt segfaults. The workaround is to check for any handlers not called, give them some more time and eventually discard if still not handled. Ref: https://github.com/arvidn/libtorrent/issues/6437
* [Core] Call wait_for_alert in a threadDjLegolas2023-11-274-10/+85
| | | | | | | | This spawns a thread in alertmanager to call wait_for_alert in a thread. This reduces latency to deluge responding to events. And removes all `hasattr` checks in Component Closes: https://github.com/deluge-torrent/deluge/pull/221
* [CI] Fix windows packaging buildCalum Lind2023-11-241-5/+6
| | | | | | | | | With recent update to pyinstaller 6.0 the libraries are now placed in an `_internal` folder within the bundle. This has resulted in the failure to create copies of libssl. However after examining the new _internal dir it appears that the x64 lib are now created so this step is no longer required.
* [UI][Common] Add daemon version checkDjLegolas2023-11-202-3/+45
| | | | | | | | | For new UI features to be added, one should make sure the backend daemon is supported and add fallback in case it doesn't. Here we add the ability to get the daemon version from the `Client` class and also check the version against a desired version. Closes: https://github.com/deluge-torrent/deluge/pull/427
* [Core] Support creating v2 torrentsRadu Carpa2023-11-203-87/+328
| | | | | | | | | | | | | | | | | | | | | | Add support for v2 torrents in create_torrent, but keep the old default of only adding the v1 metadata. Unify the single-file and directory cases to avoid code duplication. V2 torrents require files to be piece-aligned. The same for hybrid v1/v2 ones. To handle both cases of piece-aligned and non-aligned files, always read the files in piece-aligned chunks. Re-slice the buffer if needed (for v1-only multi-file torrents). Also, had to adapt to progress event. It now depends on the number of bytes hashed rather than the number of pieces. To avoid sending and excessive amount of event when handling a directory with many small files, add a mechanism to limit event period at 1 per piece_length. Closes: https://github.com/deluge-torrent/deluge/pull/430
* [Core] Make create_torrent return a deferredRadu Carpa2023-11-202-18/+42
| | | | | This allows to create a torrent file on the remote server and get its content in one call.
* [Core] Don't always write create_torrent metafile to diskRadu Carpa2023-11-202-25/+74
| | | | | | | | | If target=None and add_to_session is True, the torrent will be directly added to the session without writing the torrent file to disk. This will allow to programmatically control deluge via RPC without creating .torrent files all over the place. Also, make most create_torrent parameters optional.
* [Lint] Fixup filesCalum Lind2023-11-202-17/+17
|