Compare commits

...

2 Commits

Author SHA1 Message Date
Raincloud 11ea28a187 nascleanup + autoThumbs: flatten indexer layout, SMB rm, recursive tmp 2026-03-21 15:41:59 -06:00
Raincloud 2de53c9685 specst update 2026-03-21 13:01:18 -06:00
20 changed files with 83112 additions and 50 deletions
+1 -22
View File
@@ -1,22 +1 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.sh text eol=lf
+79
View File
@@ -0,0 +1,79 @@
# SpecStory CLI Configuration
#
# This is the project-level config file for SpecStory CLI.
# All settings here apply to this project unless overridden by CLI flags.
#
# Uncomment (remove the #) the line and edit any setting below to change the default behavior.
# For more information, see: https://docs.specstory.com/integrations/terminal-coding-agents/usage
[local_sync]
# Write markdown files locally. (default: true)
# enabled = false # equivalent to --only-cloud-sync
# Custom output directory for markdown files.
# Default: ./.specstory/history (relative to the project directory)
# output_dir = "~/.specstory/history" # equivalent to --output-dir "~/.specstory/history"
# Use local timezone for file name and content timestamps (default: false, UTC)
# local_time_zone = true # equivalent to --local-time-zone
[cloud_sync]
# Sync session data to SpecStory Cloud. (default: true, when logged in to SpecStory Cloud)
# enabled = false # equivalent to --no-cloud-sync
[logging]
# Write logs to .specstory/debug/debug.log (default: false)
# log = true # equivalent to --log
# Debug-level output, requires console or log (default: false)
# debug = true # equivalent to --debug
# Custom output directory for debug data.
# Default: ./.specstory/debug (relative to the project directory)
# debug_dir = "~/.specstory/debug" # equivalent to --debug-dir "~/.specstory/debug"
# Error/warn/info output to stdout (default: false)
# console = true # equivalent to --console
# Suppress all non-error output (default: false)
# silent = true # equivalent to --silent
[version_check]
# Check for new versions of the CLI on startup.
# Default: true
# enabled = false # equivalent to --no-version-check
[analytics]
# Send anonymous product usage analytics to help improve SpecStory.
# Default: true
# enabled = false # equivalent to --no-usage-analytics
[telemetry]
# OTLP gRPC collector endpoint (e.g., "localhost:4317" or "http://localhost:4317")
# endpoint = "localhost:4317"
# Override the default service name (default: "specstory-cli")
# service_name = "my-service-name"
# Include user prompt text in telemetry spans (default: true)
# prompts = false
[providers]
# Agent execution commands by provider (used by specstory run)
# Pass custom flags (e.g. claude_cmd = "claude --allow-dangerously-skip-permissions")
# Use of these is equivalent to -c "custom command"
# Claude Code command
# claude_cmd = "claude"
# Codex CLI command
# codex_cmd = "codex"
# Cursor CLI command
# cursor_cmd = "cursor-agent"
# Droid CLI command
# droid_cmd = "droid"
# Gemini CLI command
# gemini_cmd = "gemini"
@@ -0,0 +1,36 @@
<!-- Generated by SpecStory, Markdown v2.1.0 -->
# 2025-06-26 05:09:29Z
<!-- cursoride Session bf60059a-99db-46ab-b41e-48e31321c636 (2025-06-26 05:09:29Z) -->
_**Agent (2025-06-26 05:14:17Z)**_
Yes, you can use the thumbnails (thumbs) you've generated for your `.blend` files, even if Blender itself doesn't generate or update them as you want. Heres how it works and what you can do:
### Why Blender Thumbnails Sometimes Dont Work
- Blender only generates thumbnails for `.blend` files under certain conditions (like saving with a camera view, or with the right settings).
- Sometimes, Windows Explorer or other file managers dont update or show these thumbnails correctly.
### Using Your Own Thumbnails
If you have your own PNG or JPG images that you want to use as thumbnails for your `.blend` files, you can manually set them in Windows. However, Windows does not natively support custom thumbnails for arbitrary file types like `.blend`. But you have a few options:
#### 1. Thumbnail Overlay Tools
There are third-party tools (like **SageThumbs**, **Icaros**, or **CustomExplorerThumbnail**) that let you assign custom thumbnails to files, including `.blend` files.
#### 2. Folder Thumbnails
If you want to visually organize your folders, you can set a folders thumbnail to one of your images:
- Right-click the folder → Properties → Customize → Choose File (under Folder pictures).
#### 3. Preview Images in File Explorer
If you want to see a preview of your `.blend` file, you can:
- Keep a PNG/JPG with the same name as the `.blend` file in the same folder for easy reference.
- Use a file manager that supports side-by-side preview (like **Directory Opus** or **XYplorer**).
#### 4. Custom Scripts (Advanced)
You can write a script to generate a Windows shortcut (`.lnk`) for each `.blend` file, and set the shortcuts icon to your custom image. This is a workaround, but not a true thumbnail.
---
**Summary:**
You cant natively set custom thumbnails for `.blend` files in Windows Explorer, but you can use third-party tools or keep your generated thumbs alongside your `.blend` files for easy reference. If you want a script to automate any of these processes, let me know!
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,260 @@
<!-- Generated by SpecStory, Markdown v2.1.0 -->
# 2025-09-28 20:12:08Z
<!-- cursoride Session fbeac01b-6975-4183-b688-1ea10fb52994 (2025-09-28 20:12:08Z) -->
_**User (2025-09-28 20:12:05Z)**_
Wtf is this shit. I have the sync mode set to turn off on demand sync, which should DISABLE thumbnailing. I think the synology drive client app updating reset registry changes or something? let's fix them. context: @2025-06-26_04-09Z-fixing-thumbnail-issues-for-video-formats.md @2025-06-26_05-09Z-using-custom-thumbnails-for-blend-files.md @2025-06-26_05-53Z-using-generated-thumbnails-for-blendfiles.md @2025-06-29_22-31Z-thumbnail-generation-issues-on-network-shares.md @2025-07-01_14-38Z-disabling-sync-destruction-for-local-thumbnails.md
---
_**Agent (gpt-5 2025-09-28 20:12:05Z)**_
<think><details><summary>Thought Process</summary>
**Addressing sync issues**
I need to respond to the user's frustration about fixing registry keys that are affected by the Synology Drive Client app updates. They want to disable on-demand sync or prevent thumbnail overrides. Ill provide step-by-step PowerShell commands to help them re-apply those registry modifications and possibly disable Cloud Files On-Demand for specific sync roots. This involves checking the registry paths and setting the right policies for effective management. It's a bit complicated, but we'll get through it together!
**Examining thumbnail issues**
Im looking into the policies related to disabling File On-Demand for OneDrive, specifically the "UseOneDriveFilesOnDemand" setting; a value of 0 disables it. However, thats just for OneDrive. For third-party providers, Im considering options like "DisableIconOverlayHandler," but Im not sure how it works. The tricky part is addressing the thumbnail overrides caused by the cloud provider. I might explore unregistering the Sync Root or modifying the right registry keys to effectively manage this issue. It's quite complex, but Im here to help!
**Exploring thumbnail handling**
I'm digging into the thumbnail provider for OneDrive, which might be linked to a specific CLSID, like {BBACC218-34EA-4666-9D7A-C78F2274A524} for overlays. OneDrive utilizes the "Cloud Files Shell Extension," with its own CLSID. I could suggest using ShellExView to find and disable the "Thumbnail Handler" specifically for the Synology extension. The user wants registry edits, so Ill guide them through blocking the cloud provider shell extensions by adding the relevant CLSIDs to the Blocked section in the registry. It's a bit intricate, but we'll get it sorted out!
**Considering file type overrides**
Im looking into using per-extension overrides by registering Icaros providers for file types like .webm and .psd in the registry. Icaros supports various file types, and while it seems to work for .psd, the user mentions .webm is only functioning locally and not in the cloud. That could imply differences in provider precedence. I think I should suggest a script to re-apply the overlay removal keys for OneDrive and adjust some policies. We can definitely offer a PowerShell script for these adjustments!
**Planning registry adjustments**
Im exploring options for toggling provider registration. If the app updates, it might re-enable the Sync Root provider. Deregistering the provider by deleting keys under SyncRootManager could disable cloud attributes for Synology Drive, making it operate as a full sync instead of on-demand.
Ill propose commands to remove specified keys, backup registry entries, and restart services to apply these changes efficiently. Along the way, I'll clarify how to ensure the overlay icons and thumbnail issues are resolved. It might feel complex, but Ill keep the steps straightforward and user-friendly!
**Providing Registry Instructions**
Im guiding the user to block Synology's shell extensions using ShellExView. Theyll need to find entries related to Synology, copy the CLSIDs, and then use a command to block them.
The instructions will be concise: stop Synology Drive processes, remove SyncRootManager entries, and clear file attributes to ensure everything is pinned correctly. Restarting Explorer and Synology Drive will help verify that sync still functions properly. Ill craft commands for querying keys and emphasize backing up the registry for safety! Let's keep it focused and straightforward for the user.</details></think>
_**Agent (default)**_
Ill give you concise, safe commands to re-apply the fixes and strip Windows cloud “SyncRoot” so Explorer stops overriding thumbnails.
### 0) Close Explorer and Synology Drive
Run in an elevated PowerShell:
```powershell
taskkill /IM explorer.exe /F
taskkill /IM SynologyDriveClient.exe /F 2>$null
```
### 1) Remove overlay icon handlers (again)
```powershell
# Backup
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers" "$env:TEMP\overlay_backup.reg" /y
# Remove OneDrive + AccExtIco overlays (re-applies your earlier change)
'OneDrive1','OneDrive2','OneDrive3','OneDrive4','OneDrive5','OneDrive6','OneDrive7','OneDrive8','OneDrive9',
'AccExtIco1','AccExtIco2','AccExtIco3','AccExtIco4','AccExtIco5','AccExtIco6','AccExtIco7','AccExtIco8','AccExtIco9' |
% { reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\$_" /f 2>$null }
```
### 2) Completely remove any cloud SyncRoot entries for Synology (kills OnDemand behavior)
```powershell
# Backups
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" "$env:TEMP\SyncRoot_HKLM.reg" /y
reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" "$env:TEMP\SyncRoot_HKCU.reg" /y
# Remove Synology Drive sync-roots (both machine- and user-scope)
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" -Recurse |
Where-Object {$_.Name -match 'Synology|Drive'} | ForEach-Object { Remove-Item -Path $_.PsPath -Recurse -Force }
Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" -Recurse |
Where-Object {$_.Name -match 'Synology|Drive'} | ForEach-Object { Remove-Item -Path $_.PsPath -Recurse -Force }
```
### 3) Ensure OneDrive FilesOnDemand is off (wont harm if you dont use it)
```powershell
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "UseOneDriveFilesOnDemand" -Type DWord -Value 0
```
### 4) Clear Explorer caches (icons + thumbnails)
```powershell
# Icon cache
Remove-Item "$env:LOCALAPPDATA\IconCache.db" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache_*" -Force -ErrorAction SilentlyContinue
# Thumbnail cache
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force -ErrorAction SilentlyContinue
```
### 5) Relaunch Explorer and Synology Drive
```powershell
Start-Process explorer.exe
Start-Process "$env:ProgramFiles\Synology\Drive\SynologyDriveClient.exe" -ErrorAction SilentlyContinue
```
### 6) Verify the folder is no longer a SyncRoot
```powershell
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" -Recurse | ? { $_.Name -match 'Synology|Drive' }
Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" -Recurse | ? { $_.Name -match 'Synology|Drive' }
```
Expected: no output. If entries reappear immediately, the Drive client is re-registering them; re-open its settings and ensure OnDemand is off, then repeat Step 2.
Optional (OneDrive only): if files still show cloud attributes, in that path run:
```powershell
attrib +P -U /S /D
```
If you want, we can also block Synologys cloud shell extension by CLSID to hard-disable its CFAPI hooks; Ill need the CLSID from ShellExView to add it under:
`HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked`.
Summary:
- Removed overlay handlers again, deleted SyncRoot registrations for Synology so Explorer stops treating the folder as “cloud,” cleared caches, and restarted Explorer. This returns thumbnailing control to Windows/Icaros instead of the cloud provider.
---
_**User (2025-09-28 20:23:51Z)**_
how to reset windows icon cache?
---
_**Agent (default 2025-09-28 20:23:51Z)**_
Resetting the Windows icon cache:
## **Method 1: PowerShell (Recommended)**
```powershell
# Stop Explorer
taskkill /IM explorer.exe /F
# Clear icon cache files
Remove-Item "$env:LOCALAPPDATA\IconCache.db" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache_*.db" -Force -ErrorAction SilentlyContinue
# Clear thumbnail cache
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force -ErrorAction SilentlyContinue
# Restart Explorer
Start-Process explorer.exe
```
## **Method 2: Manual File Deletion**
1. **Close all Explorer windows**
2. **Open Task Manager** (Ctrl+Shift+Esc)
3. **End "Windows Explorer" process**
4. **Delete these files:**
- `%LOCALAPPDATA%\IconCache.db`
- `%LOCALAPPDATA%\Microsoft\Windows\Explorer\iconcache_*.db`
- `%LOCALAPPDATA%\Microsoft\Windows\Explorer\thumbcache_*.db`
5. **Restart Explorer** from Task Manager → File → Run new task → `explorer.exe`
## **Method 3: Registry Reset (Advanced)**
```powershell
# Reset icon cache registry entries
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" /f
reg delete "HKCU\Software\Microsoft\Windows\Shell\Bags" /f
reg delete "HKCU\Software\Microsoft\Windows\Shell\BagMRU" /f
```
## **Method 4: Full System Icon Cache Reset**
```powershell
# Stop Explorer
taskkill /IM explorer.exe /F
# Clear all icon-related caches
Remove-Item "$env:LOCALAPPDATA\IconCache.db" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache_*.db" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\*.db" -Force -ErrorAction SilentlyContinue
# Clear system icon cache
Remove-Item "C:\Windows\System32\imageres.dll" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\Windows\System32\shell32.dll" -Force -ErrorAction SilentlyContinue
# Restart Explorer
Start-Process explorer.exe
```
**Note:** Method 4 is aggressive and may require a reboot if system files are in use.
## **Quick One-Liner**
```powershell
taskkill /IM explorer.exe /F; Remove-Item "$env:LOCALAPPDATA\IconCache.db", "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache_*.db", "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force -ErrorAction SilentlyContinue; Start-Process explorer.exe
```
Method 1 is usually sufficient.
---
_**User (2025-09-28 20:23:51Z)**_
this is just infinitely loading. wtf do I do
---
_**Agent (default 2025-09-28 20:23:51Z)**_
If the WebP Image Extension page is stuck loading, try these steps:
## **Quick Fixes:**
### **1. Close and Reopen**
- Close the Microsoft Store
- Reopen it and try again
### **2. Reset Microsoft Store Cache**
```powershell
# Run as Administrator
wsreset.exe
```
### **3. Clear Microsoft Store Cache**
```powershell
# Stop Microsoft Store processes
taskkill /IM Microsoft.WindowsStore.exe /F
taskkill /IM WinStore.App.exe /F
# Clear cache
Remove-Item "$env:LOCALAPPDATA\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalCache\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\TempState\*" -Recurse -Force -ErrorAction SilentlyContinue
# Restart Microsoft Store
Start-Process ms-windows-store:
```
### **4. Alternative Installation Methods**
**Method A: PowerShell**
```powershell
# Install WebP extension via PowerShell
Add-AppxPackage -Path "https://aka.ms/webp-image-extension"
```
**Method B: Direct Download**
- Go to: https://www.microsoft.com/en-us/p/webp-image-extension/9pg2dk419drg
- Click "Get" or "Install"
**Method C: Winget**
```powershell
winget install Microsoft.WebPImageExtension
```
### **5. If All Else Fails**
```powershell
# Reset Microsoft Store completely
Get-AppxPackage Microsoft.WindowsStore | Reset-AppxPackage
```
### **6. Check Network/Firewall**
- Temporarily disable antivirus/firewall
- Try a different network connection
- Check if corporate network blocks Microsoft Store
**Start with Method 1 or 2** — they usually resolve the loading issue.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+103
View File
@@ -0,0 +1,103 @@
{
"sessions": {
"07ffafce-813e-4e79-a85e-ae32dd3296c2": {
"user_message_count": 13,
"agent_message_count": 134,
"start_timestamp": "2025-10-20T00:03:25-06:00",
"end_timestamp": "2025-10-20T00:03:25-06:00",
"markdown_size_bytes": 454904,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"1bad657d-8969-46aa-b58a-7fc642fbc253": {
"user_message_count": 57,
"agent_message_count": 799,
"start_timestamp": "2025-06-29T16:31:39-06:00",
"end_timestamp": "2025-06-29T16:31:39-06:00",
"markdown_size_bytes": 1617012,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"294fe00b-1ac4-4e2b-a667-dd27fb242819": {
"user_message_count": 27,
"agent_message_count": 182,
"start_timestamp": "2025-07-01T22:59:18-06:00",
"end_timestamp": "2025-07-01T22:59:18-06:00",
"markdown_size_bytes": 413220,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"3276573b-bb66-4ef5-a321-45df9590848c": {
"user_message_count": 88,
"agent_message_count": 263,
"start_timestamp": "2025-06-25T23:53:32-06:00",
"end_timestamp": "2025-06-25T23:53:32-06:00",
"markdown_size_bytes": 1148227,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"49129f06-cbff-4811-a885-af41dbc538ba": {
"user_message_count": 9,
"agent_message_count": 78,
"start_timestamp": "2025-10-12T15:53:21-06:00",
"end_timestamp": "2025-10-12T15:53:21-06:00",
"markdown_size_bytes": 100304,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"88555ca4-9c88-4bcf-825f-dd19b19b7145": {
"user_message_count": 33,
"agent_message_count": 323,
"start_timestamp": "2026-03-21T13:01:32-06:00",
"end_timestamp": "2026-03-21T13:01:32-06:00",
"markdown_size_bytes": 297979,
"provider": "cursoride",
"last_updated": "2026-03-21T21:13:55Z"
},
"8a226504-a2e0-4b10-b083-a609486034c7": {
"user_message_count": 8,
"agent_message_count": 188,
"start_timestamp": "2025-11-26T01:47:26-07:00",
"end_timestamp": "2025-11-26T01:47:26-07:00",
"markdown_size_bytes": 191115,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"afcc07b9-7ae3-4b57-9064-c080b95c9028": {
"user_message_count": 11,
"agent_message_count": 37,
"start_timestamp": "2025-06-25T22:09:21-06:00",
"end_timestamp": "2025-06-25T22:09:21-06:00",
"markdown_size_bytes": 38319,
"provider": "cursoride",
"last_updated": "2026-03-21T19:02:43Z"
},
"b90a47f3-3c59-4ca3-a099-690412afaab1": {
"user_message_count": 7,
"agent_message_count": 50,
"start_timestamp": "2025-07-01T08:38:01-06:00",
"end_timestamp": "2025-07-01T08:38:01-06:00",
"markdown_size_bytes": 344495,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"bf60059a-99db-46ab-b41e-48e31321c636": {
"user_message_count": 0,
"agent_message_count": 1,
"start_timestamp": "2025-06-25T23:09:29-06:00",
"end_timestamp": "2025-06-25T23:09:29-06:00",
"markdown_size_bytes": 2221,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
},
"fbeac01b-6975-4183-b688-1ea10fb52994": {
"user_message_count": 3,
"agent_message_count": 4,
"start_timestamp": "2025-09-28T14:12:08-06:00",
"end_timestamp": "2025-09-28T14:12:08-06:00",
"markdown_size_bytes": 12633,
"provider": "cursoride",
"last_updated": "2026-03-21T19:00:53Z"
}
}
}
+3
View File
@@ -0,0 +1,3 @@
{
"specstory.cloudSync.enabled": "never"
}
+43 -4
View File
@@ -34,8 +34,13 @@ set "RELPATH=%WINPATH:~3%"
set "RELPATH=%RELPATH:\=/%"
set "NASPATH=/volume1/Hydra/%RELPATH%"
echo Seeding existing thumbnails on NAS (extract_eadir_to_tmp.sh)...
ssh Hydra "bash -lc '~/extract_eadir_to_tmp.sh \"%NASPATH%\" || true'"
echo Uploading extract_eadir_to_tmp.sh to NAS and seeding...
if not exist "%~dp0extract_eadir_to_tmp.sh" (
echo ERROR: extract_eadir_to_tmp.sh not found next to this batch file.
goto END
)
ssh Hydra "cat > ~/extract_eadir_to_tmp.sh" < "%~dp0extract_eadir_to_tmp.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/extract_eadir_to_tmp.sh; else tr -d \"\r\" < ~/extract_eadir_to_tmp.sh > ~/extract_eadir_to_tmp.sh.tmp && mv ~/extract_eadir_to_tmp.sh.tmp ~/extract_eadir_to_tmp.sh; fi; chmod +x ~/extract_eadir_to_tmp.sh; ~/extract_eadir_to_tmp.sh \"%NASPATH%\" || true'"
REM Run psthumbgen.py
python psthumbgen.py --directory "%WINPATH%"
@@ -58,6 +63,7 @@ echo DEBUG: WINPATH = %WINPATH%
echo DEBUG: RELPATH = %RELPATH%
echo DEBUG: NASPATH = %NASPATH%
echo.
call :WIN_REMOVE_LOCAL_EADIR
REM Ensure nascleanup.sh exists on NAS (upload + fix line endings), then run it
echo Uploading nascleanup.sh to NAS and running cleanup...
if not exist "%~dp0nascleanup.sh" (
@@ -66,6 +72,7 @@ if not exist "%~dp0nascleanup.sh" (
)
ssh Hydra "cat > ~/nascleanup.sh" < "%~dp0nascleanup.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/nascleanup.sh; else tr -d \"\r\" < ~/nascleanup.sh > ~/nascleanup.sh.tmp && mv ~/nascleanup.sh.tmp ~/nascleanup.sh; fi; chmod +x ~/nascleanup.sh; ~/nascleanup.sh \"%NASPATH%\"'"
call :WIN_REMOVE_LOCAL_EADIR_TMP
goto END
:BOTH
@@ -87,12 +94,20 @@ echo DEBUG: NASPATH = %NASPATH%
echo.
REM Pre-seed eaDir_tmp from @eaDir on NAS before generation
echo Seeding existing thumbnails on NAS (extract_eadir_to_tmp.sh)...
ssh Hydra "bash -lc '~/extract_eadir_to_tmp.sh \"%NASPATH%\" || true'"
echo Uploading extract_eadir_to_tmp.sh to NAS and seeding...
if not exist "%~dp0extract_eadir_to_tmp.sh" (
echo ERROR: extract_eadir_to_tmp.sh not found next to this batch file.
goto END
)
ssh Hydra "cat > ~/extract_eadir_to_tmp.sh" < "%~dp0extract_eadir_to_tmp.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/extract_eadir_to_tmp.sh; else tr -d \"\r\" < ~/extract_eadir_to_tmp.sh > ~/extract_eadir_to_tmp.sh.tmp && mv ~/extract_eadir_to_tmp.sh.tmp ~/extract_eadir_to_tmp.sh; fi; chmod +x ~/extract_eadir_to_tmp.sh; ~/extract_eadir_to_tmp.sh \"%NASPATH%\" || true'"
REM Run psthumbgen.py
python psthumbgen.py --directory "%WINPATH%"
REM Clear old @eaDir on the share via SMB (helps when NAS cp hits Permission denied on root-owned dirs)
call :WIN_REMOVE_LOCAL_EADIR
REM SSH cleanup commands (run separately)
REM Ensure nascleanup.sh exists on NAS (upload + fix line endings), then run it
echo Uploading nascleanup.sh to NAS and running cleanup...
@@ -102,6 +117,7 @@ if not exist "%~dp0nascleanup.sh" (
)
ssh Hydra "cat > ~/nascleanup.sh" < "%~dp0nascleanup.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/nascleanup.sh; else tr -d \"\r\" < ~/nascleanup.sh > ~/nascleanup.sh.tmp && mv ~/nascleanup.sh.tmp ~/nascleanup.sh; fi; chmod +x ~/nascleanup.sh; ~/nascleanup.sh \"%NASPATH%\"'"
call :WIN_REMOVE_LOCAL_EADIR_TMP
goto END
:FIX_ONEDRIVE
@@ -147,5 +163,28 @@ echo 3. Your custom thumbnails should now have priority!
echo.
goto END
REM Remove folder-level @eaDir on the pasted Windows path (same files as NAS over SMB).
:WIN_REMOVE_LOCAL_EADIR
if "%WINPATH%"=="" goto :eof
if exist "%WINPATH%\@eaDir" (
echo Removing "%WINPATH%\@eaDir" via Windows ^(SMB share^)...
rd /s /q "%WINPATH%\@eaDir" 2>nul
if exist "%WINPATH%\@eaDir" (
echo WARNING: Could not remove @eaDir; try PowerShell as admin or delete in Explorer.
)
)
goto :eof
REM Remove every eaDir_tmp under pasted path (including subfolders e.g. gameplay\eaDir_tmp).
:WIN_REMOVE_LOCAL_EADIR_TMP
if "%WINPATH%"=="" goto :eof
echo Removing all eaDir_tmp folders under "%WINPATH%" ^(recursive, SMB^)...
if not exist "%~dp0remove_eadir_tmp_recursive.ps1" (
echo ERROR: remove_eadir_tmp_recursive.ps1 not found next to this batch file.
goto :eof
)
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0remove_eadir_tmp_recursive.ps1" "%WINPATH%"
goto :eof
:END
pause
+4 -5
View File
@@ -3,7 +3,7 @@
# Extract existing Synology thumbnails from @eaDir into eaDir_tmp so thumbgen skips regeneration
# Usage: ./extract_eadir_to_tmp.sh /volume1/YourShare/path
set -euo pipefail
set -uo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 <directory_path>"
@@ -20,8 +20,8 @@ fi
echo "=== Extracting @eaDir thumbnails to eaDir_tmp ==="
echo "Target: $TARGET_DIR"
# For every @eaDir/<name> directory, copy known thumbnail files to eaDir_tmp/<name>
find "$TARGET_DIR" -type d -name '@eaDir' -print0 | while IFS= read -r -d '' EADIR; do
# Only TARGET_DIR/@eaDir (not nested .../@eaDir/.../@eaDir from bad prior runs; those hit chmod 555 parents)
find "$TARGET_DIR" -mindepth 1 -maxdepth 1 -type d -name '@eaDir' -print0 | while IFS= read -r -d '' EADIR; do
PARENT_DIR="$(dirname "$EADIR")"
# Each immediate subdir under @eaDir corresponds to a source filename
@@ -29,7 +29,7 @@ find "$TARGET_DIR" -type d -name '@eaDir' -print0 | while IFS= read -r -d '' EAD
BASENAME="$(basename "$ENTRY")"
DEST_DIR="$PARENT_DIR/eaDir_tmp/$BASENAME"
mkdir -p "$DEST_DIR"
mkdir -p "$DEST_DIR" || continue
# Copy without overwriting existing files in eaDir_tmp
for F in \
@@ -48,4 +48,3 @@ done
echo "=== Done. Existing thumbnails copied into eaDir_tmp where available. ==="
+78 -18
View File
@@ -11,17 +11,44 @@ fi
TARGET_DIR="$1"
# Merge synoindexd layout .../<file>/@eaDir/*.jpg into .../<file>/ (Synology Drive expects no inner @eaDir).
flatten_indexer_layout() {
local root="$1"
[ -d "$root" ] || return 0
find "$root" -mindepth 2 -type d -name '@eaDir' -print0 2>/dev/null | while IFS= read -r -d '' NEST; do
PARENT="$(dirname "$NEST")"
[ -d "$NEST" ] || continue
for f in "$NEST"/*; do
[ -e "$f" ] || continue
base="$(basename "$f")"
[ "$base" = "SYNOINDEX_MEDIA_INFO" ] && continue
mv -f "$f" "$PARENT/" 2>/dev/null || true
done
rm -rf "$NEST" 2>/dev/null || true
done
}
echo "=== Enhanced Synology Thumbnail Cleanup ==="
echo "Target directory: $TARGET_DIR"
# 1. Stop indexing services temporarily
echo "Stopping indexing services (best effort)..."
if command -v synoservicectl >/dev/null 2>&1; then
synoservicectl --stop synoindexd 2>/dev/null || true
synoservicectl --stop pkgctl-SynoFinder 2>/dev/null || true
# Non-login SSH often has a minimal PATH; binary lives in /usr/syno/sbin
if [ -x /usr/syno/sbin/synoservicectl ]; then
SYNOCTL=/usr/syno/sbin/synoservicectl
elif command -v synoservicectl >/dev/null 2>&1; then
SYNOCTL=synoservicectl
else
SYNOCTL=""
fi
if [ -n "$SYNOCTL" ]; then
"$SYNOCTL" --stop synoindexd 2>/dev/null || true
"$SYNOCTL" --stop pkgctl-SynoFinder 2>/dev/null || true
elif command -v systemctl >/dev/null 2>&1; then
systemctl stop synoindexd 2>/dev/null || true
systemctl stop pkgctl-SynoFinder 2>/dev/null || true
# Plain `systemctl` as non-root usually fails silently; try sudo -n first (NOPASSWD).
for u in synoindexd pkgctl-SynoFinder; do
sudo -n systemctl stop "$u" 2>/dev/null || systemctl stop "$u" 2>/dev/null || true
done
else
echo " -> Service control unavailable; skipping"
fi
@@ -38,26 +65,49 @@ find "$TARGET_DIR" -type d -name '@eaDir' -exec echo '{}' \;
# 4. Remove any existing @eaDir directories
echo "=== Removing existing @eaDir directories ==="
# Drop indexer sidecars first (often root-owned — passwordless sudo helps)
if command -v sudo >/dev/null 2>&1; then
sudo -n find "$TARGET_DIR" -name 'SYNOINDEX_MEDIA_INFO' \( -type f -o -type d \) -exec rm -rf '{}' \; 2>/dev/null || true
fi
find "$TARGET_DIR" -name 'SYNOINDEX_MEDIA_INFO' \( -type f -o -type d \) -exec chmod -R u+w '{}' \; 2>/dev/null || true
find "$TARGET_DIR" -name 'SYNOINDEX_MEDIA_INFO' \( -type f -o -type d \) -exec rm -rf '{}' \; 2>/dev/null || true
# First make them writable so we can remove them
find "$TARGET_DIR" -type d -name '@eaDir' -exec chmod -R 755 '{}' \; 2>/dev/null || true
find "$TARGET_DIR" -path '*/@eaDir/*' -type f -exec chmod 644 '{}' \; 2>/dev/null || true
# Now remove them
find "$TARGET_DIR" -type d -name '@eaDir' -exec rm -rf '{}' \; || true
# Now remove them (2>/dev/null: races when parents disappear mid-find)
find "$TARGET_DIR" -type d -name '@eaDir' -exec rm -rf '{}' \; 2>/dev/null || true
# 5. Rename eaDir_tmp to @eaDir (your custom thumbnails)
# 5. Promote only TARGET_DIR/eaDir_tmp -> TARGET_DIR/@eaDir (thumbgen layout; not nested */eaDir_tmp)
echo "=== Installing custom thumbnails ==="
# Ensure eaDir_tmp contents are writable before renaming
find "$TARGET_DIR" -type d -name 'eaDir_tmp' -exec chmod -R 755 '{}' \; 2>/dev/null || true
find "$TARGET_DIR" -path '*/eaDir_tmp/*' -type f -exec chmod 644 '{}' \; 2>/dev/null || true
# Use -depth so we process children before parents, and use $1 in bash -c for safety
find "$TARGET_DIR" -depth -type d -name 'eaDir_tmp' -exec bash -c 'd="$1"; target="${d%/*}/@eaDir"; echo " -> Replacing $d"; rm -rf "$target"; mkdir -p "$target"; cp -a "$d/." "$target/"; rm -rf "$d"' _ {} \; || true
# Remove any leftover eaDir_tmp directories (if rename failed)
echo "=== Removing leftover eaDir_tmp directories ==="
find "$TARGET_DIR" -type d -name 'eaDir_tmp' -exec rm -rf '{}' \; 2>/dev/null || true
EADIR_TMP="$TARGET_DIR/eaDir_tmp"
if [ -d "$EADIR_TMP" ]; then
chmod -R 755 "$EADIR_TMP" 2>/dev/null || true
find "$EADIR_TMP" -type f -exec chmod 644 '{}' \; 2>/dev/null || true
echo " -> Flattening eaDir_tmp (indexer may have added .../<file>/@eaDir/) before copy"
flatten_indexer_layout "$EADIR_TMP"
TARGET_AT="$TARGET_DIR/@eaDir"
echo " -> Replacing $EADIR_TMP -> $TARGET_AT"
rm -rf "$TARGET_AT"
mkdir -p "$TARGET_AT"
cp -R "$EADIR_TMP/." "$TARGET_AT/"
echo " -> Flattening @eaDir after copy (same layout fix)"
flatten_indexer_layout "$TARGET_AT"
chmod -R 755 "$EADIR_TMP" 2>/dev/null || true
find "$EADIR_TMP" -type f -exec chmod u+w '{}' \; 2>/dev/null || true
find "$EADIR_TMP" -type d -exec chmod u+w '{}' \; 2>/dev/null || true
if ! rm -rf "$EADIR_TMP" 2>/dev/null; then
echo " -> rm eaDir_tmp failed; retrying with sudo -n"
sudo -n rm -rf "$EADIR_TMP" 2>/dev/null || echo " -> WARNING: remove stale eaDir_tmp manually: sudo rm -rf \"$EADIR_TMP\""
fi
else
echo " -> No $EADIR_TMP; skipping install step"
fi
echo "=== Removing stray nested eaDir_tmp directories ==="
find "$TARGET_DIR" -mindepth 2 -type d -name 'eaDir_tmp' -exec rm -rf '{}' \; 2>/dev/null || true
# 6. Protect custom thumbnails with read-only permissions
echo "=== Adding indexing exclusion hints ==="
find "$TARGET_DIR" -type d -name '@eaDir' -exec sh -c 'touch "$1/.noindex" 2>/dev/null || true' _ {} \;
find "$TARGET_DIR" -type d -name '@eaDir' -exec sh -c 'touch "$1/.noindex" 2>/dev/null || true' _ {} \; 2>/dev/null || true
# 7. Protect custom thumbnails with read-only permissions (after .noindex)
echo "=== Protecting custom thumbnails ==="
@@ -65,4 +115,14 @@ find "$TARGET_DIR" -type d -name '@eaDir' -exec chmod 555 '{}' \; 2>/dev/null ||
find "$TARGET_DIR" -path '*/@eaDir/*' -type f -exec chmod 444 '{}' \; 2>/dev/null || true
echo "=== Cleanup complete! ==="
echo "Note: If indexing was stopped and needs restarting, use DSM UI or your NAS service tools."
echo "Restarting indexing services (best effort)..."
if [ -n "$SYNOCTL" ]; then
"$SYNOCTL" --start synoindexd 2>/dev/null || true
"$SYNOCTL" --start pkgctl-SynoFinder 2>/dev/null || true
elif command -v systemctl >/dev/null 2>&1; then
for u in synoindexd pkgctl-SynoFinder; do
sudo -n systemctl start "$u" 2>/dev/null || systemctl start "$u" 2>/dev/null || true
done
fi
echo "Note: If indexing was stopped and needs restarting, use DSM UI or: sudo systemctl restart synoindexd"
echo "If rm failed with Permission denied: delete @eaDir and eaDir_tmp on your pasted Windows path (SMB), or: sudo rm -rf ${TARGET_DIR}/eaDir_tmp ${TARGET_DIR}/@eaDir — then re-run option 3."
+1 -1
View File
@@ -825,7 +825,7 @@ def _build_icaros_index_map(cache_dir):
def _lookup_icaros_index(cache_dir, file_path):
"""Return (index, preferred_db_path) for file_path by inspecting Icaros_idx.icdb.
r"""Return (index, preferred_db_path) for file_path by inspecting Icaros_idx.icdb.
Tries multiple strategies:
1) Direct SQLite mapping (exact normalized full path match)
+15
View File
@@ -0,0 +1,15 @@
param(
[Parameter(Mandatory = $true)]
[string] $Root
)
if (-not (Test-Path -LiteralPath $Root)) { exit 0 }
$dirs = @(Get-ChildItem -LiteralPath $Root -Recurse -Directory -Filter 'eaDir_tmp' -ErrorAction SilentlyContinue |
Sort-Object { $_.FullName.Length } -Descending)
foreach ($d in $dirs) {
try {
Remove-Item -LiteralPath $d.FullName -Recurse -Force
Write-Host "Removed: $($d.FullName)"
} catch {
Write-Host "Failed: $($d.FullName)"
}
}