Skip to content

🎧 Your Personal Streaming Service

refactor: rename EnableCoverArtUpload to EnableArtworkUpload

Deluanf33ca753781d
diff --git a/conf/configuration.go b/conf/configuration.go
index 5f74d6db0..a9264d3b7 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -78,7 +78,7 @@ type configOptions struct {
EnableFavourites bool
EnableStarRating bool
EnableUserEditing bool
- EnableCoverArtUpload bool
+ EnableArtworkUpload bool
EnableSharing bool
ShareURL string
DefaultShareExpiration time.Duration
@@ -689,7 +689,7 @@ func setViperDefaults() {
viper.SetDefault("enablereplaygain", true)
viper.SetDefault("enablecoveranimation", true)
viper.SetDefault("enablenowplaying", true)
- viper.SetDefault("enablecoverartupload", true)
+ viper.SetDefault("enableartworkupload", true)
viper.SetDefault("enablesharing", false)
viper.SetDefault("shareurl", "")
viper.SetDefault("defaultshareexpiration", 8760*time.Hour)
diff --git a/server/nativeapi/image_upload.go b/server/nativeapi/image_upload.go
index c29f14bdc..1f55e3851 100644
--- a/server/nativeapi/image_upload.go
+++ b/server/nativeapi/image_upload.go
@@ -24,8 +24,8 @@ const maxImageSize = 10 << 20 // 10MB
func checkImageUploadPermission(w http.ResponseWriter, r *http.Request) bool {
user, _ := request.UserFrom(r.Context())
- if !conf.Server.EnableCoverArtUpload && !user.IsAdmin {
- http.Error(w, "cover art upload is disabled", http.StatusForbidden)
+ if !conf.Server.EnableArtworkUpload && !user.IsAdmin {
+ http.Error(w, "artwork upload is disabled", http.StatusForbidden)
return false
}
return true
diff --git a/server/nativeapi/playlists_test.go b/server/nativeapi/playlists_test.go
index dfe6b9296..e1c933709 100644
--- a/server/nativeapi/playlists_test.go
+++ b/server/nativeapi/playlists_test.go
@@ -28,8 +28,8 @@ var _ = Describe("Playlist Image Endpoints", func() {
})
DescribeTable("uploadPlaylistImage guard",
- func(enableCoverArtUpload, isAdmin bool, expectedStatus int) {
- conf.Server.EnableCoverArtUpload = enableCoverArtUpload
+ func(enableArtworkUpload, isAdmin bool, expectedStatus int) {
+ conf.Server.EnableArtworkUpload = enableArtworkUpload
handler := uploadPlaylistImage(&mockPlaylistsService{})
req := httptest.NewRequest("POST", "/playlist/pls-1/image", nil)
@@ -47,8 +47,8 @@ var _ = Describe("Playlist Image Endpoints", func() {
)
DescribeTable("deletePlaylistImage guard",
- func(enableCoverArtUpload, isAdmin bool, expectedStatus int) {
- conf.Server.EnableCoverArtUpload = enableCoverArtUpload
+ func(enableArtworkUpload, isAdmin bool, expectedStatus int) {
+ conf.Server.EnableArtworkUpload = enableArtworkUpload
handler := deletePlaylistImage(&mockPlaylistsService{})
req := httptest.NewRequest("DELETE", "/playlist/pls-1/image", nil)
diff --git a/server/serve_index.go b/server/serve_index.go
index 6b0c890a6..0d1a2f330 100644
--- a/server/serve_index.go
+++ b/server/serve_index.go
@@ -61,7 +61,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
"losslessFormats": strings.ToUpper(strings.Join(mime.LosslessFormats, ",")),
"devActivityPanel": conf.Server.DevActivityPanel,
"enableUserEditing": conf.Server.EnableUserEditing,
- "enableCoverArtUpload": conf.Server.EnableCoverArtUpload,
+ "enableArtworkUpload": conf.Server.EnableArtworkUpload,
"enableSharing": conf.Server.EnableSharing,
"shareURL": conf.Server.ShareURL,
"defaultDownloadableShare": conf.Server.DefaultDownloadableShare,
diff --git a/server/subsonic/users.go b/server/subsonic/users.go
index 4f6dccaac..8b7406b60 100644
--- a/server/subsonic/users.go
+++ b/server/subsonic/users.go
@@ -22,7 +22,7 @@ func buildUserResponse(user model.User) responses.User {
ScrobblingEnabled: true,
DownloadRole: conf.Server.EnableDownloads,
ShareRole: conf.Server.EnableSharing,
- CoverArtRole: conf.Server.EnableCoverArtUpload || user.IsAdmin,
+ CoverArtRole: conf.Server.EnableArtworkUpload || user.IsAdmin,
Folder: slice.Map(user.Libraries, func(lib model.Library) int32 { return int32(lib.ID) }),
}
diff --git a/server/subsonic/users_test.go b/server/subsonic/users_test.go
index 1fd5dce71..2d08b3377 100644
--- a/server/subsonic/users_test.go
+++ b/server/subsonic/users_test.go
@@ -105,8 +105,8 @@ var _ = Describe("Users", func() {
)
DescribeTable("CoverArt role permissions",
- func(enableCoverArtUpload, isAdmin, expectedCoverArtRole bool) {
- conf.Server.EnableCoverArtUpload = enableCoverArtUpload
+ func(enableArtworkUpload, isAdmin, expectedCoverArtRole bool) {
+ conf.Server.EnableArtworkUpload = enableArtworkUpload
testUser.IsAdmin = isAdmin
response := buildUserResponse(testUser)
diff --git a/ui/src/common/ImageUploadOverlay.jsx b/ui/src/common/ImageUploadOverlay.jsx
index e0d0d0a9a..a370e40fe 100644
--- a/ui/src/common/ImageUploadOverlay.jsx
+++ b/ui/src/common/ImageUploadOverlay.jsx
@@ -49,7 +49,7 @@ export const ImageUploadOverlay = ({
const fileInputRef = useRef(null)
const canEdit =
- config.enableCoverArtUpload || localStorage.getItem('role') === 'admin'
+ config.enableArtworkUpload || localStorage.getItem('role') === 'admin'
const handleUploadClick = useCallback((e) => {
e.stopPropagation()
diff --git a/ui/src/config.js b/ui/src/config.js
index 0672a58f4..bd11d7df6 100644
--- a/ui/src/config.js
+++ b/ui/src/config.js
@@ -22,7 +22,7 @@ const defaultConfig = {
defaultUIVolume: 100,
uiSearchDebounceMs: 200,
enableUserEditing: true,
- enableCoverArtUpload: true,
+ enableArtworkUpload: true,
enableSharing: true,
shareURL: '',
defaultDownloadableShare: true,