diff --git a/db/db.go b/db/db.go index 6d583e3..1be722f 100644 --- a/db/db.go +++ b/db/db.go @@ -31,7 +31,6 @@ type Item struct { } type Jdb struct { - Foo string `json:"-"` Items []Item `json:"items"` } @@ -73,7 +72,7 @@ func (d *Db) Transact(id int, persist bool, f func(*Item)) error { } func (d *Db) save() error { - data, err := json.Marshal(Jdb{"", d.items}) + data, err := json.Marshal(Jdb{d.items}) if err != nil { return err } @@ -83,7 +82,7 @@ func (d *Db) save() error { func (d *Db) Run(f func(*Jdb)) { d.mutex.Lock() defer d.mutex.Unlock() - f(&Jdb{"", d.items}) + f(&Jdb{d.items}) } func (d *Db) Save() error { diff --git a/main.go b/main.go index 267c803..564f294 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,6 @@ package main import ( "bufio" "embed" - _ "embed" "flag" "fmt" "html/template" @@ -37,6 +36,7 @@ var ( saveAssets = false dbPath = "./db.json" port = 8080 + title = "Youtube Downloader" ) var d *db.Db @@ -44,6 +44,7 @@ var d *db.Db func parse() { ytcmd := ytdlCmd[0] flag.StringVar(&ytcmd, "ytdlcmd", ytcmd, "youtube-dl command seperated by spaces") + flag.StringVar(&title, "title", title, "Title of the page") flag.StringVar(&videosPath, "videospath", videosPath, "Path where videos are saved") flag.StringVar(&videosUrl, "videosurl", videosUrl, "Prefix of the url, i.e. https://domain.com//