[PR #215] [MERGED] Trim whitespace in sanitizePath function #530

Closed
opened 2026-02-27 19:04:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/afkarxyz/SpotiFLAC/pull/215
Author: @SjxSubham
Created: 1/1/2026
Status: Merged
Merged: 1/8/2026
Merged by: @afkarxyz

Base: mainHead: main


📝 Commits (2)

  • ba288b5 Trim whitespace in sanitizePath function
  • 582c905 Merge branch 'afkarxyz:main' into main

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 frontend/src/lib/utils.ts (+2 -1)

📄 Description

Add whitespace trimming to sanitizePath function.

Screenshot From 2026-01-01 10-04-43

When a playlist name has a trailing space. this sanitizePath function only replaces invalid characters but doesn't trim leading space.

Issue
This creates a folder path like C:\Users\.. .\daniel caesar, etc. \ (with a trailing space before the backslash). Windows automatically removes trailing spaces from folder names, so the folder is actually created as daniel caesar, etc.\ but the application tries to write to the path with the space, causing the "path not found" error.

This Solution fixes this Issue

  • Issue #213 resolved

🔄 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/afkarxyz/SpotiFLAC/pull/215 **Author:** [@SjxSubham](https://github.com/SjxSubham) **Created:** 1/1/2026 **Status:** ✅ Merged **Merged:** 1/8/2026 **Merged by:** [@afkarxyz](https://github.com/afkarxyz) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`ba288b5`](https://github.com/afkarxyz/SpotiFLAC/commit/ba288b59f959e8285862ce86321956496fdfce11) Trim whitespace in sanitizePath function - [`582c905`](https://github.com/afkarxyz/SpotiFLAC/commit/582c9054d4bd07f72fb5ec52899a3679621850ca) Merge branch 'afkarxyz:main' into main ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/lib/utils.ts` (+2 -1) </details> ### 📄 Description Add whitespace trimming to `sanitizePath` function. <img width="583" height="251" alt="Screenshot From 2026-01-01 10-04-43" src="https://github.com/user-attachments/assets/546f9136-32e9-4764-adfb-fbe66b974c56" /> When a playlist name has a trailing space. this `sanitizePath` function only replaces invalid characters but doesn't trim leading space. > Issue This creates a folder path like `C:\Users\.. .\daniel caesar, etc. \` (with a trailing space before the backslash). Windows automatically removes trailing spaces from folder names, so the folder is actually created as `daniel caesar, etc.\` but the application tries to write to the path with the space, causing the "_path not found_" error. This Solution fixes this Issue - [x] Issue #213 resolved --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:04:15 +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/SpotiFLAC#530
No description provided.