Opened 7 years ago

Last modified 5 years ago

#5385 assigned Enhancement

Add grouping option to libtransmission/web interface

Reported by: trisooma Owned by: jordan
Priority: Normal Milestone: 3.00
Component: libtransmission Version: 2.80
Severity: Normal Keywords: grouping
Cc:

Description

this ticket may seem a duplicate of #2175, but it is more complete.

  • applying a group to a download will survive restarts (ie. it is saved in resume file)
  • users can customise their groups through config (transmission-daemon/settings.json)
  • a default group can be set through config (transmission-daemon/settings.json)
  • default group can be modified through web interface
  • web interface displays group by means of coloured block in torrent rows
  • in web interface group can be modified through contextmenu
  • 'On Torrent Completion' script is called with extra param 'TR_TORRENT_GROUP'

Attachments (9)

libtransmission_14096_add_downloadGroup.patch (24.5 KB) - added by trisooma 7 years ago.
changes for libtransmission against r14096
web_14096_add_downloadGroup.patch (19.3 KB) - added by trisooma 7 years ago.
changes for web against r14096
web_14096_groupSearch.patch (10.6 KB) - added by dmitriy 7 years ago.
Add download group filter, color sign in the compact mode, and link instead a text in the comment field of a torrent
web_14096_groupSearch_and_prefs.patch (20.0 KB) - added by dmitriy 7 years ago.
an update of my previous patch
libtransmission_14096_add_downloadGroup_v2.patch (24.6 KB) - added by trisooma 7 years ago.
toolbar-group.png (958 bytes) - added by trisooma 7 years ago.
fullPatch_14096.tar.bz2 (33.9 KB) - added by trisooma 7 years ago.
libtransmission_14328_add_downloadGroup.patch (24.4 KB) - added by trisooma 6 years ago.
web_14328_add_downloadGroup.patch (44.0 KB) - added by trisooma 6 years ago.

Download all attachments as: .zip

Change History (26)

Changed 7 years ago by trisooma

changes for libtransmission against r14096

Changed 7 years ago by trisooma

changes for web against r14096

comment:1 Changed 7 years ago by jordan

  • Milestone changed from None Set to 2.90
  • Version changed from 2.77+ to 2.80

comment:2 Changed 7 years ago by jordan

  • Status changed from new to assigned

Changed 7 years ago by dmitriy

Add download group filter, color sign in the compact mode, and link instead a text in the comment field of a torrent

comment:3 Changed 7 years ago by dmitriy

Hi colleagues,

I've modified the code of "web_14096_add_downloadGroup.patch​" and the submitted patch will bring 3 changes: downloadGroup filter, color mark in the compact mode, and, what's userful for me, if a torrent comment looks like a link, it will appear as a link.

the "download-groups" section should be changed to this format to make changes work.

    "download-groups": [
        ["Movies","#809fff"],
        ["Music11","#9fff80"]
    ],

to be honest, this is a point to discuss - even the format of "download-groups" section is ok, it would be good to have 3rd element in each of these subarrays - code of the group, which meantime is just a filtered name: "Music11".strtolower.replace(/ /,'-').replace('/[!a-z\-]/',)...

Thank you, D

comment:4 Changed 7 years ago by trisooma

I think it would be best to use three subitems, like so:

    "download-groups": [
        ["Movies","#809fff",1],
        ["Music","#9fff80",2]
    ],

There is really no point in 'encoding' the id into the name field. BTW. your patch seems to work fine with the layout above in settings.json.

Changed 7 years ago by dmitriy

an update of my previous patch

comment:5 Changed 7 years ago by dmitriy

I think it would be best to use three subitems

Absolutely agree. The recently committed patch "web_14096_groupSearch_and_prefs.patch", against your "web_14096_add_downloadGroup.patch​", is an update, which brought, except already mentioned changes, some new ones:

  • operating properly with 3 subitems
  • correct sort orders at all necessary places (exactly as groups are orders in the settings)
  • draft of groups' management tab in the preferences:
  1. change order
  2. add new group at any place
  3. remove groups (and ability to restore until they are not committed)
  4. change group name, color and code. color is applied on onBlur event
  5. some related draft checks

It works with...

     "download-groups": [
         ["Movies","#809fff",1],
         ["Music","#9fff80",2]
     ],

..as well as with...

     "download-groups": [
         ["Movies","#809fff","movies"],
         ["Watched Movies","#809f00","wmovies"],
         ["Music","#9fff80","music"],
         ["Fresh Music","#00ff80","fmusic"],
     ],

This schema shows a bug/feature of usage: in case we select "Movies", "Movies" and "Watched Movies" torrents would be shown coz "movies" is a substring of "wmovies".


TODO: 1.1. the RPC daemon replies "success" on the request, but does not save the data. And here I need help to solve this.

		var o = {};
		o['download-groups'] = newValue;
		data.remote.savePrefs(o); 

1.2. The changing of torrents' groups are not saved in resume files. It happens only when a torrent is changing its status (f.e. "resume" -> "pause")

2.1. The table-based group preferences. Should they need to be DIV-based? 2.2. The text-based management elements: up/down arrows,add/restore/remove. icons are required. 2.3. The external lib for more comfortable color selection? 2.4. A way to show errors of the group's management. Meantime "console.log" output (function onControlClickGroupUpdate) 2.5. I think it would be very convenient if the group can be set from the top large-icon menu. An icon is required. 2.6. Usage of group's color in the right-side area (with torrent details) 2.7. And the last one - a way to order torrents: alphabetically or by groups and then alphabetically. IMO, a checkbox/drop-down in the "Groups" tab of the Preference would be enough.

That's all for today. Thank you for reading.

Changed 7 years ago by trisooma

Changed 7 years ago by trisooma

comment:6 Changed 7 years ago by trisooma

attached files: fullPatch_14096.tar.bz2, toolbar-group.png (path: web/style/transmission/images/toolbar-group.png)

1.1: works 1.2: works (torrent is set to dirty, saved upon exit)

2.1: done 2.2: done, used icons from (existing) jquery-ui 2.3: chosen spectrum (http://bgrins.github.io/spectrum/) 2.4: done, not most elegant but might suffice 2.5: done, icon taken from https://www.iconfinder.com/icons/92564/category_group_icon (attributed as CC 3.0) 2.6: done

@dmitriy: as for 2.7, if you need/want sorting, please create another ticket. I would like to see this go with the planned release. This is (as I see it) beyond the scope of grouping.

P.S.: the third field in download-groups should not be shown in interface as it currently serves no purpose. It *should* be removed (prefs-dialog.js::263) by changing 'dislay -> 'display'; or removing the whole line and setting common.css:388 to with:60%.

comment:7 Changed 7 years ago by mike.dld

Dmitriy's patch conflicts with #5620, let's remove the change (link in comments) here and discuss it there.

comment:8 follow-up: Changed 7 years ago by cfpp2p

Dmitriy patch affecting comment field is vulnerable to cross site scripting. Additionally patch of #5620 is also vulnerable to cross site scripting. See my comment and test torrent attached at #5620 (as to not repeat entirety here).

Changed 6 years ago by trisooma

Changed 6 years ago by trisooma

comment:9 in reply to: ↑ 8 Changed 6 years ago by trisooma

Replying to cfpp2p:

Dmitriy patch affecting comment field is vulnerable to cross site scripting. Additionally patch of #5620 is also vulnerable to cross site scripting. See my comment and test torrent attached at #5620 (as to not repeat entirety here).

Ok, finally got round to fixing this properly. I attached patches (against r14328) with all the above enhancements except the changes to the comment field. I also removed the 3rd field from the config and prefs-dialog.

(See: libtransmission_14328_add_downloadGroup.patch and web_14328_add_downloadGroup.patch)

comment:10 follow-up: Changed 6 years ago by mr_dj

Was this not included in r14329 ?

I built from source hoping to take advantage of this in the daemon, everything is running well but I don't see anything relevant to download groups.

comment:11 in reply to: ↑ 10 Changed 6 years ago by x190

Replying to mr_dj:

Was this not included in r14329 ?

I built from source hoping to take advantage of this in the daemon, everything is running well but I don't see anything relevant to download groups.

You need to add the patch yourself.

comment:12 follow-up: Changed 5 years ago by Balor

I took the liberty to update the patch for r14554

Unfortunately I can't attach it here (it give me a 500 Internal Server error).

Here is the gist : https://gist.github.com/Belphemur/721a73200764388f0fc5

Edit: I had to correct the patch when it set the TR_TORRENT_GROUP env-var for launching a script. There is an assert just after that want the var to be set in ASC order. I changed where the var was set to follow the wanted order.

Last edited 5 years ago by Balor (previous) (diff)

comment:13 in reply to: ↑ 12 Changed 5 years ago by cfpp2p

Replying to Balor:

I took the liberty to update the patch for r14554

Thanks...

comment:14 Changed 5 years ago by cfpp2p

Balor's update of the patch works well in the web client but every group and color must be reset each time the daemon is restarted for group preferences to be correctly available.

http://transmissionbt.net/group-colors.JPG

http://transmissionbt.net/group-prefs.JPG

In settings.json if you add your own download-groups make sure to format the correct number of spaces and comma or the daemon might not start correctly.

    "download-group-default": "Movies_&_TV-series", 
    "download-groups": [
        "Movies", 
        "Music", 
        "Software"
    ], 

comment:15 follow-up: Changed 5 years ago by Balor

I thought I corrected this problem in the webclient.

In the settings.json, the patch need a different structure for the download-groups to work perfectly fine directly:

   "download-group-default": "others",
    "download-groups": [
        [
            "Movies",
            "#8383d8"
        ],
        [
            "Music",
            "#cc0000"
        ],
        [
            "Series",
            "#e771e7"
        ],
        [
            "Others",
            "#4c1130"
        ],
        [
            "Animes",
            "#802614"
        ]
    ],

The # represent the HEX code of the color.

comment:16 in reply to: ↑ 15 Changed 5 years ago by cfpp2p

Replying to Balor:

I thought I corrected this problem in the webclient.

In the settings.json, the patch need a different structure for the download-groups to work perfectly fine directly:

Yes, that worked. Thanks.

http://transmissionbt.net/group-co.JPG

comment:17 Changed 5 years ago by mike.dld

  • Milestone changed from 2.90 to 3.00
Note: See TracTickets for help on using tickets.