[PR #381] [CLOSED] feat: Add CLI download support and persistent configuration #542

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

📋 Pull Request Information

Original PR: https://github.com/afkarxyz/SpotiFLAC/pull/381
Author: @Nizarberyan
Created: 1/25/2026
Status: Closed

Base: mainHead: main


📝 Commits (10+)

  • d53fec0 feat(cli): add CLI download support and persistent config
  • ea70f49 fix(cli): address review comments
  • 9743855 feat: Introduce concurrent CLI downloads with configurable delay and concurrency, signal handling, and enhanced argument validation.
  • 3c63133 Apply suggestion from @Copilot
  • 70fdc20 Apply suggestion from @Copilot
  • 81efd5d Apply suggestion from @Copilot
  • f642acd Apply suggestion from @Copilot
  • b7a7a9d Apply suggestion from @Copilot
  • ec8a483 Apply suggestion from @Copilot
  • 0ccc0c9 Apply suggestion from @Copilot

📊 Changes

4 files changed (+373 additions, -5 deletions)

View changed files

📝 .gitignore (+3 -1)
📝 backend/config.go (+5 -2)
📝 backend/history.go (+47 -2)
📝 main.go (+318 -0)

📄 Description

Description

This PR introduces CLI capabilities to SpotiFLAC, allowing users to download music directly from the terminal without launching the GUI. It also integrates a persistent configuration system for managing the default download directory.

Key Features

  • Headless Mode: Run spotiflac <spotify-url> to download tracks, albums, or playlists immediately.
  • Persistent Configuration: The default download path is now stored in the application's database, allowing it to persist across sessions.
  • New CLI Flags:
    • --set-output <path>: Sets the permanent default download directory.
    • -o <path>: Overrides the output directory for the current command only.

Technical Details

  • Refactored main.go to detect CLI arguments and bypass Wails GUI initialization when running in headless mode.
  • Updated backend configuration logic to prefer the stored database path over the system default.
  • Implemented robust path normalization to handle relative and absolute paths correctly across different OS environments.

🔄 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/381 **Author:** [@Nizarberyan](https://github.com/Nizarberyan) **Created:** 1/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`d53fec0`](https://github.com/afkarxyz/SpotiFLAC/commit/d53fec034347a68c6ea8548198d7cc9449306e34) feat(cli): add CLI download support and persistent config - [`ea70f49`](https://github.com/afkarxyz/SpotiFLAC/commit/ea70f496db6350aa138b1d012347a0146f171f9a) fix(cli): address review comments - [`9743855`](https://github.com/afkarxyz/SpotiFLAC/commit/974385534efdaaf43c3dfcc32c9f6831931d2191) feat: Introduce concurrent CLI downloads with configurable delay and concurrency, signal handling, and enhanced argument validation. - [`3c63133`](https://github.com/afkarxyz/SpotiFLAC/commit/3c63133d882619a576e588a56b30f4c04ef0f13a) Apply suggestion from @Copilot - [`70fdc20`](https://github.com/afkarxyz/SpotiFLAC/commit/70fdc20971a4ec5ef8c25994618ea46a6b6c0c4c) Apply suggestion from @Copilot - [`81efd5d`](https://github.com/afkarxyz/SpotiFLAC/commit/81efd5d3bc63aca4727dbca5ecd055c6b395c177) Apply suggestion from @Copilot - [`f642acd`](https://github.com/afkarxyz/SpotiFLAC/commit/f642acdd2c2455794bba656ec7fa5329e20a77b6) Apply suggestion from @Copilot - [`b7a7a9d`](https://github.com/afkarxyz/SpotiFLAC/commit/b7a7a9d83838c680decf7cbf448e5dba5005c6a9) Apply suggestion from @Copilot - [`ec8a483`](https://github.com/afkarxyz/SpotiFLAC/commit/ec8a483b39915e22fc84a36649ddb583556244fa) Apply suggestion from @Copilot - [`0ccc0c9`](https://github.com/afkarxyz/SpotiFLAC/commit/0ccc0c9f49604ff2fa6ad60c0ca2b3c037d0dafe) Apply suggestion from @Copilot ### 📊 Changes **4 files changed** (+373 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -1) 📝 `backend/config.go` (+5 -2) 📝 `backend/history.go` (+47 -2) 📝 `main.go` (+318 -0) </details> ### 📄 Description ## Description This PR introduces CLI capabilities to SpotiFLAC, allowing users to download music directly from the terminal without launching the GUI. It also integrates a persistent configuration system for managing the default download directory. ## Key Features - **Headless Mode**: Run `spotiflac <spotify-url>` to download tracks, albums, or playlists immediately. - **Persistent Configuration**: The default download path is now stored in the application's database, allowing it to persist across sessions. - **New CLI Flags**: - `--set-output <path>`: Sets the permanent default download directory. - `-o <path>`: Overrides the output directory for the current command only. ## Technical Details - Refactored main.go to detect CLI arguments and bypass Wails GUI initialization when running in headless mode. - Updated backend configuration logic to prefer the stored database path over the system default. - Implemented robust path normalization to handle relative and absolute paths correctly across different OS environments. --- <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:17 +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#542
No description provided.