remove duplicate files
This commit is contained in:
@@ -7021,3 +7021,361 @@ _**User**_
|
||||
|
||||
---
|
||||
|
||||
_**Agent (model default, mode Agent)**_
|
||||
|
||||
|
||||
The function is stripping the first underscore-separated part regardless of whether it's a blendfile prefix. It's removing descriptors like "Loafers_", "Black_", "BlueJeans_", "BluePolo_", "Scrub_", "Work_", "Cargo_" that should remain.
|
||||
|
||||
We should only strip known blendfile prefixes (e.g., "Demarco_", "Chan_", "Joe_", "Dennis_", "Kirk_", "Martha_", "Hailey_", "Regina_", "Manny_"). Updating the function to check against a list of valid blendfile prefixes:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Checking how blendfile folders are identified to build a list of valid prefixes:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating the function to only strip known blendfile prefixes. Building the list from the blendfile folder names and passing it to the function:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating the function to only strip known blendfile prefixes. Modifying `Get-FileNameWithoutPrefix` to accept a list of valid prefixes and updating the calls:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "d56bed0f-1611-4026-b349-1367f22a00f5"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating `Process-DuplicateGroup` to accept and use the valid prefixes list:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating `Process-DuplicateGroup` to accept and use the valid prefixes:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "7e9cab73-2e6a-4c51-aa15-d9ddc71f8fb2"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating calls to `Get-FileNameWithoutPrefix` within `Process-DuplicateGroup`:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "50bf96a9-7c22-49e2-b1f6-6ee8fa110e7b"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Building the list of valid prefixes before Pass 2 and passing it to `Process-DuplicateGroup`:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "67686096-d013-4c0a-bf48-a813ecc99452"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating the Pass 2 call to `Process-DuplicateGroup` to pass the valid prefixes:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating the call to include the valid prefixes:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "2bd83a67-0dd8-46fc-9588-07244da0e8a3"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
The script now:
|
||||
|
||||
1. Builds a list of valid blendfile prefixes from the folder names (Chan, Demarco, Dennis, Joe, Kirk, Martha, Hailey, Regina, Manny, etc.)
|
||||
2. Only strips prefixes that are in this list
|
||||
3. Leaves other prefixes like "Scrub_", "Work_", "Cargo_", "Black_", "BlueJeans_", "BluePolo_", "Loafers_" intact since they're part of the actual filename, not blendfile prefixes
|
||||
|
||||
The changes:
|
||||
- Updated `Get-FileNameWithoutPrefix` to accept a `$ValidPrefixes` parameter and only strip prefixes in that list
|
||||
- Updated `Process-DuplicateGroup` to accept and pass `$ValidPrefixes`
|
||||
- Build the list of valid prefixes from blendfile folder names before Pass 2
|
||||
- Pass the valid prefixes when calling `Process-DuplicateGroup` with `-StripPrefix`
|
||||
|
||||
When you run the script, it will only strip actual blendfile prefixes (e.g., "Demarco_", "Chan_") and preserve other prefixes that are part of the filename (e.g., "Loafers_", "Black_", "Scrub_").
|
||||
|
||||
---
|
||||
|
||||
_**User**_
|
||||
|
||||
@pwsh (358-1075) that's a good result! next, we need to remove the duplicates subfolders, since that was only for debugging purposes. duplicates should be removed outright, because they're replaced by the common file (that's the point; saves space)
|
||||
|
||||
---
|
||||
|
||||
_**Agent (model default, mode Agent)**_
|
||||
|
||||
|
||||
Updating the script to delete duplicate files instead of moving them to a duplicates folder. Removing duplicates folder creation and updating the logic:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||
<details><summary>Tool use: **read_file_v2** • Read file: a:\1 Amazon_Active_Projects\3 ProjectStructure\organize_textures.ps1</summary>
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Updating `Process-DuplicateGroup` to delete duplicates instead of moving them:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "2666bd10-59d4-4d2b-be5e-cb4f437c6266"
|
||||
}
|
||||
```
|
||||
Status: **completed**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Replacing the code that moves duplicates with code that deletes them:
|
||||
|
||||
|
||||
---
|
||||
|
||||
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
|
||||
<details>
|
||||
<summary>Tool use: **edit_file_v2**</summary>
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"relativeWorkspacePath": "a:\\1 Amazon_Active_Projects\\3 ProjectStructure\\organize_textures.ps1"
|
||||
}
|
||||
```
|
||||
Additional data:
|
||||
|
||||
```json
|
||||
{
|
||||
"codeblockId": "4847ba4f-4666-4d56-9eb5-fc4ea2aaabab"
|
||||
}
|
||||
```
|
||||
Status: **loading**
|
||||
|
||||
|
||||
</details>
|
||||
</tool-use>
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user