@@ -146,14 +146,18 @@ def filter_sets(
146146 yield from [x for x in set_list if x .username not in priority_usernames ]
147147
148148
149- def get_creator_rank (priority_usernames : list [str ], creator : str | None ) -> int :
149+ def get_creator_rank (
150+ priority_usernames : list [str ], excluded_usernames : list [str ], creator : str | None
151+ ) -> int :
150152 if creator and creator in priority_usernames :
151153 return priority_usernames .index (creator )
154+ if creator and creator in excluded_usernames :
155+ return DEFAULT_CREATOR_RANK * 2
152156 return DEFAULT_CREATOR_RANK
153157
154158
155159def find_matching_file (
156- set_data : ShowSet | CollectionSet | MovieSet , file_type : FileType , id_value : int
160+ set_data : ShowSet | CollectionSet | MovieSet , file_type : FileType , id_value : int | str
157161) -> File | None :
158162 for f in set_data .files :
159163 if f .file_type == file_type and any (
@@ -170,6 +174,7 @@ def determine_action( # noqa: PLR0911
170174 set_data : ShowSet | CollectionSet | MovieSet ,
171175 file : File ,
172176 priority_usernames : list [str ],
177+ excluded_usernames : list [str ],
173178 force : bool ,
174179) -> Action :
175180 if force :
@@ -178,9 +183,15 @@ def determine_action( # noqa: PLR0911
178183 return Action .DOWNLOAD
179184
180185 existing_rank = get_creator_rank (
181- priority_usernames = priority_usernames , creator = existing .creator
186+ priority_usernames = priority_usernames ,
187+ excluded_usernames = excluded_usernames ,
188+ creator = existing .creator ,
189+ )
190+ new_rank = get_creator_rank (
191+ priority_usernames = priority_usernames ,
192+ excluded_usernames = excluded_usernames ,
193+ creator = set_data .username ,
182194 )
183- new_rank = get_creator_rank (priority_usernames = priority_usernames , creator = set_data .username )
184195
185196 if new_rank > existing_rank :
186197 return Action .SKIP
@@ -198,13 +209,14 @@ def determine_action( # noqa: PLR0911
198209def process_image ( # noqa: PLR0911
199210 obj : Show | Season | Episode | Collection | Movie ,
200211 cache_key : CacheKey ,
201- id_value : int ,
212+ id_value : int | str ,
202213 parent : str ,
203214 filename : str ,
204215 set_data : ShowSet | CollectionSet | MovieSet ,
205216 mediux : Mediux ,
206217 service : BaseService ,
207218 priority_usernames : list [str ],
219+ excluded_usernames : list [str ],
208220 should_log : bool ,
209221 kometa_integration : bool = False ,
210222 force : bool = False ,
@@ -226,6 +238,7 @@ def process_image( # noqa: PLR0911
226238 set_data = set_data ,
227239 file = file ,
228240 priority_usernames = priority_usernames ,
241+ excluded_usernames = excluded_usernames ,
229242 force = force ,
230243 )
231244 if action is Action .SKIP :
@@ -288,6 +301,7 @@ def process_entry_images(
288301 mediux : Mediux ,
289302 service : BaseService ,
290303 priority_usernames : list [str ],
304+ excluded_usernames : list [str ],
291305 should_log : bool ,
292306 kometa_integration : bool = False ,
293307 force : bool = False ,
@@ -305,6 +319,7 @@ def process_entry_images(
305319 mediux = mediux ,
306320 service = service ,
307321 priority_usernames = priority_usernames ,
322+ excluded_usernames = excluded_usernames ,
308323 kometa_integration = kometa_integration ,
309324 force = force ,
310325 should_log = should_log ,
@@ -318,6 +333,7 @@ def process_show_data(
318333 mediux : Mediux ,
319334 service : BaseService ,
320335 priority_usernames : list [str ],
336+ excluded_usernames : list [str ],
321337 force : bool = False ,
322338 kometa_integration : bool = False ,
323339) -> None :
@@ -328,6 +344,7 @@ def process_show_data(
328344 mediux = mediux ,
329345 service = service ,
330346 priority_usernames = priority_usernames ,
347+ excluded_usernames = excluded_usernames ,
331348 kometa_integration = kometa_integration ,
332349 force = force ,
333350 should_log = should_log ,
@@ -354,6 +371,7 @@ def process_show_data(
354371 mediux = mediux ,
355372 service = service ,
356373 priority_usernames = priority_usernames ,
374+ excluded_usernames = excluded_usernames ,
357375 kometa_integration = kometa_integration ,
358376 force = force ,
359377 should_log = should_log ,
@@ -385,6 +403,7 @@ def process_show_data(
385403 mediux = mediux ,
386404 service = service ,
387405 priority_usernames = priority_usernames ,
406+ excluded_usernames = excluded_usernames ,
388407 kometa_integration = kometa_integration ,
389408 force = force ,
390409 should_log = should_log ,
@@ -397,6 +416,7 @@ def process_collection_data(
397416 mediux : Mediux ,
398417 service : BaseService ,
399418 priority_usernames : list [str ],
419+ excluded_usernames : list [str ],
400420 force : bool = False ,
401421 kometa_integration : bool = False ,
402422) -> None :
@@ -407,6 +427,7 @@ def process_collection_data(
407427 mediux = mediux ,
408428 service = service ,
409429 priority_usernames = priority_usernames ,
430+ excluded_usernames = excluded_usernames ,
410431 kometa_integration = kometa_integration ,
411432 force = force ,
412433 should_log = should_log ,
@@ -434,6 +455,7 @@ def process_collection_data(
434455 mediux = mediux ,
435456 service = service ,
436457 priority_usernames = priority_usernames ,
458+ excluded_usernames = excluded_usernames ,
437459 kometa_integration = kometa_integration ,
438460 force = force ,
439461 should_log = should_log ,
@@ -446,6 +468,7 @@ def process_movie_data(
446468 mediux : Mediux ,
447469 service : BaseService ,
448470 priority_usernames : list [str ],
471+ excluded_usernames : list [str ],
449472 force : bool = False ,
450473 kometa_integration : bool = False ,
451474) -> None :
@@ -456,6 +479,7 @@ def process_movie_data(
456479 mediux = mediux ,
457480 service = service ,
458481 priority_usernames = priority_usernames ,
482+ excluded_usernames = excluded_usernames ,
459483 kometa_integration = kometa_integration ,
460484 force = force ,
461485 should_log = should_log ,
0 commit comments