Skip to content
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

Fixes for ruTorrent jQuery & Utility commits #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stickz
Copy link

@stickz stickz commented Jan 14, 2022

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. Refactor code & implement autoloader Novik/ruTorrent#2247

  2. This pull request also addresses a commit with ruTorrent where the jQuery version was upgraded to 3.6.
    Upgrade jquery version to 3.6 Novik/ruTorrent#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>.

@zmiguel
Copy link

zmiguel commented Jan 17, 2022

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
Copy link

zmiguel commented Jan 20, 2022

Quick update, related to swizzin/swizzin#811 (comment)

I've just updated my container using the latest ruTorrent as of now (Novik/ruTorrent@627164e) that is after the v4.0-beta.1 tag and including this PR.

Can confirm this still works on v4.0-beta.1 ruTorrent.

@stickz
Copy link
Author

stickz commented Jan 20, 2022

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.

@liaralabs
Copy link

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.

@skibbipl
Copy link

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?

@stickz
Copy link
Author

stickz commented Jan 24, 2022

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.

@skibbipl
Copy link

skibbipl commented Jan 24, 2022

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.

@zmiguel
Copy link

zmiguel commented Jan 24, 2022

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.

@sk1llsh0t
Copy link

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

@wmarler
Copy link

wmarler commented Sep 6, 2022

friendly ping ... merge into master?

js/Trackers.js Outdated Show resolved Hide resolved
js/Filters.js Outdated Show resolved Hide resolved
@NirKli
Copy link

NirKli commented Dec 31, 2022

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

@phene
Copy link

phene commented Jan 20, 2023

This appears to have fixed the issue. 👍

@Warmyyy
Copy link

Warmyyy commented Feb 23, 2023

Having the same issue.

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

@Nunya-Biznus
Copy link

Can we get this updated again please.

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

@watermelonpinecone
Copy link

watermelonpinecone commented Mar 17, 2023

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

@jaum20
Copy link

jaum20 commented Apr 4, 2023

@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

@kashuuu
Copy link

kashuuu commented May 18, 2023

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?

@jaum20
Copy link

jaum20 commented May 19, 2023

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

@iyanucodes
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet