feat: imported playlists are public by default (#3143)
* feat: imported playlists are public by default * chore: make linter happy --------- Co-authored-by: John White <john@activecode.dev>
This commit is contained in:
@@ -47,6 +47,7 @@ type configOptions struct {
|
|||||||
AlbumPlayCountMode string
|
AlbumPlayCountMode string
|
||||||
EnableArtworkPrecache bool
|
EnableArtworkPrecache bool
|
||||||
AutoImportPlaylists bool
|
AutoImportPlaylists bool
|
||||||
|
DefaultPlaylistPublicVisibility bool
|
||||||
PlaylistsPath string
|
PlaylistsPath string
|
||||||
AutoTranscodeDownload bool
|
AutoTranscodeDownload bool
|
||||||
DefaultDownsamplingFormat string
|
DefaultDownsamplingFormat string
|
||||||
@@ -299,6 +300,7 @@ func init() {
|
|||||||
viper.SetDefault("albumplaycountmode", consts.AlbumPlayCountModeAbsolute)
|
viper.SetDefault("albumplaycountmode", consts.AlbumPlayCountModeAbsolute)
|
||||||
viper.SetDefault("enableartworkprecache", true)
|
viper.SetDefault("enableartworkprecache", true)
|
||||||
viper.SetDefault("autoimportplaylists", true)
|
viper.SetDefault("autoimportplaylists", true)
|
||||||
|
viper.SetDefault("defaultplaylistpublicvisibility", true)
|
||||||
viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)
|
viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)
|
||||||
viper.SetDefault("enabledownloads", true)
|
viper.SetDefault("enabledownloads", true)
|
||||||
viper.SetDefault("enableexternalservices", true)
|
viper.SetDefault("enableexternalservices", true)
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/navidrome/navidrome/conf"
|
||||||
|
|
||||||
"github.com/RaveNoX/go-jsoncommentstrip"
|
"github.com/RaveNoX/go-jsoncommentstrip"
|
||||||
"github.com/navidrome/navidrome/log"
|
"github.com/navidrome/navidrome/log"
|
||||||
"github.com/navidrome/navidrome/model"
|
"github.com/navidrome/navidrome/model"
|
||||||
@@ -193,6 +195,7 @@ func (s *playlists) updatePlaylist(ctx context.Context, newPls *model.Playlist)
|
|||||||
} else {
|
} else {
|
||||||
log.Info(ctx, "Adding synced playlist", "playlist", newPls.Name, "path", newPls.Path, "owner", owner.UserName)
|
log.Info(ctx, "Adding synced playlist", "playlist", newPls.Name, "path", newPls.Path, "owner", owner.UserName)
|
||||||
newPls.OwnerID = owner.ID
|
newPls.OwnerID = owner.ID
|
||||||
|
newPls.Public = conf.Server.DefaultPlaylistPublicVisibility
|
||||||
}
|
}
|
||||||
return s.ds.Playlist(ctx).Put(newPls)
|
return s.ds.Playlist(ctx).Put(newPls)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user