@@ -96,13 +96,17 @@ class FilenameCategory(CriterionCategory):
9696 DOESNT_END_WITH_NUMBER = 1
9797 LONGEST = 2
9898 SHORTEST = 3
99+ LONGEST_PATH = 4
100+ SHORTEST_PATH = 5
99101
100102 def format_criterion_value (self , value ):
101103 return {
102104 self .ENDS_WITH_NUMBER : tr ("Ends with number" ),
103105 self .DOESNT_END_WITH_NUMBER : tr ("Doesn't end with number" ),
104106 self .LONGEST : tr ("Longest" ),
105107 self .SHORTEST : tr ("Shortest" ),
108+ self .LONGEST_PATH : tr ("Longest Path" ),
109+ self .SHORTEST_PATH : tr ("Shortest Path" ),
106110 }[value ]
107111
108112 def extract_value (self , dupe ):
@@ -116,6 +120,10 @@ def sort_key(self, dupe, crit_value):
116120 return 0 if ends_with_digit else 1
117121 else :
118122 return 1 if ends_with_digit else 0
123+ elif crit_value == self .LONGEST_PATH :
124+ return len (str (dupe .folder_path )) * - 1
125+ elif crit_value == self .SHORTEST_PATH :
126+ return len (str (dupe .folder_path ))
119127 else :
120128 value = len (value )
121129 if crit_value == self .LONGEST :
@@ -130,6 +138,8 @@ def criteria_list(self):
130138 self .DOESNT_END_WITH_NUMBER ,
131139 self .LONGEST ,
132140 self .SHORTEST ,
141+ self .LONGEST_PATH ,
142+ self .SHORTEST_PATH ,
133143 ]
134144 ]
135145
0 commit comments