Compare commits

...

2 Commits

Author SHA1 Message Date
aeae478a68 add readme 2026-02-13 11:39:12 +03:00
750569986f add DB_PATH env 2026-02-13 11:38:17 +03:00
2 changed files with 20 additions and 1 deletions

View File

@@ -194,7 +194,12 @@ func getPodcastEpisodes(db *sqlx.DB, podcastId int64) ([]*Episode, error) {
func main() { func main() {
podcastsDirPath := os.Getenv("PODCASTS_DIRPATH") podcastsDirPath := os.Getenv("PODCASTS_DIRPATH")
db, err := sqlx.Connect("sqlite3", "./db/sqlite.db") dbPath := os.Getenv("DB_PATH")
if dbPath == "" {
dbPath = "./db/sqlite.db"
}
db, err := sqlx.Connect("sqlite3", dbPath)
if err != nil { if err != nil {
log.Fatalf("failed to connect to db: %v\n", err) log.Fatalf("failed to connect to db: %v\n", err)
} }

14
readme.md Normal file
View File

@@ -0,0 +1,14 @@
# podcaster
## usage
```bash
go run .
```
## env
```bash
PODCASTS_DIRPATH=./podcasts # directory with podcasts and episodes
DB_PATH=./db/sqlite.db # path to sqlite db file
```