Skip to content

Commit

Permalink
Added some general database tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevReaper0 committed Oct 23, 2024
1 parent 84f925b commit e52048a
Show file tree
Hide file tree
Showing 5 changed files with 2,651 additions and 347 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,39 @@ Libra is a new, open, and extensible music service. Libra does what you want, ho

## Setup Steps

Before anything else, you need to create the database. Install PostgreSQL and run the following commands:
Before anything else, you need to set up the database. Install one of the following databases and follow its steps:

<details>
<summary>SQLite</summary>

No additional steps are needed to use SQLite.
</details>

<details>

<summary>PostgreSQL</summary>

To create the PostgreSQL database, run the following commands:

```bash
sudo -u postgres createuser -P libra
sudo -u postgres createdb -O libra -E UTF-8 libra
```
</details>

Dependencies:

- `SQLite` or `PostgreSQL`
- `yt-dlp` and `ytmusicapi` for the YouTube source
- `FFmpeg`

## Development

To run all tests, run `make test`.
If you don't have every supported database type installed, you can skip database tests by setting the following environment variables:
- `SKIP_SQLITE_TESTS`
- `SKIP_POSTGRES_TESTS`

## Roadmap

In the future, the project aims for the following:
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func LoadConfig() (conf Config) {
viper.SetConfigType("yaml")
viper.AddConfigPath(".")

if err := readDefaultConfig(); err != nil {
if err := LoadDefaultConfig(); err != nil {
log.Fatal().Msg("Failed to read default config")
return
}
Expand All @@ -182,7 +182,7 @@ func LoadConfig() (conf Config) {
return
}

func readDefaultConfig() error {
func LoadDefaultConfig() error {
return viper.ReadConfig(strings.NewReader(defaultConfig))
}

Expand Down
Loading

0 comments on commit e52048a

Please sign in to comment.