[PR #841] Read client_id from a file in the config folder #1836

Open
opened 2026-03-14 15:35:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/841
Author: @rashil2000
Created: 9/29/2025
Status: 🔄 Open

Base: masterHead: client_id-from-env


📝 Commits (5)

  • a07431d Read client_id from a file in the config folder
  • e9ea938 Make fmt happy
  • a17a993 Merge branch 'master' into client_id-from-env
  • 5bb3e19 Merge branch 'master' into client_id-from-env
  • 0ece1f5 Make fmt happy

📊 Changes

4 files changed (+44 additions, -24 deletions)

View changed files

📝 README.md (+1 -1)
📝 docs/config.md (+4 -1)
📝 spotify_player/src/client/mod.rs (+24 -20)
📝 spotify_player/src/config/mod.rs (+15 -2)

📄 Description

Related: #537

This PR introduces a default lookup for a file containing the client_id, eliminating the need to add an external command to read it from the filesystem.

It is a plaintext file called client_id present alongside app.toml (in the ~/.config/spotify-player) directory, which contains the ID - if such a file exists we can read it first, and then fallback to other mechanisms.

My main motivation for this change is that shelling out to an external command is an expensive operation, and not all systems have straightforward ways to do that (i.e. Windows does not have the cat command, although there are ways to achieve similar functionality via the findstr or more commands). Of course this is assuming the commands are being invoked without a shell (where stuff like echo is available). But external shell -> external command is even more expensive.


🔄 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/aome510/spotify-player/pull/841 **Author:** [@rashil2000](https://github.com/rashil2000) **Created:** 9/29/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `client_id-from-env` --- ### 📝 Commits (5) - [`a07431d`](https://github.com/aome510/spotify-player/commit/a07431da99687a2dd8dfef0852b924711f858463) Read client_id from a file in the config folder - [`e9ea938`](https://github.com/aome510/spotify-player/commit/e9ea938566961b80419bbbb9c71a4d49a5b65533) Make `fmt` happy - [`a17a993`](https://github.com/aome510/spotify-player/commit/a17a993fa65c3676172703d92664aa7119880e40) Merge branch 'master' into client_id-from-env - [`5bb3e19`](https://github.com/aome510/spotify-player/commit/5bb3e19ecbaa0d9e59890b974c4b65a7944f069c) Merge branch 'master' into client_id-from-env - [`0ece1f5`](https://github.com/aome510/spotify-player/commit/0ece1f54d756eac12783b106b46dc5ccbabe61b2) Make `fmt` happy ### 📊 Changes **4 files changed** (+44 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `docs/config.md` (+4 -1) 📝 `spotify_player/src/client/mod.rs` (+24 -20) 📝 `spotify_player/src/config/mod.rs` (+15 -2) </details> ### 📄 Description Related: #537 This PR introduces a default lookup for a file containing the client_id, eliminating the need to add an external command to read it from the filesystem. It is a plaintext file called `client_id` present alongside app.toml (in the ~/.config/spotify-player) directory, which contains the ID - if such a file exists we can read it first, and then fallback to other mechanisms. My main motivation for this change is that shelling out to an external command is an expensive operation, and not all systems have straightforward ways to do that (i.e. Windows does not have the `cat` command, although there are ways to achieve similar functionality via the `findstr` or `more` commands). Of course this is assuming the commands are being invoked without a shell (where stuff like `echo` is available). But external shell -> external command is even more expensive. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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/spotify-player#1836
No description provided.