diff --git a/src/web/backend/defs/defs.go b/src/web/backend/defs/defs.go index 5b4756dd..4d436d45 100644 --- a/src/web/backend/defs/defs.go +++ b/src/web/backend/defs/defs.go @@ -3,8 +3,8 @@ package defs import ( "regexp" ) -// place for confs/variables in use by the UI or backend +// place for confs/variables in use by the UI or backend // Custom playlist regex validation var CustomIDRe = regexp.MustCompile(`^custom-[a-z0-9]+$`) @@ -181,5 +181,5 @@ var AllConfigKeys = []string{ "DOWNLOAD_DIR", "USE_SUBDIRECTORY", "PATH_TEMPLATE", "ENRICH_TRACK_METADATA", "DOWNLOAD_SERVICES", "YOUTUBE_API_KEY", "TRACK_EXTENSION", "FILTER_LIST", "SLSKD_URL", "SLSKD_API_KEY", - "WIZARD_COMPLETE", "MIGRATE_DOWNLOADS", "EXTENSIONS", "LISTENBRAINZ_USER_TOKEN", -} \ No newline at end of file + "WIZARD_COMPLETE", "MIGRATE_DOWNLOADS", "EXTENSIONS", "LISTENBRAINZ_USER_TOKEN", "SUFFIX_REMOVAL", +} diff --git a/src/web/backend/playlist/apple_music.go b/src/web/backend/playlist/apple_music.go index e928418f..f5339f9c 100644 --- a/src/web/backend/playlist/apple_music.go +++ b/src/web/backend/playlist/apple_music.go @@ -6,11 +6,14 @@ import ( "io" "log/slog" "net/http" + "regexp" "strings" "golang.org/x/net/html" ) +var albumSuffixRe = regexp.MustCompile(`(?i)\s*[-–]\s*(single|ep)\s*$`) + // appleServerData mirrors the top-level shape of the //