diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-03-13 21:34:24 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-03-13 21:34:24 -0400 |
| commit | d683f3061979d786efc574f1073af4e77da11772 (patch) | |
| tree | 85546503b9b6065d24df4d7cc4065e4c560d2184 /MediaBrowser.Controller/Entities/Audio/Audio.cs | |
| parent | 749037eb4a73c9ae4b66c787a381737427dd6eca (diff) | |
update music user data key
Diffstat (limited to 'MediaBrowser.Controller/Entities/Audio/Audio.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/Audio.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 766f1e5ed8..dc37dcceab 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -153,6 +153,31 @@ namespace MediaBrowser.Controller.Entities.Audio /// <returns>System.String.</returns> protected override string CreateUserDataKey() { + if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys) + { + var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty; + + + if (ParentIndexNumber.HasValue) + { + songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey; + } + songKey+= Name; + + if (!string.IsNullOrWhiteSpace(Album)) + { + songKey = Album + "-" + songKey; + } + + var albumArtist = AlbumArtists.FirstOrDefault(); + if (!string.IsNullOrWhiteSpace(albumArtist)) + { + songKey = albumArtist + "-" + songKey; + } + + return songKey; + } + var parent = AlbumEntity; if (parent != null) |
