ruTorrent icon indicating copy to clipboard operation
ruTorrent copied to clipboard

Fix RSS URL rule error

Open jevenski opened this issue 1 year ago • 4 comments

  • Fix error when trying to add new RSS rules using the add button. This error probably was probably introduced when the dialog was rewritten with jQuery.
  • The scope of functions defined in this plugin (rssurlrewrite) seemed a little messy. Some functions need to go into the plugin object, some need to go into the theWebUI object, and others need to stay local. I moved some of these functions a bit, but that's still not perfect yet. Some further fine tunings are still required.

Related: https://github.com/Novik/ruTorrent/issues/2753

jevenski avatar Oct 24 '24 11:10 jevenski

@koblack Could you test this before I merge? I'm not an expert on the RSS elements of ruTorrent.

stickz avatar Oct 24 '24 20:10 stickz

Tested on 279f45b69604961a0cc58506a9af753d4e8e41f4 Test button "?" returns error

Uncaught TypeError: this.request is not a function from TypeError: this.request is not a function
    at theWebUI.checkCurrentRule (<anonymous>:1151:87)
    at HTMLButtonElement.dispatch (http://xxx/ruTorrent-jevenski/js/jquery.js?v=51B2:2:40035)
    at v.handle (http://xxx/ruTorrent-jevenski/js/jquery.js?v=51B2:2:38006)

image

koblack avatar Oct 25 '24 06:10 koblack

I did some further adjustments towards the scope of plugin functions. The culprit was still the this keyword in JavsScript.

As a sidenote, it seems to me that the checkCurrentRule() function sends the Regexp tests to the server and retrieves the test result from it. The PHP code block does nothing server-specific but running the Regexp tests and spitting the results. It looks like a waste of resources because this can be done perfectly on the client side. Correct me if I missed anything.

jevenski avatar Oct 25 '24 09:10 jevenski

@koblack Could you confirm this PR is ready to merge?

@jevenski We can adjust checkCurrentRule() in v5.2. I would also like to drop support for Internet Explorer in v5.2 as well. Everything is perfectly functional right now. Let's keep it "as is" so we can release this version in the near future!

stickz avatar Oct 25 '24 14:10 stickz

Everything seems to be working fine now! Thanks a lot!

koblack avatar Oct 26 '24 13:10 koblack