···33## General
4455- [ ] pagination component
66-- [ ]
7687## Social
98···2726- [ ] release list item
2827- [ ] recording list item
2928- [ ] scrobble count (for inside list item)
2929+3030+## Recommandation
3131+3232+- [ ] a small recommendation page
3333+- [ ] recommandation system based on user's listening history
3434+3535+## Services
3636+3737+- [ ] link spotify account to keeptrack
3838+- [ ] keep track of users history on spotify
···11-package utilities
11+package database
2233import (
44 "database/sql"
···88 "path/filepath"
99)
10101111+// Opens a database connection, otherwise fails. Also a setup function is needed for the database to
1212+// set connection based settings.
1313+func Open(driver string, dsn string, setupfunc func(*sql.DB)) *sql.DB {
1414+ db, err := sql.Open(driver, dsn)
1515+1616+ if err != nil {
1717+ log.Panicln(err)
1818+ }
1919+2020+ setupfunc(db)
2121+2222+ return db
2323+}
2424+1125// For this application, we use multiple database that do have to interact with each other. This
1226// function opens the databases with correct names and paths to the database. The databases will be
1327// opened with WAL mode and normal synchronous mode.
1414-func OpenDatabaseWithAttachments(path string, attachments map[string]string) (*sql.DB, error) {
2828+func OpenWithAttachments(path string, attachments map[string]string) (*sql.DB, error) {
1529 statements := make(map[string]string)
16301731 for name, dbPath := range attachments {
···58725973 return db, nil
6074}
6161-6262-// Opens a database connection, otherwise fails. Also a setup function is needed for the database to
6363-// set connection based settings.
6464-func OpenDatabase(driver string, dsn string, setupfunc func(*sql.DB)) *sql.DB {
6565- db, err := sql.Open(driver, dsn)
6666-6767- if err != nil {
6868- log.Panicln(err)
6969- }
7070-7171- setupfunc(db)
7272-7373- return db
7474-}