This commit is contained in:
sentriz
2019-08-07 13:03:36 +01:00
parent c75732868d
commit 6d0fe80608
3 changed files with 3 additions and 5 deletions

4
.gitignore vendored
View File

@@ -1,6 +1,6 @@
*.db
*.db-wal
*.db-shm
*db-wal
*db-shm
*.sql
cmd/scanner/scanner
cmd/server/server

View File

@@ -28,9 +28,7 @@ func TestFirstExisting(t *testing.T) {
},
}
for _, tc := range cases {
tc := tc // pin
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
actu := firstExisting(tc.or, tc.values...)
if actu != tc.exp {
t.Errorf("expected %q, got %q", tc.exp, actu)

View File

@@ -35,8 +35,8 @@ func New(db *db.DB, musicPath string, listenAddr string) *Server {
router.HandleFunc("/musicFolderSettings.view", func(w http.ResponseWriter, r *http.Request) {
// jamstash seems to call "musicFolderSettings.view" to start a scan. notice
// that there is no "/rest/" prefix, so i doesn't fit in with the nice router,
// instead lets redirect to down there and use the scan endpoint
// custom handler, middleware. etc setup that we've got in `SetupSubsonic()`.
// instead lets redirect to down there and use the scan endpoint
redirectTo := fmt.Sprintf("/rest/startScan.view?%s", r.URL.Query().Encode())
http.Redirect(w, r, redirectTo, http.StatusMovedPermanently)
})