diff --git a/src/web/backend/defs/defs.go b/src/web/backend/defs/defs.go index 6a3c289d..79a60be2 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]+$`) @@ -193,7 +193,7 @@ var AllConfigKeys = []string{ "SYSTEM_USERNAME", "SYSTEM_PASSWORD", "PLAYLIST_DIR", "SLEEP", "PUBLIC_PLAYLIST", "DOWNLOAD_DIR", "USE_SUBDIRECTORY", "PATH_TEMPLATE", "ENRICH_TRACK_METADATA", "DOWNLOAD_SERVICES", "YOUTUBE_API_KEY", "TRACK_EXTENSION", "FILTER_LIST", - "SLSKD_URL", "SLSKD_API_KEY", "SLSKD_MIGRATE_DOWNLOADS", + "SUFFIX_REMOVAL", "SLSKD_URL", "SLSKD_API_KEY", "SLSKD_MIGRATE_DOWNLOADS", "LIDARR_URL", "LIDARR_API_KEY", "LIDARR_MIGRATE_DOWNLOADS", "LIDARR_ROOT_FOLDER", "WIZARD_COMPLETE", "EXTENSIONS", "LISTENBRAINZ_USER_TOKEN", } 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 //