aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Audio/Audio.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/Audio/Audio.cs')
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs
index 766f1e5ed..dc37dccea 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)