Skip to content

Commit

Permalink
Bugfix for folder filter and router.
Browse files Browse the repository at this point in the history
  • Loading branch information
tblock79 committed Sep 26, 2024
1 parent db0fd5b commit 7585551
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dispatch/target_types/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def send_to_target(self, task_id: str, target: FolderTarget, dispatch_info: Task
# send dicoms in source-folder to target folder
new_folder = Path(target.folder) / str(uuid.uuid4())
if target.file_filter:
shutil.copytree(source_folder, new_folder, ignore=shutil.ignore_patterns(target.file_filter))
shutil.copytree(source_folder, new_folder, ignore=shutil.ignore_patterns(*target.file_filter.split(",")))
else:
shutil.copytree(source_folder, new_folder)
(new_folder / ".complete").touch()
Expand Down
3 changes: 2 additions & 1 deletion routing/route_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def push_serieslevel_outgoing(
# Determine if the files should be copied or moved. If only one rule triggered, files can
# safely be moved, otherwise files will be moved and removed in the end
move_operation = False
if len(selected_targets) == 1:
if len(triggered_rules) == 1:
move_operation = True

for i,target in enumerate(selected_targets):
Expand Down Expand Up @@ -519,6 +519,7 @@ def push_serieslevel_outgoing(

operation: Callable
is_operation_move = False

if move_operation:
# If there are more targets for one rule, then move the files only for the last target
if i==len(selected_targets)-1:
Expand Down
4 changes: 2 additions & 2 deletions webinterface/templates/targets/folder-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</div>
</div>
<div class="field">
<label class="label">Filter</label>
<label class="label">Exclusion Filter</label>
<div class="control">
<input name="file_filter" class="input" autocomplete='off' type="text"
placeholder="Filter for filenames (leave empty for none)" value="{% if targets[edittarget]['file_filter'] %}{{targets[edittarget]['file_filter']}}{% endif %}"
placeholder="Filter for files that should be ignored (leave empty for none)" value="{% if targets[edittarget]['file_filter'] %}{{targets[edittarget]['file_filter']}}{% endif %}"
size="15">
</div>
</div>
2 changes: 1 addition & 1 deletion webinterface/templates/targets/folder.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</tr>
{% if targets[x].file_filter %}
<tr>
<td>Filter:</td>
<td>Exclusion Filter:</td>
<td>{{ targets[x].file_filter }}</td>
</tr>
{% endif %}

0 comments on commit 7585551

Please sign in to comment.