[PR #4342] [MERGED] Update pathexists file system API endpoint #4218

Closed
opened 2026-04-25 00:18:51 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4342
Author: @advplyr
Created: 5/27/2025
Status: Merged
Merged: 5/27/2025
Merged by: @advplyr

Base: masterHead: check_path_api_fix


📝 Commits (1)

  • 6ce1806 Update pathexists file system API endpoint

📊 Changes

2 files changed (+47 additions, -30 deletions)

View changed files

📝 client/pages/upload/index.vue (+2 -3)
📝 server/controllers/FileSystemController.js (+45 -27)

📄 Description

Brief summary

Updates the /api/filesystem/pathexists endpoint to ensure path being checked is a path inside a library folder.

This endpoint is used in the uploader to check that the folder doesn't already exist before uploading the files.

Which issue is fixed?

None

In-depth Description

This is a breaking change to the pathexists endpoint.

In v2.21.0 the endpoint was updated to optionally take directory and folderPath in the request body. Previously only filepath was accepted.

Now this endpoint requires directory and folderPath and does not use filepath.

Example:

curl --location 'http://localhost:3333/api/filesystem/pathexists' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api key>' \
--data '{
    "directory": "George Orwell/1984",
    "folderPath": "/audiobooks"
}'

How have you tested this?

Tested with invalid directory and folderPath values


🔄 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/advplyr/audiobookshelf/pull/4342 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 5/27/2025 **Status:** ✅ Merged **Merged:** 5/27/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `check_path_api_fix` --- ### 📝 Commits (1) - [`6ce1806`](https://github.com/advplyr/audiobookshelf/commit/6ce1806359d9560b7aab45252d846434d8b79c4e) Update pathexists file system API endpoint ### 📊 Changes **2 files changed** (+47 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `client/pages/upload/index.vue` (+2 -3) 📝 `server/controllers/FileSystemController.js` (+45 -27) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Updates the `/api/filesystem/pathexists` endpoint to ensure path being checked is a path inside a library folder. This endpoint is used in the uploader to check that the folder doesn't already exist before uploading the files. ## Which issue is fixed? None ## In-depth Description This is a breaking change to the pathexists endpoint. In [v2.21.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.21.0) the endpoint was [updated](https://github.com/advplyr/audiobookshelf/commit/e16d3d72b69cb3ed547643cb7ae8f822327966cd) to optionally take `directory` and `folderPath` in the request body. Previously only `filepath` was accepted. Now this endpoint requires `directory` and `folderPath` and does not use `filepath`. Example: ```bash curl --location 'http://localhost:3333/api/filesystem/pathexists' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <api key>' \ --data '{ "directory": "George Orwell/1984", "folderPath": "/audiobooks" }' ``` ## How have you tested this? Tested with invalid `directory` and `folderPath` values --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:51 +02:00
adam closed this issue 2026-04-25 00:18:51 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4218