mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
prefix game/music user data id's to avoid collisions with movies and tv
This commit is contained in:
parent
82664bdae8
commit
d1d639ce2c
@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
}
|
||||
|
||||
public string LastFmImageUrl { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
@ -76,9 +76,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
return id;
|
||||
return "Artist-Musicbrainz-" + id;
|
||||
}
|
||||
|
||||
|
||||
return "Artist-" + item.Name;
|
||||
}
|
||||
}
|
||||
|
@ -114,15 +114,14 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
var id = parent.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup) ??
|
||||
parent.GetProviderId(MetadataProviders.Musicbrainz);
|
||||
var parentKey = parent.GetUserDataKey();
|
||||
|
||||
if (!string.IsNullOrEmpty(id) && IndexNumber.HasValue)
|
||||
if (IndexNumber.HasValue)
|
||||
{
|
||||
var songKey = (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
||||
+ (IndexNumber.Value.ToString("0000 - "));
|
||||
|
||||
return id + songKey;
|
||||
return parentKey + songKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,14 +86,14 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
return id;
|
||||
return "MusicAlbum-MusicBrainzReleaseGroup-" + id;
|
||||
}
|
||||
|
||||
id = this.GetProviderId(MetadataProviders.Musicbrainz);
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
return id;
|
||||
return "MusicAlbum-Musicbrainz-" + id;
|
||||
}
|
||||
|
||||
return base.GetUserDataKey();
|
||||
|
@ -72,7 +72,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return this.GetProviderId(MetadataProviders.Gamesdb) ?? base.GetUserDataKey();
|
||||
var id = this.GetProviderId(MetadataProviders.Gamesdb);
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
return "Game-Gamesdb-" + id;
|
||||
}
|
||||
return base.GetUserDataKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return GameSystemName ?? base.GetUserDataKey();
|
||||
if (!string.IsNullOrEmpty(GameSystemName))
|
||||
{
|
||||
return "GameSystem-" + GameSystemName;
|
||||
}
|
||||
return base.GetUserDataKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user