Commit graph

10819 commits

Author SHA1 Message Date
Chocobo1
3f2b4afc21 Add description meta tag 2024-02-25 20:17:56 +08:00
Chocobo1
e1fa7e01c6 Remove unneeded polyfill
All browsers already have native support for it.
2024-02-25 20:17:56 +08:00
Chocobo1
9192c988ed Warp script in anonymous scope (IIFE)
It was erroneously removed in 9b64d50660.
2024-02-25 20:17:56 +08:00
Chocobo1
cffd74b62a
Add support for SSL torrents
The 'SSL torrent' feature is not standardized. I.e. there are no BEP (BitTorrent Enhancement Proposals) associated with it, so we do not greatly encourage its usage as it will only work with libtorrent clients and derivatives. It will not work with other torrent clients that do not support the libtorrent specific implementation.
This PR aims to provide minimal support for those who need SSL torrents. Furthermore, it is intended that there will be no UI support (nor indication) of adding/creating SSL torrents.

* Prerequisites:
  I omit the instructions of creating those files as the intended audience (experts & advanced users) should have no problem with it. All files are as follow:
  1. Root (torrent publisher) certificate
  2. Root private key
  3. A .torrent file created with root certificate 
  5. Peer certificate (signed by the root certificate)
  6. Peer private key
  7. Diffie-Hellman parameters file
  
  All files are stored in .pem format.

* Enable SSL torrent protocol in qbt
  There are 2 hidden keys to put in qbt config file, under `[BitTorrent]` section:
  1. `Session\SSL\Enabled`: set it to `true`.
  2. `Session\SSL\Port`: set it to some unused port or omit the key entirely to let qbt pick one for you.
* Add an SSL torrent to qbt
  The only way of adding an SSL torrent is via WebAPI. The `/api/v2/torrents/add` endpoint will support 3 additional parameters. You must provide them for an SSL torrent.
  1. `ssl_certificate`: Contents of the peer certificate file (in PEM format).
  2. `ssl_private_key`: Contents of the peer private key file.
  3. `ssl_dh_params`: Contents of the Diffie-Hellman parameters file.

* Change the SSL parameters to a torrent
  In case you provided wrong SSL parameters when adding a torrent, there is a new endpoint `/api/v2/torrents/setSSLParameters` that you can update the SSL parameters. The parameters (`ssl_*`) are the same as `/api/v2/torrents/add` endpoint.

* Query the SSL parameters of a torrent
  There is a new endpoint `/api/v2/torrents/SSLParameters` that you can query the SSL parameters of a torrent.

References:
* https://www.libtorrent.org/manual-ref.html#ssl-torrents
* https://blog.libtorrent.org/2012/01/bittorrent-over-ssl/

PR #20338.
---------

Co-authored-by: Radu Carpa <radu.carpa@cern.ch>
2024-02-25 19:58:58 +08:00
Vladimir Golovnev
7786e1b084
Improve received metadata handling
Avoid blocking call to libtorrent when accessing underlying torrent_info object.

PR #20424.
2024-02-21 17:25:54 +03:00
Chocobo1
bb8a012b1c
Revise cache internals
Now cache initialization and `get()` is less costly to use and it shifts the weight to `set()`.

PR #20430.
2024-02-18 14:16:00 +08:00
Chocobo1
63c9b6388e
Rename to WebUI
PR #20428.
2024-02-18 13:58:44 +08:00
Vladimir Golovnev
f04edd555f
Open "lock" files for the same folder only once
PR #20414.
Closes #12203.
2024-02-15 08:42:44 +03:00
Chocobo1
e31b553807 Stop sync requests after qbt has been shutdown 2024-02-14 03:38:09 +08:00
Chocobo1
a9741bb203 Defer loading of js code on landing pages
So that DOM tree can be processed earlier.
2024-02-14 03:38:09 +08:00
Chocobo1
67e0a2de44 Combine script tags 2024-02-14 03:38:09 +08:00
Chocobo1
1afb3ff433 Add support for dark theme 2024-02-14 03:38:09 +08:00
Chocobo1
16a91f26fb Simplify code 2024-02-14 03:38:09 +08:00
Chocobo1
963a7faab8 Migrate to Cache for commonly used data
Previously it was abusing the `localStorage` and now it is storing data in memory (per session).
2024-02-14 03:38:09 +08:00
Chocobo1
d06d5b923a Cache program preferences
So that qbt can just use the data from memory which is vastly faster than waiting for a response
over the net.
2024-02-14 03:38:09 +08:00
Vladimir Golovnev
60bb819e2e
Allow WebAPI to specify filename and mime type for result data
PR #20377.
2024-02-12 09:07:09 +03:00
Chocobo1
8ef99b336c Remove 'no cache' directive for POST requests
The response for POST request is only cachable under a specific condition and
qbt doesn't use it.
https://developer.mozilla.org/en-US/docs/Glossary/Cacheable
2024-02-11 23:28:44 +08:00
Chocobo1
f7e9ff0fb0 Clean up functions in global scope 2024-02-11 23:28:44 +08:00
Chocobo1
9b64d50660 Conditionally hide settings in Advanced Options 2024-02-11 23:28:44 +08:00
Chocobo1
5fe5c333b5 Rename file 2024-02-11 23:28:44 +08:00
Chocobo1
49f819ef78 Use correct type for each option 2024-02-11 23:28:44 +08:00
Vladimir Golovnev
2755190d8e
Link PowrProf library to qBittorrent base
PR #20387.
2024-02-10 11:59:14 +03:00
Chocobo1
f87ea1b5d3
Sort languages combobox by language code
* Avoid creating redundant file lists
* Sort languages combobox by language code

PR #20365.
2024-02-05 13:44:18 +08:00
Vladimir Golovnev
88a4990435
Don't use iterator after erase
PR #20357.
Closes #20356.
2024-02-03 08:10:14 +03:00
Chocobo1
9bfb447dd3
Improve WebUI responsiveness
This migrates Category and Tag to `Map` type from `Object` type. And done some algorithm and data structure optimization.

PR #20297.
2024-01-27 22:04:39 +08:00
Vladimir Golovnev
d652a10495
Add seeding limits to RSS and Watched folders options UI
PR #20324.
Closes #19605.
2024-01-27 14:30:27 +03:00
jNullj
df41940ebc
Fix typo in preferences.html
PR #20326.
2024-01-26 10:58:57 +03:00
Chocobo1
94e80d01a8
Clean up code
* Use compiler generated comparison function
* Use designated initializers
* Convert to proper type
* Use reference
* Remove redundant text
  The `msg` already contain the text `Reason:` so it isn't needed.

PR #20312.
2024-01-25 02:56:12 +08:00
Vladimir Golovnev
bab9c15913
Revamp handling of getting resume data from libtorrent
PR #20310.
2024-01-24 15:40:08 +03:00
jNullj
c5d7b62473
Delay subsequent requests to the same host
PR #19801.
Closes #8350.
2024-01-19 20:38:16 +03:00
Vladimir Golovnev
8ec3db1807
Change "metadata received" stop condition behavior
PR #20283.
Closes #20122.
2024-01-19 20:34:40 +03:00
Vladimir Golovnev
05572a7317
Add missing comparison case
Closes #20290.
2024-01-19 10:13:34 +03:00
Chocobo1
00372dd559
Use natural sorting in WebUI
Also change case sensitivity to the default of 'sort' mode.

PR #20264.
2024-01-15 13:12:36 +08:00
Chocobo1
6918316a3d Switch to new method for checking own properties
The new method is an intended replacement for previous one as suggested by MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
2024-01-15 13:12:12 +08:00
Chocobo1
2edb1a0765 Improve WebUI responsiveness
Related: #20249.
2024-01-15 13:12:12 +08:00
sledgehammer999
582e4dcb59
Sync translations from Transifex and run lupdate 2024-01-15 00:28:06 +02:00
Vladimir Golovnev
14513d051d
Don't stuck loading on mismatching info-hashes in resume data
PR #20262.
Closes #20251.
2024-01-13 18:08:16 +03:00
Vladimir Golovnev
97c0abcbf0
Improve Download Manager subsystem
PR #20257.
2024-01-13 08:55:40 +03:00
Chocobo1
ad22237a2f Provide safe helper for converting to 'seconds since epoch' 2024-01-08 15:13:02 +08:00
Chocobo1
8bdb83d973 Use initialization form for variable 2024-01-08 15:13:02 +08:00
Chocobo1
54bcabeca4 Leave the fields empty when value is invalid
This follows GUI behavior.
2024-01-08 15:13:02 +08:00
Chocobo1
114652205c Fix wrong time stamp values in WebAPI
The wrong values are observed when encountered an invalid QDateTime data.
2024-01-08 15:13:02 +08:00
Chocobo1
5b3b56c918
Improve natural sort algorithm
1. Use proper case folding function instead of `toLower()`.
2. Use locale aware comparison instead of comparing unicode code points.
   Now `a` comes before `A` which is the same as the result from QCollator. A nice side effect
   is now it properly compares locale specific characters (for example `C`, `Č`).
3. Improve testing. Now the test is runnable and stable on all platforms.

PR  #20208.
2024-01-08 14:47:00 +08:00
David
e69f857828
Allow to remember torrent content files deletion in WebUI
Add a 'remember choice' button to the WebUI Torrent Deletion dialog that sets the default file deletion setting. The setting is shared with GUI, so if you set it in WebUI and open the Qt app, the 'delete files' checkbox will match WebUI (checked or unchecked).

PR  #20150.

---------

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2024-01-08 14:39:51 +08:00
Vladimir Golovnev
0b6d785e87
Show URL seeds for torrents that have no metadata
PR #20233.
Closes #20198.
2024-01-06 15:51:19 +03:00
Vladimir Golovnev
f3d45327e1
Apply inactive seeding time limit set on new torrents
PR #20231.
Closes #20224.
2024-01-05 18:25:29 +03:00
Vladimir Golovnev
9bf7f3b181
Show correctly decoded filename in log
PR #20214.
Closes #20186.
2024-01-02 16:03:12 +03:00
Chocobo1
d5bf0358cb
Revise conditional for when to use QCollator
According to https://doc.qt.io/qt-6/qcollator.html#posix-fallback-implementation
The 'POSIX fallback implementation' is only used when ICU is not available. So the correct way is to detect ICU directly and not depend on the OS. The exceptions are macOS and Windows since they support the required functionalities natively.
Closes #20205.
PR #20207.
2024-01-02 16:58:12 +08:00
Chocobo1
fc56fdade7
Specify a locale if none is set
Sometimes users had not properly configured their system locale and thus
qbt will specify a default locale just in case.

Closes #16127.
Closes #19609.
Closes #19834.
PR #20203.
2024-01-02 16:49:40 +08:00
thalieht
8dcc734df5
Enable Ctrl+F hotkey for more inputs
PR #20131.
2023-12-19 20:52:47 +03:00