feat(server): make appending subtitle to song title configurable
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -57,6 +57,7 @@ type configOptions struct {
|
|||||||
SearchFullString bool
|
SearchFullString bool
|
||||||
RecentlyAddedByModTime bool
|
RecentlyAddedByModTime bool
|
||||||
PreferSortTags bool
|
PreferSortTags bool
|
||||||
|
AppendSubtitle bool
|
||||||
IgnoredArticles string
|
IgnoredArticles string
|
||||||
IndexGroups string
|
IndexGroups string
|
||||||
FFmpegPath string
|
FFmpegPath string
|
||||||
@@ -433,6 +434,7 @@ func init() {
|
|||||||
viper.SetDefault("searchfullstring", false)
|
viper.SetDefault("searchfullstring", false)
|
||||||
viper.SetDefault("recentlyaddedbymodtime", false)
|
viper.SetDefault("recentlyaddedbymodtime", false)
|
||||||
viper.SetDefault("prefersorttags", false)
|
viper.SetDefault("prefersorttags", false)
|
||||||
|
viper.SetDefault("appendsubtitle", true)
|
||||||
viper.SetDefault("ignoredarticles", "The El La Los Las Le Les Os As O A")
|
viper.SetDefault("ignoredarticles", "The El La Los Las Le Les Os As O A")
|
||||||
viper.SetDefault("indexgroups", "A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ) [Unknown]([)")
|
viper.SetDefault("indexgroups", "A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ) [Unknown]([)")
|
||||||
viper.SetDefault("ffmpegpath", "")
|
viper.SetDefault("ffmpegpath", "")
|
||||||
|
|||||||
+3
-3
@@ -93,10 +93,10 @@ type MediaFile struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mf MediaFile) FullTitle() string {
|
func (mf MediaFile) FullTitle() string {
|
||||||
if mf.Tags[TagSubtitle] == nil {
|
if conf.Server.AppendSubtitle && mf.Tags[TagSubtitle] != nil {
|
||||||
return mf.Title
|
return fmt.Sprintf("%s (%s)", mf.Title, mf.Tags[TagSubtitle][0])
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s (%s)", mf.Title, mf.Tags[TagSubtitle][0])
|
return mf.Title
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mf MediaFile) ContentType() string {
|
func (mf MediaFile) ContentType() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user