Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#4845 closed Enhancement (duplicate)

Magnet links don't respect automatic grouping based on filenames

Reported by: evands Owned by:
Priority: Normal Milestone: None Set
Component: Mac Client Version: 2.50
Severity: Normal Keywords:
Cc:

Description

When adding a magnet link (especially remotely via the web interface), I'd like for my autogroup settings (which I use to route the downloaded files to appropriate places) to still work. For example, I have a grouping of 'music' which includes file extension criteria (mp3, aac, etc) and sends the downloaded files to iTunes.

When the metadata is retrieved, we could check the newly obtained file list and make a change as needed. Something like this (untested) change:

Index: macosx/Torrent.m
===================================================================
--- macosx/Torrent.m	(revision 13257)
+++ macosx/Torrent.m	(working copy)
@@ -1869,6 +1869,16 @@
     
     [self createFileList];
     
+	if ([self groupValue] == -1)
+		[self setGroupValue:[[GroupsController groups] groupIndexForTorrent: self]];
+
+	//change the location if the group calls for it and it's not already set
+	if (!tr_torrentGetCurrentDir(fHandle) && [[GroupsController groups] usesCustomDownloadLocationForIndex: [self groupValue]])
+	{
+		NSString *location = [[GroupsController groups] customDownloadLocationForIndex: [self groupValue]];
+		[self changeDownloadFolderBeforeUsing: location];
+	}
+	
     [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self];
 }

Would that be okay / desirable? If so, I'll be happy to test it, clean it up, and submit a patch. Don't want to waste my time if there's an philosophical or architectural reason this is a Bad Idea.

Change History (2)

comment:1 Changed 11 years ago by livings124

  • Component changed from Transmission to Mac Client
  • Resolution set to duplicate
  • Status changed from new to closed
  • Type changed from Bug to Enhancement

This is a duplicate of #2794, so I'm going to close this in favor of the existing one. The patch looks pretty good, though. My main concern is that manually-set groups/locations will be lost when it's demagnetized. How do we strike a balance between re-applying groups and respecting user settings?

comment:2 Changed 11 years ago by evands

Oops, sorry for the duplicate. I did search, but Trac search is quite use unless you already know which ticket you're looking for...

I'll put the patch in progress there and continue discuss there as well.

Note: See TracTickets for help on using tickets.