Skip to content

Commit 2f35b25

Browse files
New version changes
1 parent dc8c969 commit 2f35b25

2 files changed

Lines changed: 104 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,71 @@
11
## ✨ What's New
2-
- Added `info` command to display media information.
32

4-
### ✨ Other Changes
5-
* Removed keyring dependencies and switched to database storage.
6-
* Bumped all dependencies to latest versions.
7-
* Updated docs to use chibi logo instead of the old GIF.
8-
* Updated build pipeline trigger rules.
3+
### 🎨 Theme System
4+
- **Added comprehensive theme support** with customizable color palettes
5+
- New `chibi theme` command to view and set active themes
6+
- Support for custom themes via TOML files in `DATA_DIR/themes`
7+
- Four built-in themes: `default`, `nord`, `sunset`, and `forest`
8+
- Environment variable override: `CHIBI_THEME` for temporary theme switching
9+
10+
### 📊 JSON Output Support
11+
- **Added `-j, --json` flag** to all major commands for structured JSON output
12+
- `chibi ls --json` outputs media list with romaji, english, and native titles
13+
- `chibi search --json` outputs search results in JSON format
14+
- `chibi profile --json` outputs profile information as JSON
15+
- `chibi info --json` outputs detailed media information including synonyms
16+
17+
### 📁 Data Directory Customization
18+
- **Custom data directory support** via environment variables
19+
- `CHIBI_DATA_PATH` (preferred) - set custom data storage location
20+
- `CHIBI_PATH` (legacy fallback) - for backward compatibility
21+
- Documentation updated with examples for both bash and PowerShell
22+
23+
### 📚 Expanded Media Information
24+
- Added `synonyms` field to media info queries and responses
25+
- Extended title metadata: `romaji`, `english`, and `native` titles across all commands
26+
- Next airing episode information for anime (timestamps with countdown)
27+
- Fixed search query spacing (words now properly separated)
28+
29+
### 🐧 AUR Package Support
30+
- **Added Arch Linux User Repository (AUR) integration**
31+
- New `chibi-cli-git` package for development/latest builds
32+
- New `chibi-cli-bin` package for pre-built releases
33+
- Automated PKGBUILD generation and AUR publishing in CI/CD
34+
35+
### 📖 Documentation Improvements
36+
- New documentation pages for `info` and `theme` commands
37+
- Updated all command guides with JSON flag examples
38+
- Fixed documentation links (changed from develop to main branch)
39+
- Added contributors section to README
40+
- Custom data directory configuration guide
41+
42+
### ⚙️ Build & Deployment
43+
- **Updated GitHub Actions workflow** for better build efficiency
44+
- Added Go module caching to improve build times
45+
- Changed trigger from pull_request to push on main branch
46+
- Added AUR publishing workflow step
47+
48+
### 🔧 Code Quality & Refactoring
49+
- **Introduced theme system** with centralized color palette management
50+
- Separated theme colors from hardcoded hex values throughout UI
51+
- Added comprehensive unit tests for theme loading and persistence
52+
- Improved data path resolution with environment variable support
53+
- Refactored media list and search UI components for JSON support
54+
- Fixed indentation and formatting inconsistencies
55+
56+
### 📦 Dependency Updates
57+
- Added `github.com/BurntSushi/toml v1.4.0` for theme file parsing
58+
- Bumped Go toolchain and various dependencies to latest versions
59+
- Removed unused dependencies to keep binary size minimal
960

1061
### 🐛 Bug Fixes
11-
* Fixed spinner writing to `stdout` instead of `stderr`.
62+
- Fixed search media query handling (proper word spacing)
63+
- Fixed media list rendering to show only CURRENT and REPEATING statuses
64+
- Improved error handling for missing theme configurations
65+
- Fixed spinner color styling to use theme palette
66+
67+
### 🎯 Other Changes
68+
- Added `APP_DIR_NAME` constant for consistent directory naming
69+
- Enhanced helper functions with new `FormatAiringTs()` for countdown display
70+
- Improved code organization with separate theme and path resolution modules
71+
- Added test coverage for data path resolution logic

internal/cache/cache.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package cache
2+
3+
import (
4+
"database/sql"
5+
"fmt"
6+
"os"
7+
"path/filepath"
8+
9+
"github.com/CosmicPredator/chibi/internal"
10+
_ "modernc.org/sqlite"
11+
)
12+
13+
type Cache struct {
14+
db *sql.DB
15+
}
16+
17+
func Open() (*Cache, error) {
18+
dbDirPath, err := internal.ResolveDataPath()
19+
if err != nil {
20+
return nil, err
21+
}
22+
if err := os.MkdirAll(dbDirPath, 0o755); err != nil {
23+
return nil, fmt.Errorf("unable to create config path: %w", err)
24+
}
25+
dbPath := filepath.Join(dbDirPath, internal.DB_PATH)
26+
27+
db, err := sql.Open("sqlite", dbPath)
28+
29+
cache := &Cache{
30+
db: db,
31+
}
32+
if err != nil {
33+
return nil, err
34+
}
35+
36+
return cache, nil
37+
}

0 commit comments

Comments
 (0)