KaykCaputo / KaykCaputo/OpenCifra
Extract hardcoded values to configuration file
- Dominant language
- Python
- Stars
- 6
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Several URLs, constants, and configuration values are hardcoded throughout the codebase. These should be extracted to a configuration file for better maintainability.
## Current Hardcoded Values
- Line 144: `CHUNK_SIZE = 50`
- Line 184: Search API URL `https://solr.sscdn.co/cc/h2/`
- Line 236: Cifra Club URL pattern `https://www.cifraclub.com.br/`
- Line 260: Chord color `44AAFF`
- Line 272: Font size `dp(9)`
## Proposed Solution
Create a `config.py` file:
```python
# config.py
class Config:
# API Settings
SEARCH_API_URL = "https://solr.sscdn.co/cc/h2/"
CIFRA_CLUB_BASE_URL = "https://www.cifraclub.com.br/"
REQUEST_TIMEOUT = 5
SEARCH_LIMIT = 8
# UI Settings
CHUNK_SIZE = 50
CHORD_COLOR = "44AAFF"
LYRICS_FONT_SIZE = 9
# User Agent
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
```
## Benefits
- Easier configuration management
- Single source of truth
- Simpler testing with mock configurations
- Better for future features like theme customization
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.