Rename project to Navidrome
This commit is contained in:
+3
-3
@@ -6,9 +6,9 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/assets"
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/deluan/navidrome/assets"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/rest"
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/go-chi/jwtauth"
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/consts"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/deluan/navidrome/consts"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/rest"
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
"github.com/go-chi/jwtauth"
|
||||
|
||||
+16
-11
@@ -1,19 +1,24 @@
|
||||
package server
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Cloud%20Sonic
|
||||
const banner = `
|
||||
██████╗██╗ ██████╗ ██╗ ██╗██████╗ ███████╗ ██████╗ ███╗ ██╗██╗ ██████╗
|
||||
██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ██║██║██╔════╝
|
||||
██║ ██║ ██║ ██║██║ ██║██║ ██║ ███████╗██║ ██║██╔██╗ ██║██║██║
|
||||
██║ ██║ ██║ ██║██║ ██║██║ ██║ ╚════██║██║ ██║██║╚██╗██║██║██║
|
||||
╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ███████║╚██████╔╝██║ ╚████║██║╚██████╗
|
||||
╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═════╝
|
||||
Version %s
|
||||
// http://patorjk.com/software/taag/#p=display&f=Doom&t=Navidrome
|
||||
// Need to be Base64 encoded, as it contains a lot of escaping chars.
|
||||
// May try to find another way to do it without an external file
|
||||
const encodedBanner = "IF8gICBfICAgICAgICAgICAgIF8gICAgIF8gICAgICAgICAgICAgICAgICAgICAgICAgIAp8IFwgfCB8ICAgICAgICAgIC" +
|
||||
"AoXykgICB8IHwgICAgICAgICAgICAgICAgICAgICAgICAgCnwgIFx8IHwgX18gX19fICAgX19fICBfX3wgfF8gX18gX19fICBfIF9fIF9fXyAgIF" +
|
||||
"9fXyAKfCAuIGAgfC8gX2AgXCBcIC8gLyB8LyBfYCB8ICdfXy8gXyBcfCAnXyBgIF8gXCAvIF8gXAp8IHxcICB8IChffCB8XCBWIC98IHwgKF98IH" +
|
||||
"wgfCB8IChfKSB8IHwgfCB8IHwgfCAgX18vClxffCBcXy9cX18sX3wgXF8vIHxffFxfXyxffF98ICBcX19fL3xffCB8X3wgfF98XF9fX3w="
|
||||
|
||||
const banner = `%s
|
||||
Version %s
|
||||
|
||||
`
|
||||
|
||||
func ShowBanner() {
|
||||
fmt.Printf(banner, Version)
|
||||
decodedBanner, _ := base64.StdEncoding.DecodeString(encodedBanner)
|
||||
fmt.Printf(banner, string(decodedBanner), Version)
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/consts"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/consts"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
||||
+6
-6
@@ -6,16 +6,16 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/scanner"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/scanner"
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/go-chi/chi/middleware"
|
||||
"github.com/go-chi/cors"
|
||||
)
|
||||
|
||||
const Version = "0.2"
|
||||
const Version = "0.2.0"
|
||||
|
||||
type Server struct {
|
||||
Scanner *scanner.Scanner
|
||||
@@ -41,7 +41,7 @@ func (a *Server) MountRouter(path string, subRouter http.Handler) {
|
||||
}
|
||||
|
||||
func (a *Server) Run(addr string) {
|
||||
log.Info("CloudSonic server is accepting requests", "address", addr)
|
||||
log.Info("Navidrome server is accepting requests", "address", addr)
|
||||
log.Error(http.ListenAndServe(addr, a.router))
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/cloudsonic/sonic-server/utils"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/utils"
|
||||
)
|
||||
|
||||
type AlbumListController struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"net/http/httptest"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/go-chi/chi"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package subsonic
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/deluan/navidrome/log"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/cloudsonic/sonic-server/utils"
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/utils"
|
||||
)
|
||||
|
||||
type BrowsingController struct {
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/cloudsonic/sonic-server/utils"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/utils"
|
||||
)
|
||||
|
||||
func NewResponse() *responses.Subsonic {
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type MediaAnnotationController struct {
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type MediaRetrievalController struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"io"
|
||||
"net/http/httptest"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/deluan/navidrome/model"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
func checkRequiredParameters(next http.Handler) http.Handler {
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type PlaylistsController struct {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"status":"ok","version":"1.8.0","user":{"username":"deluan","email":"cloudsonic@deluan.com","scrobblingEnabled":false,"adminRole":false,"settingsRole":false,"downloadRole":false,"uploadRole":false,"playlistRole":false,"coverArtRole":false,"commentRole":false,"podcastRole":false,"streamRole":false,"jukeboxRole":false,"shareRole":false,"videoConversionRole":false,"folder":[1]}}
|
||||
{"status":"ok","version":"1.8.0","user":{"username":"deluan","email":"navidrome@deluan.com","scrobblingEnabled":false,"adminRole":false,"settingsRole":false,"downloadRole":false,"uploadRole":false,"playlistRole":false,"coverArtRole":false,"commentRole":false,"podcastRole":false,"streamRole":false,"jukeboxRole":false,"shareRole":false,"videoConversionRole":false,"folder":[1]}}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0"><user username="deluan" email="cloudsonic@deluan.com" scrobblingEnabled="false" adminRole="false" settingsRole="false" downloadRole="false" uploadRole="false" playlistRole="false" coverArtRole="false" commentRole="false" podcastRole="false" streamRole="false" jukeboxRole="false" shareRole="false" videoConversionRole="false"><folder>1</folder></user></subsonic-response>
|
||||
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0"><user username="deluan" email="navidrome@deluan.com" scrobblingEnabled="false" adminRole="false" settingsRole="false" downloadRole="false" uploadRole="false" playlistRole="false" coverArtRole="false" commentRole="false" podcastRole="false" streamRole="false" jukeboxRole="false" shareRole="false" videoConversionRole="false"><folder>1</folder></user></subsonic-response>
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/onsi/ginkgo"
|
||||
"github.com/onsi/gomega"
|
||||
"github.com/onsi/gomega/types"
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"encoding/xml"
|
||||
"time"
|
||||
|
||||
. "github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
. "github.com/deluan/navidrome/server/subsonic/responses"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
@@ -206,7 +206,7 @@ var _ = Describe("Responses", func() {
|
||||
|
||||
Context("with data", func() {
|
||||
BeforeEach(func() {
|
||||
response.User.Email = "cloudsonic@deluan.com"
|
||||
response.User.Email = "navidrome@deluan.com"
|
||||
response.User.Folder = []int{1}
|
||||
})
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type SearchingController struct {
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/cloudsonic/sonic-server/model"
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/cloudsonic/sonic-server/utils"
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/utils"
|
||||
)
|
||||
|
||||
type StreamController struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package subsonic
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type SystemController struct{}
|
||||
|
||||
@@ -3,7 +3,7 @@ package subsonic
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
)
|
||||
|
||||
type UsersController struct{}
|
||||
|
||||
Reference in New Issue
Block a user