📜 ⬆️ ⬇️

Mobile version of ruTorrent

At my home there is a mini-server made from an old laptop. One of the main purposes is torrents. The client uses rTorrent + rutorrent. In such a bundle, everything suited me except one thing: the impossibility of using the rutorrent from a smartphone. There are two reasons for this:

  1. Strong dependence on the right mouse button. It is treated with the help of the ipad plug-in, but how can you conclude from the name of the plug-in this option is only suitable for tablets because of the second reason.
  2. The inability of the interface to small displays. An example can be seen in the screenshot below (screenshot taken on HTC Incredible S. Resolution: 800x480, screen size: 4 ")



Having suffered a little by reading the official forum, I realized that the developers are not going to add support for mobile devices and I decided to correct the situation myself.

One of the benefits of rutorrent is extensibility with plugins. Actually, I wrote a plugin completely changing the interface for mobile devices. Here's what happened:
')


If you are interested in this plugin, here is a link to the archive with the latest version. The current development version is available on github .

As seen in the screenshots, the interface has been completely reworked for ease of use on small displays. Old naturally does not disappear anywhere. The plugin itself determines by the “User Agent” when it is necessary to turn on, or you can turn the mobile interface on or off by changing the URL Details in the section "use".
Twitter Bootstrap was used to create the interface. For auto-detection, a script from the site http://detectmobilebrowser.com/ was used .

Opportunities


Mobile version does not fully implement the functionality of the standard version. Here is a list of available features:


Installation


Everything is as usual for rutorrent plugins: just copy the folder with the plugin to the rutorrent \ plugins \ folder.

If you want to delete torrents along with the data, then you also need to install the erasedata plugin, which can be downloaded from the official rutorrent page.
You will also need the _getdir plugin if you want to choose a folder for downloading using the file browser.

Customization


All settings are stored in the file init.js. There are currently only two parameters to change:

1. plugin.enableAutodetect - automatic detection of the browser (mobile or not). If you disable the mobile interface can be enabled only by changing the URL
2. plugin.eraseWithDataDefault - “delete with data”, default value. Three values ​​are possible:
3. plugin.navBarToBottom - the position of the control panel. If true (by default), then below
4. plugin.getDirEnabled - if true (the default) then support for the _getdir plugin is enabled

If the removal of the torrent is disabled in the rutorrent settings, then the mobile version will behave the same. The decision to delete data is made depending on the plugin.eraseWithDataDefault parameter.

Using


If browser auto detection is enabled, the plugin starts working automatically when the page loads. You can also force the mobile version by adding the line "? Mobile = 1" at the end of the address.

UPD:
Rolled out a new update. Now the plugin is no longer beta, but has version 0.9. All innovations could already be tried by those who use the github version and are updated on time. List of changes:


Afterword


In general, the plugin was created primarily for myself, so that I added the functions that are necessary for me, but I am ready to modify the plugin in such a way that it would benefit not only me. In the comments I am waiting for suggestions, error messages and just feedback, but the discussion on the official forum is somehow not going.

Source: https://habr.com/ru/post/152249/


All Articles