autodl-rutorrent
autodl-rutorrent copied to clipboard
Fixes for ruTorrent jQuery & Utility commits
Please note: I was not able to setup a proper testing environment for this pull request. Testing was limited to what I could find without setting up autodl-irssi
and using the jQuery migration plugin. I require help testing this pull request.
The latest updates to ruTorrent can be downloaded from the master branch here: https://github.com/Novik/ruTorrent
What does this pull request fix?
-
This pull request addresses a commit with ruTorrent where the utility functions were changed. https://github.com/Novik/ruTorrent/pull/2247
-
This pull request also addresses a commit with ruTorrent where the jQuery version was upgraded to 3.6. https://github.com/Novik/ruTorrent/pull/2236
What are the fixes for this pull request?
-
With the change in utility functions for ruTorrent, we must now access them from their respective classes. They are no longer in the global scope. They now must be accessed from static class methods.
-
With the upgrade of JQuery to version 3.6 we must change the syntax of our JavaScript files to match new stricter rules:
- The usage of short hands are now depreciated for JavaScript events.
It is no longer recommended to use:
$("#autodl-log-backup-button").click(function()
{
backupIframe.attr("src", "plugins/autodl-irssi/getfile.php?file=autodl.cfg");
});
Instead we should do this:
$("#autodl-log-backup-button").on('click', function()
{
backupIframe.attr("src", "plugins/autodl-irssi/getfile.php?file=autodl.cfg");
});
- Self closing HTML tags are no longer allowed. They are interrupted as invalid by the later versions of jQuery.
We can no longer do this:
<div id="autodl-filters-list"/>
instead we must do this:<div id="autodl-filters-list"></div>
.
First of all thank you so much for also updating the irssi web plugin.
I've tested your changes on the latest ruTorrent git master branch as of now (5f139bf) and used a fork of your branch. I tested it in a docker container that you can find here and everything works just as before.
I don't have any authority here, but LGTM.
Quick update, related to https://github.com/swizzin/swizzin/issues/811#issuecomment-1016765946
I've just updated my container using the latest ruTorrent as of now (https://github.com/Novik/ruTorrent/commit/627164e10eb60b1a0820101190dfb85246b09149) that is after the v4.0-beta.1 tag and including this PR.
Can confirm this still works on v4.0-beta.1 ruTorrent.
Thanks @zmiguel for confirming that. v4.0-beta.1 is just tag of these and other changes. There has been no breaking changes in the master branch since this version tag. If any problems are encouraged, they will most likely be related to the 2 PRs I tagged. Developers can ether use the commit you selected or pre-release v4.0-beta.1 to test. The only difference is increased debugging information. ruTorrent was updated to log a stack trace to console when a JavaScript error occurs.
Thanks for the fix @stickz. Myself and others greatly appreciate your contribution to this problem.
I've tested these changes myself and everything is looking good.
Not sure if it's related to this issue, but autodl is still not working on my setup:
[24.01.2022 10:44:53] Error downloading files. Make sure autodl-irssi is started and configured properly (eg. password, port number): Error getting files listing: Error: Invalid port ()! Initialize port in autodl.cfg
[24.01.2022 10:45:38] Command failed: Error: Invalid port ()! Initialize port in autodl.cfg
Of course port and password is set in conf.php. Also autodl is listening on that port. Maybe it's related to the fact that I upgraded to php 8.1 on my debian machine?
Maybe it's related to the fact that I upgraded to php 8.1 on my debian machine?
Could you try this without PHP 8? ruTorrent and/or autodl may not be compatible with this. There's been zero testing for PHP 8.
The problem is that I cannot easily downgrade without some super hacks. Well, I'll have to live without autodl for a wile. I hope you'll adopt it to php8.1 sooner or later. But I can help testing php8 compatibility.
Maybe it's related to the fact that I upgraded to php 8.1 on my debian machine?
@skibbipl From the tests I did on a docker container with php8 it never worked properly.
I would recommend sticking with php7 or running it in a container.
Please merge this into master so we can get on the latest version of rutorrent. thanks!
friendly ping ... merge into master?
@stickz @Rilick It will be great if those changes can merge into master
This appears to have fixed the issue. π
Having the same issue.
How do i go about adding these changes with the command line?
Can we get this updated again please.
I applied all the changes here, and it is still broken in latest rutorrent 4.0.2
This is working for me in its current state with PHP v8.1 and ruTorrent v4.0.2 (thank you very much stickz :blue_heart:). To use it before merge put .diff
on the end of this URL (e.g. https://github.com/autodl-community/autodl-rutorrent/pull/58.diff), copy the contents to a file in the root of your ruTorrent installation, and type git apply [diff-file]
.
@watermelonpinecone
Tried your solution but get an error:
58.diff:646: trailing whitespace.
$("#autodl-ircsrvs-new-button").on('click', function()
warning: 1 line applied after fixing whitespace errors.
the error Exception info: No content elem with id autodl-prefs-contents-upload
persists after applying changes
This is working for me in its current state with PHP v8.1 and ruTorrent v4.0.2 (thank you very much stickz π). To use it before merge put
.diff
on the end of this URL (e.g. https://github.com/autodl-community/autodl-rutorrent/pull/58.diff), copy the contents to a file in the root of your ruTorrent installation, and typegit apply [diff-file]
.
@watermelonpinecone thanks for this, though it did not work for me. I removed the extra space mentioned by @jaum20 but I still get the same error "Exception info: No content elem with id autodl-prefs-contents-upload" after applying the changes. Any clue?
This is working for me in its current state with PHP v8.1 and ruTorrent v4.0.2 (thank you very much stickz π). To use it before merge put
.diff
on the end of this URL (e.g. https://github.com/autodl-community/autodl-rutorrent/pull/58.diff), copy the contents to a file in the root of your ruTorrent installation, and typegit apply [diff-file]
.@watermelonpinecone thanks for this, though it did not work for me. I removed the extra space mentioned by @jaum20 but I still get the same error "Exception info: No content elem with id autodl-prefs-contents-upload" after applying the changes. Any clue?
I would suggest you to switch to autobrr. That was what I did and canβ get back to autodl
can someone please walk me through how to download this changes in terminal without having to go file by file?