🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
feat: imported playlists are public by default (#3143)
John White67d11dd14442
diff --git a/conf/configuration.go b/conf/configuration.goindex 14e040bcd..1ab42c09c 100644--- a/conf/configuration.go+++ b/conf/configuration.go@@ -17,73 +17,74 @@ import ()type configOptions struct {- ConfigFile string- Address string- Port int- UnixSocketPerm string- MusicFolder string- DataFolder string- CacheFolder string- DbPath string- LogLevel string- ScanInterval time.Duration- ScanSchedule string- SessionTimeout time.Duration- BaseURL string- BasePath string- BaseHost string- BaseScheme string- TLSCert string- TLSKey string- UILoginBackgroundURL string- UIWelcomeMessage string- MaxSidebarPlaylists int- EnableTranscodingConfig bool- EnableDownloads bool- EnableExternalServices bool- EnableMediaFileCoverArt bool- TranscodingCacheSize string- ImageCacheSize string- AlbumPlayCountMode string- EnableArtworkPrecache bool- AutoImportPlaylists bool- PlaylistsPath string- AutoTranscodeDownload bool- DefaultDownsamplingFormat string- SearchFullString bool- RecentlyAddedByModTime bool- PreferSortTags bool- IgnoredArticles string- IndexGroups string- SubsonicArtistParticipations bool- FFmpegPath string- MPVPath string- MPVCmdTemplate string- CoverArtPriority string- CoverJpegQuality int- ArtistArtPriority string- EnableGravatar bool- EnableFavourites bool- EnableStarRating bool- EnableUserEditing bool- EnableSharing bool- DefaultDownloadableShare bool- DefaultTheme string- DefaultLanguage string- DefaultUIVolume int- EnableReplayGain bool- EnableCoverAnimation bool- GATrackingID string- EnableLogRedacting bool- AuthRequestLimit int- AuthWindowLength time.Duration- PasswordEncryptionKey string- ReverseProxyUserHeader string- ReverseProxyWhitelist string- HTTPSecurityHeaders secureOptions- Prometheus prometheusOptions- Scanner scannerOptions- Jukebox jukeboxOptions+ ConfigFile string+ Address string+ Port int+ UnixSocketPerm string+ MusicFolder string+ DataFolder string+ CacheFolder string+ DbPath string+ LogLevel string+ ScanInterval time.Duration+ ScanSchedule string+ SessionTimeout time.Duration+ BaseURL string+ BasePath string+ BaseHost string+ BaseScheme string+ TLSCert string+ TLSKey string+ UILoginBackgroundURL string+ UIWelcomeMessage string+ MaxSidebarPlaylists int+ EnableTranscodingConfig bool+ EnableDownloads bool+ EnableExternalServices bool+ EnableMediaFileCoverArt bool+ TranscodingCacheSize string+ ImageCacheSize string+ AlbumPlayCountMode string+ EnableArtworkPrecache bool+ AutoImportPlaylists bool+ DefaultPlaylistPublicVisibility bool+ PlaylistsPath string+ AutoTranscodeDownload bool+ DefaultDownsamplingFormat string+ SearchFullString bool+ RecentlyAddedByModTime bool+ PreferSortTags bool+ IgnoredArticles string+ IndexGroups string+ SubsonicArtistParticipations bool+ FFmpegPath string+ MPVPath string+ MPVCmdTemplate string+ CoverArtPriority string+ CoverJpegQuality int+ ArtistArtPriority string+ EnableGravatar bool+ EnableFavourites bool+ EnableStarRating bool+ EnableUserEditing bool+ EnableSharing bool+ DefaultDownloadableShare bool+ DefaultTheme string+ DefaultLanguage string+ DefaultUIVolume int+ EnableReplayGain bool+ EnableCoverAnimation bool+ GATrackingID string+ EnableLogRedacting bool+ AuthRequestLimit int+ AuthWindowLength time.Duration+ PasswordEncryptionKey string+ ReverseProxyUserHeader string+ ReverseProxyWhitelist string+ HTTPSecurityHeaders secureOptions+ Prometheus prometheusOptions+ Scanner scannerOptions+ Jukebox jukeboxOptionsAgents stringLastFM lastfmOptions@@ -299,6 +300,7 @@ func init() {viper.SetDefault("albumplaycountmode", consts.AlbumPlayCountModeAbsolute)viper.SetDefault("enableartworkprecache", true)viper.SetDefault("autoimportplaylists", true)+ viper.SetDefault("defaultplaylistpublicvisibility", true)viper.SetDefault("playlistspath", consts.DefaultPlaylistsPath)viper.SetDefault("enabledownloads", true)viper.SetDefault("enableexternalservices", true)diff --git a/core/playlists.go b/core/playlists.goindex 0834c437f..7c8b179ca 100644--- a/core/playlists.go+++ b/core/playlists.go@@ -14,6 +14,8 @@ import ("strings""time"+ "github.com/navidrome/navidrome/conf"+"github.com/RaveNoX/go-jsoncommentstrip""github.com/navidrome/navidrome/log""github.com/navidrome/navidrome/model"@@ -193,6 +195,7 @@ func (s *playlists) updatePlaylist(ctx context.Context, newPls *model.Playlist)} else {log.Info(ctx, "Adding synced playlist", "playlist", newPls.Name, "path", newPls.Path, "owner", owner.UserName)newPls.OwnerID = owner.ID+ newPls.Public = conf.Server.DefaultPlaylistPublicVisibility}return s.ds.Playlist(ctx).Put(newPls)}