diff --git a/convert.go b/convert.go index 68c3a64..168b5a6 100644 --- a/convert.go +++ b/convert.go @@ -6,6 +6,7 @@ import ( "strconv" "os" "bufio" + "time" "github.com/beevik/etree" ) @@ -154,6 +155,9 @@ func main() { // at this point, our playlist should be sorted + // get date + currentTime := time.Now() + // create the xml file file, err := os.OpenFile("main_parsed.xml", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { @@ -166,6 +170,13 @@ func main() { fmt.Fprintln(w, ``) fmt.Fprintln(w, "") + // print out information at the header + fmt.Fprintln(w, "") + fmt.Fprintln(w, "dtam playlist") + fmt.Fprintln(w, "" + strconv.Itoa(len(playlist_tracks)) + " tracks (Last updated: " + currentTime.Format("Jan 02, 2006") + ")") + fmt.Fprintln(w, "https://dtam.pw/music/empty.m4a") + fmt.Fprintln(w, "") + // cycle through our ordered playlist and write it to the file for _, e := range playlist { fmt.Fprintln(w, "")