autodl-rutorrent icon indicating copy to clipboard operation
autodl-rutorrent copied to clipboard

Fixes for ruTorrent jQuery & Utility commits

Open stickz opened this issue 2 years ago β€’ 19 comments

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?

  1. This pull request addresses a commit with ruTorrent where the utility functions were changed. https://github.com/Novik/ruTorrent/pull/2247

  2. 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?

  1. 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.

  2. 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>.

stickz avatar Jan 14 '22 00:01 stickz

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.

zmiguel avatar Jan 17 '22 04:01 zmiguel

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.

zmiguel avatar Jan 20 '22 15:01 zmiguel

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.

stickz avatar Jan 20 '22 18:01 stickz

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.

liaralabs avatar Jan 23 '22 00:01 liaralabs

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?

skibbipl avatar Jan 24 '22 09:01 skibbipl

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.

stickz avatar Jan 24 '22 12:01 stickz

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.

skibbipl avatar Jan 24 '22 17:01 skibbipl

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.

zmiguel avatar Jan 24 '22 18:01 zmiguel

Please merge this into master so we can get on the latest version of rutorrent. thanks!

sk1llsh0t avatar Feb 16 '22 18:02 sk1llsh0t

friendly ping ... merge into master?

wmarler avatar Sep 06 '22 00:09 wmarler

@stickz @Rilick It will be great if those changes can merge into master

NirKli avatar Dec 31 '22 08:12 NirKli

This appears to have fixed the issue. πŸ‘

phene avatar Jan 20 '23 08:01 phene

Having the same issue.

How do i go about adding these changes with the command line?

Warmyyy avatar Feb 23 '23 21:02 Warmyyy

Can we get this updated again please.

I applied all the changes here, and it is still broken in latest rutorrent 4.0.2

Nunya-Biznus avatar Feb 28 '23 17:02 Nunya-Biznus

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 avatar Mar 17 '23 16:03 watermelonpinecone

@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

jaum20 avatar Apr 04 '23 17:04 jaum20

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 type git 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?

kashuuu avatar May 18 '23 13:05 kashuuu

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 type git 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

jaum20 avatar May 19 '23 00:05 jaum20

can someone please walk me through how to download this changes in terminal without having to go file by file?

iyanucodes avatar Jul 25 '23 08:07 iyanucodes