From c417a00e62886ceb6839b185549fbb25e89ecb2b Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 1 Apr 2017 09:47:14 -0400 Subject: [PATCH] Renamed project to CloudSonic --- .gitignore | 5 ++--- .travis.yml | 6 +++--- README.md | 15 ++++++++------- api/album_lists.go | 6 +++--- api/album_lists_test.go | 12 ++++++------ api/api_test.go | 2 +- api/base_api_controller.go | 9 ++++----- api/browsing.go | 12 ++++++------ api/browsing_test.go | 12 ++++++------ api/media_annotation.go | 8 ++++---- api/media_retrieval.go | 8 ++++---- api/media_retrieval_test.go | 13 ++++++------- api/playlists.go | 8 ++++---- api/responses/responses_test.go | 10 +++++----- api/searching.go | 6 +++--- api/stream.go | 8 ++++---- api/stream_test.go | 13 ++++++------- api/system.go | 2 +- api/system_test.go | 4 ++-- api/users.go | 2 +- api/validation.go | 10 +++++----- api/validation_test.go | 4 ++-- conf/app.conf | 4 ++-- conf/configuration.go | 18 +++++++++--------- controllers/main_test.go | 4 ++-- controllers/sync.go | 2 +- domain/index.go | 2 +- engine/browser.go | 4 ++-- engine/common.go | 2 +- engine/cover.go | 2 +- engine/cover_test.go | 11 +++++------ engine/list_generator.go | 4 ++-- engine/playlists.go | 4 ++-- engine/ratings.go | 6 +++--- engine/scrobbler.go | 4 ++-- engine/scrobbler_test.go | 8 ++++---- engine/search.go | 2 +- engine/stream.go | 6 +++--- engine/stream_test.go | 2 +- init/inject_definitions.go | 13 ++++++------- init/router.go | 5 ++--- main.go | 12 ++++++------ persistence/album_repository.go | 2 +- persistence/artist_repository.go | 2 +- persistence/checksum_repository.go | 2 +- persistence/index_repository.go | 2 +- persistence/index_repository_test.go | 4 ++-- persistence/ledis.go | 4 ++-- persistence/ledis_repository.go | 4 ++-- persistence/ledis_repository_test.go | 6 +++--- persistence/mediafile_repository.go | 3 +-- persistence/mediafolders_repository.go | 6 +++--- persistence/mock_album_repo.go | 2 +- persistence/mock_artist_repo.go | 2 +- persistence/mock_index_repo.go | 2 +- persistence/mock_mediafile_repo.go | 2 +- persistence/nowplaying_repository.go | 2 +- persistence/playlist_repository.go | 2 +- persistence/property_repository.go | 4 ++-- scanner/importer.go | 14 +++++++------- scanner/importer_test.go | 9 +++++---- scanner/itunes_scanner.go | 8 ++++---- tasks/scan.go | 2 +- tests/init_tests.go | 6 +++--- tests/matchers.go | 2 +- tests/{gosonic-test.toml => sonic-test.toml} | 0 utils/strings.go | 4 ++-- 67 files changed, 190 insertions(+), 196 deletions(-) rename tests/{gosonic-test.toml => sonic-test.toml} (100%) diff --git a/.gitignore b/.gitignore index 5f29dcbe9..26981051b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/gosonic +/sonic-server /iTunes*.xml static/Jamstash devDb @@ -6,7 +6,6 @@ devDb vendor/*/ wiki TODO.md -gosonic.log var Artwork -gosonic.toml \ No newline at end of file +sonic.toml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 110e2af0e..a9419b39b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: go go: - - 1.7 - - tip + - 1.8 +# - tip before_install: - go get github.com/kardianos/govendor @@ -15,4 +15,4 @@ script: notifications: email: - - gosonic@deluan.com + - cloudsonic@deluan.com diff --git a/README.md b/README.md index d2448c62c..5067f1e1e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -GoSonic +CloudSonic Server ======= -[![Build Status](https://travis-ci.org/deluan/gosonic.svg?branch=master)](https://travis-ci.org/deluan/gosonic) [![Go Report Card](https://goreportcard.com/badge/github.com/deluan/gosonic)](https://goreportcard.com/report/github.com/deluan/gosonic) +[![Build Status](https://travis-ci.org/cloudsonic/sonic-server.svg?branch=master)](https://travis-ci.org/cloudsonic/sonic-server) +[![Go Report Card](https://goreportcard.com/badge/github.com/cloudsonic/sonic-server)](https://goreportcard.com/report/github.com/cloudsonic/sonic-server) __This is still a work in progress, and has no releases available__ -GoSonic is an application that implements the [Subsonic API](http://www.subsonic.org/pages/api.jsp), but instead of +CloudSonic is an application that implements the [Subsonic API](http://www.subsonic.org/pages/api.jsp), but instead of having its own music library like the original [Subsonic application](http://www.subsonic.org), it interacts directly with your iTunes library. @@ -26,14 +27,14 @@ The project's main goals are: I'm currently trying to implement all functionality from API v1.8.0, with some exceptions. -Check the (almost) up to date [compatibility chart](https://github.com/deluan/gosonic/wiki/Compatibility) for what is working. +Check the (almost) up to date [compatibility chart](https://github.com/cloudsonic/sonic-server/wiki/Compatibility) for what is working. ### Installation -As this is a work in progress, there are no installers yet. To have GoSonic running in your computer, follow the steps in the +As this is a work in progress, there are no installers yet. To have the server running in your computer, follow the steps in the Development Environment section below, then run it with: ``` -$ export GOSONIC_MUSICFOLDER="/path/to/your/iTunes Library.xml" +$ export SONIC_MUSICFOLDER="/path/to/your/iTunes Library.xml" $ bee run ``` The server should start listening on port 4533. @@ -60,6 +61,6 @@ $ make test ### Copying -GoSonic - Copyright (C) 2017 Deluan Cotts Quintao +CloudSonic - Copyright (C) 2017 Deluan Cotts Quintao The source code is licensed under GNU Affero GPL v3. License is available [here](/LICENSE) diff --git a/api/album_lists.go b/api/album_lists.go index 04a21e382..b660e05d8 100644 --- a/api/album_lists.go +++ b/api/album_lists.go @@ -4,9 +4,9 @@ import ( "errors" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type AlbumListController struct { diff --git a/api/album_lists_test.go b/api/album_lists_test.go index 27f302a8e..5eca6f154 100644 --- a/api/album_lists_test.go +++ b/api/album_lists_test.go @@ -3,12 +3,12 @@ package api_test import ( "testing" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" . "github.com/smartystreets/goconvey/convey" ) diff --git a/api/api_test.go b/api/api_test.go index ff34fe55f..016aef882 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/astaxie/beego" - _ "github.com/deluan/gosonic/init" + _ "github.com/cloudsonic/sonic-server/init" ) const ( diff --git a/api/base_api_controller.go b/api/base_api_controller.go index 3a4cac8d7..03768da5f 100644 --- a/api/base_api_controller.go +++ b/api/base_api_controller.go @@ -3,14 +3,13 @@ package api import ( "encoding/xml" "fmt" + "strconv" "time" - "strconv" - "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type BaseAPIController struct{ beego.Controller } diff --git a/api/browsing.go b/api/browsing.go index b433db648..2d6e1a083 100644 --- a/api/browsing.go +++ b/api/browsing.go @@ -5,11 +5,11 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/conf" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/conf" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type BrowsingController struct { @@ -41,7 +41,7 @@ func (c *BrowsingController) getArtistIndex(ifModifiedSince time.Time) responses } res := responses.Indexes{ - IgnoredArticles: conf.GoSonic.IgnoredArticles, + IgnoredArticles: conf.Sonic.IgnoredArticles, LastModified: fmt.Sprint(utils.ToMillis(lastModified)), } diff --git a/api/browsing_test.go b/api/browsing_test.go index f6ae04076..ef7f731e5 100644 --- a/api/browsing_test.go +++ b/api/browsing_test.go @@ -3,12 +3,12 @@ package api_test import ( "testing" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" . "github.com/smartystreets/goconvey/convey" ) diff --git a/api/media_annotation.go b/api/media_annotation.go index 8b4840c2e..259281e66 100644 --- a/api/media_annotation.go +++ b/api/media_annotation.go @@ -5,10 +5,10 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type MediaAnnotationController struct { diff --git a/api/media_retrieval.go b/api/media_retrieval.go index 5f3537698..81260bb68 100644 --- a/api/media_retrieval.go +++ b/api/media_retrieval.go @@ -5,10 +5,10 @@ import ( "os" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type MediaRetrievalController struct { diff --git a/api/media_retrieval_test.go b/api/media_retrieval_test.go index 0c4e81931..54c739fa4 100644 --- a/api/media_retrieval_test.go +++ b/api/media_retrieval_test.go @@ -1,18 +1,17 @@ package api_test import ( - "testing" - "fmt" "net/http" "net/http/httptest" + "testing" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" . "github.com/smartystreets/goconvey/convey" ) diff --git a/api/playlists.go b/api/playlists.go index 0e15437d9..e5e178d87 100644 --- a/api/playlists.go +++ b/api/playlists.go @@ -4,10 +4,10 @@ import ( "fmt" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type PlaylistsController struct { diff --git a/api/responses/responses_test.go b/api/responses/responses_test.go index 559fd959a..50c26deac 100644 --- a/api/responses/responses_test.go +++ b/api/responses/responses_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - . "github.com/deluan/gosonic/api/responses" - . "github.com/deluan/gosonic/tests" + . "github.com/cloudsonic/sonic-server/api/responses" + . "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) @@ -163,13 +163,13 @@ func TestSubsonicResponses(t *testing.T) { }) }) Convey("With optional fields", func() { - response.User.Email = "gosonic@deluan.com" + response.User.Email = "cloudsonic@deluan.com" response.User.Folder = []int{1} Convey("XML", func() { - So(response, ShouldMatchXML, `1`) + So(response, ShouldMatchXML, `1`) }) Convey("JSON", func() { - So(response, ShouldMatchJSON, `{"status":"ok","user":{"adminRole":false,"commentRole":false,"coverArtRole":false,"downloadRole":false,"email":"gosonic@deluan.com","folder":[1],"jukeboxRole":false,"playlistRole":false,"podcastRole":false,"scrobblingEnabled":false,"settingsRole":false,"shareRole":false,"streamRole":false,"uploadRole":false,"username":"deluan","videoConversionRole":false},"version":"1.0.0"}`) + So(response, ShouldMatchJSON, `{"status":"ok","user":{"adminRole":false,"commentRole":false,"coverArtRole":false,"downloadRole":false,"email":"cloudsonic@deluan.com","folder":[1],"jukeboxRole":false,"playlistRole":false,"podcastRole":false,"scrobblingEnabled":false,"settingsRole":false,"shareRole":false,"streamRole":false,"uploadRole":false,"username":"deluan","videoConversionRole":false},"version":"1.0.0"}`) }) }) }) diff --git a/api/searching.go b/api/searching.go index d1cb6d147..36dee58c3 100644 --- a/api/searching.go +++ b/api/searching.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type SearchingController struct { diff --git a/api/stream.go b/api/stream.go index 9da3fca63..d92a60990 100644 --- a/api/stream.go +++ b/api/stream.go @@ -2,10 +2,10 @@ package api import ( "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type StreamController struct { diff --git a/api/stream_test.go b/api/stream_test.go index 3551c3c20..4cc63a147 100644 --- a/api/stream_test.go +++ b/api/stream_test.go @@ -1,18 +1,17 @@ package api_test import ( - "testing" - "fmt" "net/http" "net/http/httptest" + "testing" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" . "github.com/smartystreets/goconvey/convey" ) diff --git a/api/system.go b/api/system.go index 33d346c0b..f7b3af4d0 100644 --- a/api/system.go +++ b/api/system.go @@ -1,6 +1,6 @@ package api -import "github.com/deluan/gosonic/api/responses" +import "github.com/cloudsonic/sonic-server/api/responses" type SystemController struct{ BaseAPIController } diff --git a/api/system_test.go b/api/system_test.go index 067791fd6..a568b2314 100644 --- a/api/system_test.go +++ b/api/system_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - "github.com/deluan/gosonic/api/responses" - . "github.com/deluan/gosonic/tests" + "github.com/cloudsonic/sonic-server/api/responses" + . "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/api/users.go b/api/users.go index b2f616c05..3f52340fe 100644 --- a/api/users.go +++ b/api/users.go @@ -1,6 +1,6 @@ package api -import "github.com/deluan/gosonic/api/responses" +import "github.com/cloudsonic/sonic-server/api/responses" type UsersController struct{ BaseAPIController } diff --git a/api/validation.go b/api/validation.go index 0d8616fd9..e4fcb1831 100644 --- a/api/validation.go +++ b/api/validation.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/astaxie/beego" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/conf" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/conf" ) type ControllerInterface interface { @@ -18,7 +18,7 @@ type ControllerInterface interface { } func Validate(controller BaseAPIController) { - if !conf.GoSonic.DisableValidation { + if !conf.Sonic.DisableValidation { checkParameters(controller) authenticate(controller) // TODO Validate version @@ -41,7 +41,7 @@ func checkParameters(c BaseAPIController) { } func authenticate(c BaseAPIController) { - password := conf.GoSonic.Password + password := conf.Sonic.Password user := c.GetString("u") pass := c.GetString("p") salt := c.GetString("s") @@ -62,7 +62,7 @@ func authenticate(c BaseAPIController) { valid = (t == token) } - if user != conf.GoSonic.User || !valid { + if user != conf.Sonic.User || !valid { logWarn(c, fmt.Sprintf(`Invalid login for user "%s"`, user)) abortRequest(c, responses.ErrorAuthenticationFail) } diff --git a/api/validation_test.go b/api/validation_test.go index 6689c7855..cc1413473 100644 --- a/api/validation_test.go +++ b/api/validation_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/deluan/gosonic/api/responses" - "github.com/deluan/gosonic/tests" + "github.com/cloudsonic/sonic-server/api/responses" + "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/conf/app.conf b/conf/app.conf index 127171256..33ae67b5a 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -1,5 +1,5 @@ -appname = github.com/deluan/gosonic -serverName = GoSonic +appname = github.com/cloudsonic/sonic-server +serverName = CloudSonic runMode = dev autoRender = false copyRequestBody = true diff --git a/conf/configuration.go b/conf/configuration.go index 34676f282..3e85a06b9 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -7,7 +7,7 @@ import ( "github.com/koding/multiconfig" ) -type goSonic struct { +type sonic struct { Port int `default:"4533"` MusicFolder string `default:"./iTunes1.xml"` DbPath string `default:"./devDb"` @@ -26,32 +26,32 @@ type goSonic struct { RunMode string `default:"dev"` } -var GoSonic *goSonic +var Sonic *sonic func LoadFromFlags() { l := &multiconfig.FlagLoader{} - l.Load(GoSonic) + l.Load(Sonic) } func LoadFromFile(tomlFile string) { l := &multiconfig.TOMLLoader{Path: tomlFile} - err := l.Load(GoSonic) + err := l.Load(Sonic) if err != nil { fmt.Printf("Error loading %s: %v\n", tomlFile, err) } } func LoadFromLocalFile() { - if _, err := os.Stat("./gosonic.toml"); err == nil { - LoadFromFile("./gosonic.toml") + if _, err := os.Stat("./sonic.toml"); err == nil { + LoadFromFile("./sonic.toml") } } func init() { - GoSonic = new(goSonic) + Sonic = new(sonic) var l multiconfig.Loader l = &multiconfig.TagLoader{} - l.Load(GoSonic) + l.Load(Sonic) l = &multiconfig.EnvironmentLoader{} - l.Load(GoSonic) + l.Load(Sonic) } diff --git a/controllers/main_test.go b/controllers/main_test.go index 7b1a5a6bd..72bcae038 100644 --- a/controllers/main_test.go +++ b/controllers/main_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/astaxie/beego" - _ "github.com/deluan/gosonic/init" - "github.com/deluan/gosonic/tests" + _ "github.com/cloudsonic/sonic-server/init" + "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/controllers/sync.go b/controllers/sync.go index 6877b57bd..2c7117a0a 100644 --- a/controllers/sync.go +++ b/controllers/sync.go @@ -2,7 +2,7 @@ package controllers import ( "github.com/astaxie/beego" - "github.com/deluan/gosonic/scanner" + "github.com/cloudsonic/sonic-server/scanner" ) type SyncController struct{ beego.Controller } diff --git a/domain/index.go b/domain/index.go index 48c840517..57be54e38 100644 --- a/domain/index.go +++ b/domain/index.go @@ -1,6 +1,6 @@ package domain -import "github.com/deluan/gosonic/utils" +import "github.com/cloudsonic/sonic-server/utils" type ArtistInfo struct { ArtistId string diff --git a/engine/browser.go b/engine/browser.go index 2f22ea4ac..bd69de2b5 100644 --- a/engine/browser.go +++ b/engine/browser.go @@ -6,8 +6,8 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/utils" ) type Browser interface { diff --git a/engine/common.go b/engine/common.go index 7e4873917..2e617e5fa 100644 --- a/engine/common.go +++ b/engine/common.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type Entry struct { diff --git a/engine/cover.go b/engine/cover.go index 5a10c0347..2f1ee3f19 100644 --- a/engine/cover.go +++ b/engine/cover.go @@ -10,7 +10,7 @@ import ( "os" "strings" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" "github.com/dhowden/tag" "github.com/nfnt/resize" ) diff --git a/engine/cover_test.go b/engine/cover_test.go index 953713db6..8124dba84 100644 --- a/engine/cover_test.go +++ b/engine/cover_test.go @@ -1,15 +1,14 @@ package engine_test import ( - "testing" - "bytes" "image" + "testing" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/engine/list_generator.go b/engine/list_generator.go index 320463321..0380947a3 100644 --- a/engine/list_generator.go +++ b/engine/list_generator.go @@ -4,8 +4,8 @@ import ( "math/rand" "time" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/utils" ) type ListGenerator interface { diff --git a/engine/playlists.go b/engine/playlists.go index e929d0078..d05643382 100644 --- a/engine/playlists.go +++ b/engine/playlists.go @@ -5,8 +5,8 @@ import ( "sort" "github.com/astaxie/beego" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/itunesbridge" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/itunesbridge" ) type Playlists interface { diff --git a/engine/ratings.go b/engine/ratings.go index 07678a26f..d544fbd46 100644 --- a/engine/ratings.go +++ b/engine/ratings.go @@ -2,9 +2,9 @@ package engine import ( "github.com/astaxie/beego" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/itunesbridge" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/itunesbridge" + "github.com/cloudsonic/sonic-server/utils" ) type Ratings interface { diff --git a/engine/scrobbler.go b/engine/scrobbler.go index bb742a40c..131a39e85 100644 --- a/engine/scrobbler.go +++ b/engine/scrobbler.go @@ -6,8 +6,8 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/itunesbridge" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/itunesbridge" ) const ( diff --git a/engine/scrobbler_test.go b/engine/scrobbler_test.go index e0b56992d..dee58a21c 100644 --- a/engine/scrobbler_test.go +++ b/engine/scrobbler_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/itunesbridge" - "github.com/deluan/gosonic/persistence" - . "github.com/deluan/gosonic/tests" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/itunesbridge" + "github.com/cloudsonic/sonic-server/persistence" + . "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" "github.com/syndtr/goleveldb/leveldb/errors" ) diff --git a/engine/search.go b/engine/search.go index e4a41cae8..b00a834aa 100644 --- a/engine/search.go +++ b/engine/search.go @@ -4,8 +4,8 @@ import ( "strings" "github.com/astaxie/beego" + "github.com/cloudsonic/sonic-server/domain" "github.com/deluan/gomate" - "github.com/deluan/gosonic/domain" "github.com/kennygrant/sanitize" ) diff --git a/engine/stream.go b/engine/stream.go index 86677078d..7330261bf 100644 --- a/engine/stream.go +++ b/engine/stream.go @@ -8,14 +8,14 @@ import ( "strings" "github.com/astaxie/beego" - "github.com/deluan/gosonic/conf" + "github.com/cloudsonic/sonic-server/conf" ) // TODO Encapsulate as a io.Reader func Stream(path string, bitRate int, maxBitRate int, w io.Writer) error { var f io.Reader var err error - enabled := !conf.GoSonic.DisableDownsampling + enabled := !conf.Sonic.DisableDownsampling if enabled && maxBitRate > 0 && bitRate > maxBitRate { f, err = downsample(path, maxBitRate) } else { @@ -45,7 +45,7 @@ func downsample(path string, maxBitRate int) (f io.Reader, err error) { } func createDownsamplingCommand(path string, maxBitRate int) (string, []string) { - cmd := conf.GoSonic.DownsampleCommand + cmd := conf.Sonic.DownsampleCommand split := strings.Split(cmd, " ") for i, s := range split { diff --git a/engine/stream_test.go b/engine/stream_test.go index ee03bf596..5ea366ab8 100644 --- a/engine/stream_test.go +++ b/engine/stream_test.go @@ -3,7 +3,7 @@ package engine import ( "testing" - . "github.com/deluan/gosonic/tests" + . "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/init/inject_definitions.go b/init/inject_definitions.go index 8985218ff..eebb53d75 100644 --- a/init/inject_definitions.go +++ b/init/inject_definitions.go @@ -1,15 +1,14 @@ package init import ( + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/itunesbridge" + "github.com/cloudsonic/sonic-server/persistence" + "github.com/cloudsonic/sonic-server/scanner" + "github.com/cloudsonic/sonic-server/utils" "github.com/deluan/gomate" "github.com/deluan/gomate/ledis" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/persistence" - "github.com/deluan/gosonic/utils" - - "github.com/deluan/gosonic/itunesbridge" - "github.com/deluan/gosonic/scanner" ) func init() { diff --git a/init/router.go b/init/router.go index 9c0caba2d..3fb39bf8e 100644 --- a/init/router.go +++ b/init/router.go @@ -1,12 +1,11 @@ package init import ( - "github.com/deluan/gosonic/api" - "github.com/astaxie/beego" "github.com/astaxie/beego/context" "github.com/astaxie/beego/plugins/cors" - "github.com/deluan/gosonic/controllers" + "github.com/cloudsonic/sonic-server/api" + "github.com/cloudsonic/sonic-server/controllers" ) func init() { diff --git a/main.go b/main.go index 57ecb1eb0..aeec16a42 100644 --- a/main.go +++ b/main.go @@ -4,19 +4,19 @@ import ( "fmt" "github.com/astaxie/beego" - "github.com/deluan/gosonic/conf" - _ "github.com/deluan/gosonic/init" - _ "github.com/deluan/gosonic/tasks" + "github.com/cloudsonic/sonic-server/conf" + _ "github.com/cloudsonic/sonic-server/init" + _ "github.com/cloudsonic/sonic-server/tasks" ) func main() { conf.LoadFromLocalFile() conf.LoadFromFlags() - beego.BConfig.RunMode = conf.GoSonic.RunMode - beego.BConfig.Listen.HTTPPort = conf.GoSonic.Port + beego.BConfig.RunMode = conf.Sonic.RunMode + beego.BConfig.Listen.HTTPPort = conf.Sonic.Port - fmt.Printf("\nGoSonic v%s (%s mode)\n\n", "0.1", beego.BConfig.RunMode) + fmt.Printf("\nCloudSonic Server v%s (%s mode)\n\n", "0.1", beego.BConfig.RunMode) if beego.BConfig.RunMode == "prod" { beego.SetLevel(beego.LevelInformational) } diff --git a/persistence/album_repository.go b/persistence/album_repository.go index 010dc0333..b93b7c5ad 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -4,7 +4,7 @@ import ( "errors" "time" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type albumRepository struct { diff --git a/persistence/artist_repository.go b/persistence/artist_repository.go index c8a0e35cb..ec25ce4a0 100644 --- a/persistence/artist_repository.go +++ b/persistence/artist_repository.go @@ -3,7 +3,7 @@ package persistence import ( "errors" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type artistRepository struct { diff --git a/persistence/checksum_repository.go b/persistence/checksum_repository.go index 13e4b61fa..f110aab8a 100644 --- a/persistence/checksum_repository.go +++ b/persistence/checksum_repository.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/astaxie/beego" - "github.com/deluan/gosonic/scanner" + "github.com/cloudsonic/sonic-server/scanner" "github.com/siddontang/ledisdb/ledis" ) diff --git a/persistence/index_repository.go b/persistence/index_repository.go index 0e030537f..068380825 100644 --- a/persistence/index_repository.go +++ b/persistence/index_repository.go @@ -4,7 +4,7 @@ import ( "errors" "sort" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type artistIndexRepository struct { diff --git a/persistence/index_repository_test.go b/persistence/index_repository_test.go index a6c8c7817..c849eb7a1 100644 --- a/persistence/index_repository_test.go +++ b/persistence/index_repository_test.go @@ -4,8 +4,8 @@ import ( "strconv" "testing" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/tests" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/tests" . "github.com/smartystreets/goconvey/convey" ) diff --git a/persistence/ledis.go b/persistence/ledis.go index 99500b04d..a864690be 100644 --- a/persistence/ledis.go +++ b/persistence/ledis.go @@ -3,7 +3,7 @@ package persistence import ( "sync" - "github.com/deluan/gosonic/conf" + "github.com/cloudsonic/sonic-server/conf" "github.com/siddontang/ledisdb/config" "github.com/siddontang/ledisdb/ledis" ) @@ -17,7 +17,7 @@ var ( func Db() *ledis.DB { once.Do(func() { config := config.NewConfigDefault() - config.DataDir = conf.GoSonic.DbPath + config.DataDir = conf.Sonic.DbPath l, _ := ledis.Open(config) instance, err := l.Select(0) if err != nil { diff --git a/persistence/ledis_repository.go b/persistence/ledis_repository.go index 194ac1f13..2897c61c4 100644 --- a/persistence/ledis_repository.go +++ b/persistence/ledis_repository.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/utils" "github.com/siddontang/ledisdb/ledis" ) diff --git a/persistence/ledis_repository_test.go b/persistence/ledis_repository_test.go index 8352945fb..33c31ad9c 100644 --- a/persistence/ledis_repository_test.go +++ b/persistence/ledis_repository_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" . "github.com/smartystreets/goconvey/convey" ) diff --git a/persistence/mediafile_repository.go b/persistence/mediafile_repository.go index 83b9aa95e..cff7eee86 100644 --- a/persistence/mediafile_repository.go +++ b/persistence/mediafile_repository.go @@ -3,10 +3,9 @@ package persistence import ( "errors" "sort" - "time" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type mediaFileRepository struct { diff --git a/persistence/mediafolders_repository.go b/persistence/mediafolders_repository.go index 68039674c..62f7f4c5f 100644 --- a/persistence/mediafolders_repository.go +++ b/persistence/mediafolders_repository.go @@ -1,8 +1,8 @@ package persistence import ( - "github.com/deluan/gosonic/conf" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/conf" + "github.com/cloudsonic/sonic-server/domain" ) type mediaFolderRepository struct { @@ -14,7 +14,7 @@ func NewMediaFolderRepository() domain.MediaFolderRepository { } func (*mediaFolderRepository) GetAll() (domain.MediaFolders, error) { - mediaFolder := domain.MediaFolder{Id: "0", Name: "iTunes Library", Path: conf.GoSonic.MusicFolder} + mediaFolder := domain.MediaFolder{Id: "0", Name: "iTunes Library", Path: conf.Sonic.MusicFolder} result := make(domain.MediaFolders, 1) result[0] = mediaFolder return result, nil diff --git a/persistence/mock_album_repo.go b/persistence/mock_album_repo.go index 87741ccaf..6cb151913 100644 --- a/persistence/mock_album_repo.go +++ b/persistence/mock_album_repo.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) func CreateMockAlbumRepo() *MockAlbum { diff --git a/persistence/mock_artist_repo.go b/persistence/mock_artist_repo.go index fec229632..54fdd59c9 100644 --- a/persistence/mock_artist_repo.go +++ b/persistence/mock_artist_repo.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) func CreateMockArtistRepo() *MockArtist { diff --git a/persistence/mock_index_repo.go b/persistence/mock_index_repo.go index 556916370..81672efa9 100644 --- a/persistence/mock_index_repo.go +++ b/persistence/mock_index_repo.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) func CreateMockArtistIndexRepo() *MockArtistIndex { diff --git a/persistence/mock_mediafile_repo.go b/persistence/mock_mediafile_repo.go index 0ebc7587e..ea64f2621 100644 --- a/persistence/mock_mediafile_repo.go +++ b/persistence/mock_mediafile_repo.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) func CreateMockMediaFileRepo() *MockMediaFile { diff --git a/persistence/nowplaying_repository.go b/persistence/nowplaying_repository.go index 141480a70..d61dcfda4 100644 --- a/persistence/nowplaying_repository.go +++ b/persistence/nowplaying_repository.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - "github.com/deluan/gosonic/engine" + "github.com/cloudsonic/sonic-server/engine" ) var ( diff --git a/persistence/playlist_repository.go b/persistence/playlist_repository.go index 21760cc57..b69d681e0 100644 --- a/persistence/playlist_repository.go +++ b/persistence/playlist_repository.go @@ -3,7 +3,7 @@ package persistence import ( "errors" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/domain" ) type playlistRepository struct { diff --git a/persistence/property_repository.go b/persistence/property_repository.go index be4db62ad..336850f5e 100644 --- a/persistence/property_repository.go +++ b/persistence/property_repository.go @@ -3,8 +3,8 @@ package persistence import ( "errors" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" ) type propertyRepository struct { diff --git a/scanner/importer.go b/scanner/importer.go index 85abb9d93..23280a917 100644 --- a/scanner/importer.go +++ b/scanner/importer.go @@ -8,10 +8,10 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/conf" - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/engine" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/conf" + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/engine" + "github.com/cloudsonic/sonic-server/utils" ) type Scanner interface { @@ -50,7 +50,7 @@ func CheckForUpdates(force bool) { func startImport() { go func() { - itunesLibrary = conf.GoSonic.MusicFolder + itunesLibrary = conf.Sonic.MusicFolder info, err := os.Stat(itunesLibrary) if err != nil { @@ -264,7 +264,7 @@ func (i *Importer) importArtists() domain.Artists { } func (i *Importer) importArtistIndex() { - indexGroups := utils.ParseIndexGroups(conf.GoSonic.IndexGroups) + indexGroups := utils.ParseIndexGroups(conf.Sonic.IndexGroups) artistIndex := make(map[string]tempIndex) for _, ar := range i.scanner.Artists() { @@ -281,7 +281,7 @@ func (i *Importer) importPlaylists() domain.Playlists { j := 0 for _, pl := range i.scanner.Playlists() { pl.Public = true - pl.Owner = conf.GoSonic.User + pl.Owner = conf.Sonic.User pl.Comment = "Original: " + pl.FullPath pls[j] = *pl j++ diff --git a/scanner/importer_test.go b/scanner/importer_test.go index 2c2c57a14..6c703cf2d 100644 --- a/scanner/importer_test.go +++ b/scanner/importer_test.go @@ -1,11 +1,12 @@ package scanner import ( - "github.com/deluan/gosonic/domain" - "github.com/deluan/gosonic/tests" - "github.com/deluan/gosonic/utils" - . "github.com/smartystreets/goconvey/convey" "testing" + + "github.com/cloudsonic/sonic-server/domain" + "github.com/cloudsonic/sonic-server/tests" + "github.com/cloudsonic/sonic-server/utils" + . "github.com/smartystreets/goconvey/convey" ) func TestCollectIndex(t *testing.T) { diff --git a/scanner/itunes_scanner.go b/scanner/itunes_scanner.go index 55ba52a31..a22eb7ea7 100644 --- a/scanner/itunes_scanner.go +++ b/scanner/itunes_scanner.go @@ -14,8 +14,8 @@ import ( "time" "github.com/astaxie/beego" - "github.com/deluan/gosonic/conf" - "github.com/deluan/gosonic/domain" + "github.com/cloudsonic/sonic-server/conf" + "github.com/cloudsonic/sonic-server/domain" "github.com/deluan/itl" "github.com/dhowden/tag" ) @@ -103,8 +103,8 @@ func (s *ItunesScanner) ScanLibrary(lastModifiedSince time.Time, path string) (i beego.Debug("Saved", len(s.newSums), "checksums") } - ignFolders := conf.GoSonic.PlsIgnoreFolders - ignPatterns := strings.Split(conf.GoSonic.PlsIgnoredPatterns, ";") + ignFolders := conf.Sonic.PlsIgnoreFolders + ignPatterns := strings.Split(conf.Sonic.PlsIgnoredPatterns, ";") for _, p := range l.Playlists { rel := plsRelation{pID: p.PlaylistPersistentID, parentPID: p.ParentPersistentID, name: unescape(p.Name)} s.pplaylists[p.PlaylistPersistentID] = rel diff --git a/tasks/scan.go b/tasks/scan.go index 5cadf387f..24e3d9b48 100644 --- a/tasks/scan.go +++ b/tasks/scan.go @@ -5,7 +5,7 @@ import ( "github.com/astaxie/beego" "github.com/astaxie/beego/toolbox" - "github.com/deluan/gosonic/scanner" + "github.com/cloudsonic/sonic-server/scanner" ) const TaskItunesScan = "iTunes Library Scanner" diff --git a/tests/init_tests.go b/tests/init_tests.go index 7fac7f2c2..a08b80c42 100644 --- a/tests/init_tests.go +++ b/tests/init_tests.go @@ -7,12 +7,12 @@ import ( "testing" "github.com/astaxie/beego" - "github.com/deluan/gosonic/conf" - "github.com/deluan/gosonic/utils" + "github.com/cloudsonic/sonic-server/conf" + "github.com/cloudsonic/sonic-server/utils" ) func Init(t *testing.T, skipOnShort bool) { - conf.LoadFromFile("../tests/gosonic-test.toml") + conf.LoadFromFile("../tests/sonic-test.toml") if skipOnShort && testing.Short() { t.Skip("skipping test in short mode.") } diff --git a/tests/matchers.go b/tests/matchers.go index f5dc161d8..904aeed9c 100644 --- a/tests/matchers.go +++ b/tests/matchers.go @@ -7,7 +7,7 @@ import ( "encoding/xml" "fmt" - "github.com/deluan/gosonic/api/responses" + "github.com/cloudsonic/sonic-server/api/responses" "github.com/smartystreets/goconvey/convey" ) diff --git a/tests/gosonic-test.toml b/tests/sonic-test.toml similarity index 100% rename from tests/gosonic-test.toml rename to tests/sonic-test.toml diff --git a/utils/strings.go b/utils/strings.go index 8b5deff8a..92d93db29 100644 --- a/utils/strings.go +++ b/utils/strings.go @@ -3,11 +3,11 @@ package utils import ( "strings" - "github.com/deluan/gosonic/conf" + "github.com/cloudsonic/sonic-server/conf" ) func NoArticle(name string) string { - articles := strings.Split(conf.GoSonic.IgnoredArticles, " ") + articles := strings.Split(conf.Sonic.IgnoredArticles, " ") for _, a := range articles { n := strings.TrimPrefix(name, a+" ") if n != name {