[PR #204] [MERGED] fix/185: normalize script matching to handle underscore vs hyphen differences #272

Closed
opened 2026-02-26 12:40:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/204
Author: @michelroegl-brunner
Created: 10/20/2025
Status: Merged
Merged: 10/20/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/185


📝 Commits (1)

  • 266ff5a fix: normalize script matching to handle underscore vs hyphen differences

📊 Changes

4 files changed (+40 additions, -6 deletions)

View changed files

📝 src/app/_components/DownloadedScriptsTab.tsx (+14 -3)
📝 src/app/_components/ScriptsGrid.tsx (+14 -3)
📝 src/server/api/routers/scripts.ts (+10 -0)
📝 src/types/script.ts (+2 -0)

📄 Description

Problem

PVE Host scripts were showing as 'Not Downloaded' in the Downloaded tab even when they were actually downloaded locally. This occurred because:

  • Local filenames use underscores (e.g., pbs_microcode.sh)
  • JSON slugs use hyphens (e.g., pbs-microcode)
  • The matching logic was doing raw string comparisons

Solution

  • Added normalizeId helper that converts identifiers to lowercase and replaces non-alphanumeric characters with hyphens
  • Enhanced script cards to include install_basenames extracted from install_methods
  • Updated both DownloadedScriptsTab and ScriptsGrid to use normalized comparisons
  • Now matches against script name, slug, or any install_basenames

Testing

  • Download all scripts
  • Go to Downloaded tab
  • Filter by 'PVE Host' category
  • Scripts like 'PVE LXC Execute Command' and 'PBS Processor Microcode' now correctly show as 'Downloaded'

Fixes the issue where PVE Host scripts appeared as 'Not Downloaded' despite being available locally.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/204 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 10/20/2025 **Status:** ✅ Merged **Merged:** 10/20/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/185` --- ### 📝 Commits (1) - [`266ff5a`](https://github.com/community-scripts/ProxmoxVE-Local/commit/266ff5a79f032a1acabec46aece2f6b35f08b320) fix: normalize script matching to handle underscore vs hyphen differences ### 📊 Changes **4 files changed** (+40 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/app/_components/DownloadedScriptsTab.tsx` (+14 -3) 📝 `src/app/_components/ScriptsGrid.tsx` (+14 -3) 📝 `src/server/api/routers/scripts.ts` (+10 -0) 📝 `src/types/script.ts` (+2 -0) </details> ### 📄 Description ## Problem PVE Host scripts were showing as 'Not Downloaded' in the Downloaded tab even when they were actually downloaded locally. This occurred because: - Local filenames use underscores (e.g., `pbs_microcode.sh`) - JSON slugs use hyphens (e.g., `pbs-microcode`) - The matching logic was doing raw string comparisons ## Solution - Added `normalizeId` helper that converts identifiers to lowercase and replaces non-alphanumeric characters with hyphens - Enhanced script cards to include `install_basenames` extracted from `install_methods` - Updated both `DownloadedScriptsTab` and `ScriptsGrid` to use normalized comparisons - Now matches against script `name`, `slug`, or any `install_basenames` ## Testing - Download all scripts - Go to Downloaded tab - Filter by 'PVE Host' category - Scripts like 'PVE LXC Execute Command' and 'PBS Processor Microcode' now correctly show as 'Downloaded' Fixes the issue where PVE Host scripts appeared as 'Not Downloaded' despite being available locally. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 12:40:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE-Local#272
No description provided.