transmission-remote-gui / transgui

🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
GNU General Public License v2.0
3.23k stars 281 forks source link

Feature Request: Subfolders in the left panel #1133

Open xruyn opened 6 years ago

xruyn commented 6 years ago

It would be nice to do the navigation in folders by subfolders. For example, if there are several torrents that are inside a single folder. In the same folder is another folder, which also has torrents. But all the torrents in the left panel are displayed together. We must share them.

leonsoft-kras commented 6 years ago

how to do it? the program displays the information of your transmission.

evsasha commented 5 years ago

Hello, it's possible.

Example. I have this directories structure:

/data/downloads/Anime
/data/downloads/Films
/data/downloads/Music

Now in transgui right panel i see only last folders:

Anime
Films
Music

Then i want to download some content to subfolders

/data/downloads/Anime/==Sub1
/data/downloads/Anime/==Sub2
/data/downloads/Films/==Sub3
/data/downloads/Films/==Sub4

Now in right panel i see somthing like tree:

Anime
==Sub1
==Sub2
Films
==Sub3
==Sub4
Music

They will go in right order. Any torrent have Location atribute with full path to content, for example: /data/downloads/Anime/=Sub1/Naruto

Thus, you can count the segments in the path and display a subfolder with a slight offset to the right of the main folder.

/data/downloads/Anime/
/data/downloads/Anime/=Sub1/
Anime
   Sub1
   Sub2
Films
   Sub3
   Sub4
Music
evsasha commented 5 years ago

I'm new to pascal. This is an example of what I mean:

Uses
  SysUtils;
Const torrentsCount = 6;  
Var
  Paths: array [1..torrentsCount] of String;
  Depths: array[1..torrentsCount] of integer;
  i,j:integer;
  relativeDepth,minDepth:integer;
  dir,spacer:string;

function count(s : string; c : char) : byte;
var k, i : byte;
begin
  k := 0;
  for i := 1 to length(s) do
    if s[i] = c then inc(k);
  count := k
end;

Begin 

  spacer := '  ';

  Paths[1] := '/main/anime/naruto.avi';
  Paths[2] := '/main/anime/sub1/totoro.avi';
  Paths[3] := '/main/anime/sub2/bleach.avi';
  Paths[4] := '/main/movie/avatar.avi';
  Paths[5] := '/main/movie/sub1/movie43.avi';
  Paths[6] := '/main/movie/sub2/scarymovie.avi';

  // Test
  Writeln('Full paths to files:');
  for i := 1 to length(Paths) do begin
      writeln(Paths[i]);
  end;

  // Test
  Writeln('Full paths to dirs:');
  for i := 1 to length(Paths) do begin
      writeln(ExtractFileDir(Paths[i]));
  end;

  // Test
  Writeln('Files list:');
  for i := 1 to length(Paths) do begin
      writeln(ExtractFileName(Paths[i]));
  end;

  // Get all Depths
  for i := 1 to length(Paths) do begin
      Depths[i] := count(ExtractFileDir(Paths[i]),'/');
  end;

  // Get minDepth
  minDepth := Depths[1];
  for i := 1 to length(Depths) do begin
    if Depths[i]<minDepth then minDepth:=Depths[i]
  end;
  Writeln('minDepth: ',minDepth);

  Writeln('Directories with depth:');
  for i := 1 to length(Paths) do begin
      dir := ExtractFileName(ExtractFileDir(Paths[i]));
      relativeDepth := Depths[i] - minDepth;
      if relativeDepth <> 0 then begin
        for j := 1 to relativeDepth do
          Write(spacer);
        Write('â””');
      end;
      Writeln(dir);

End.  

UPD. Output:

anime
  â””sub1
  â””sub2
movie
  â””sub1
  â””sub2
leonsoft-kras commented 5 years ago

TRGUI displays the information of your transmission (Web interface transmission). In my opinion this is a useless idea.

evsasha commented 5 years ago
  1. TRGUI displays the information of your transmission (Web interface transmission). In my opinion this is a useless idea.

This is not true. You form a flat list from paths for grouping by directories on the side of TRGUI:

main.pas --> string 6075
main.lfm --> string 2469

2. Workaround with subdirectory naming (starts with =) is very useful for big torrents collection. Why dont implement this feature in a code?

leonsoft-kras commented 5 years ago

We are waiting for your code changes. If the code will work - we will add to this project.

evsasha commented 5 years ago

Hi, I done as said above: https://github.com/evsasha/transgui/tree/issue-1133

It works, but:

But it's working idea. Maybe i should just change the icon for subdirectories, but I don’t mean where it can be done. Can u give me some help with it?

I did not understand what do this piece of code works: lvFilter.Items [-1, j]: = UTF8Decode (Paths [i]);

evsasha commented 5 years ago

Colleagues, I had a try to demonstrated the conceptual potential of working with subdirectories, but I do not have enough experience to implement this idea. If you can continue to work on this idea, the whole community will benefit.

leonsoft-kras commented 5 years ago

Thanks. Not all ideas are interesting. Not all improvements have enough time.

Nerdy314159265 commented 5 years ago

I'd like to +1 this and add the ability to hide torrents by folder/subfolder. For people like me who like to help out open source projects by seeding multiple versions for multiple systems, it'd be nice to have a way to organize and hide my big collection of Debian ISOs or LibreOffice installers.