@@ -17,7 +17,6 @@ def __init__(
1717 self ,
1818 path : str | os .PathLike ,
1919 machine_config : dict ,
20- skip_existing_processing : bool = False ,
2120 ):
2221 super ().__init__ ()
2322 self ._basepath = Path (path )
@@ -30,7 +29,6 @@ def __init__(
3029 )
3130 # Toggleable settings
3231 self ._analyse = True
33- self ._skip_existing_processing = skip_existing_processing
3432 self ._stopping = False
3533
3634 def start (self ):
@@ -61,21 +59,14 @@ def _handle_metadata(self, directory: Path, extra_directory: str):
6159 )
6260 self ._seen_dirs .append (directory )
6361
64- def _handle_fractions (self , directory : Path , first_loop : bool ):
62+ def _handle_fractions (self , directory : Path ):
6563 processing_started = False
6664 for d02 in directory .glob ("Images-Disc*" ):
6765 if d02 not in self ._seen_dirs :
68- # If 'skip_existing_processing' is set, do not process for
69- # any data directories found on the first loop.
70- # This allows you to avoid triggering processing again if Murfey is restarted
7166 self .notify (
7267 d02 ,
7368 remove_files = True ,
74- analyse = (
75- not (first_loop and self ._skip_existing_processing )
76- if self ._analyse
77- else False
78- ),
69+ analyse = self ._analyse ,
7970 tag = "fractions" ,
8071 )
8172 self ._seen_dirs .append (d02 )
@@ -88,17 +79,12 @@ def _handle_fractions(self, directory: Path, first_loop: bool):
8879 ):
8980 self .notify (
9081 directory ,
91- analyse = (
92- not (first_loop and self ._skip_existing_processing )
93- if self ._analyse
94- else False
95- ),
82+ analyse = self ._analyse ,
9683 tag = "fractions" ,
9784 )
9885 self ._seen_dirs .append (directory )
9986
10087 def _process (self ):
101- first_loop = True
10288 while not self ._stopping :
10389 for d in self ._basepath .glob ("*" ):
10490 if d .name in self ._machine_config ["create_directories" ]:
@@ -133,18 +119,14 @@ def _process(self):
133119 self ._handle_fractions (
134120 sample .parent .parent .parent
135121 / f"{ sample .parent .name } _{ sample .name } " ,
136- first_loop ,
137122 )
138123
139124 else :
140125 if d .is_dir () and d not in self ._seen_dirs :
141126 self ._handle_metadata (
142127 d , extra_directory = f"metadata_{ d .name } "
143128 )
144- self ._handle_fractions (d .parent .parent / d .name , first_loop )
145-
146- if first_loop :
147- first_loop = False
129+ self ._handle_fractions (d .parent .parent / d .name )
148130 time .sleep (15 )
149131
150132 self .notify (final = True )
0 commit comments