mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -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; }
|
public string LastFmImageUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the user data key.
|
/// Gets the user data key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -76,9 +76,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(id))
|
if (!string.IsNullOrEmpty(id))
|
||||||
{
|
{
|
||||||
return id;
|
return "Artist-Musicbrainz-" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Artist-" + item.Name;
|
return "Artist-" + item.Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,15 +114,14 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
|
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
var id = parent.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup) ??
|
var parentKey = parent.GetUserDataKey();
|
||||||
parent.GetProviderId(MetadataProviders.Musicbrainz);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(id) && IndexNumber.HasValue)
|
if (IndexNumber.HasValue)
|
||||||
{
|
{
|
||||||
var songKey = (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
var songKey = (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
||||||
+ (IndexNumber.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))
|
if (!string.IsNullOrEmpty(id))
|
||||||
{
|
{
|
||||||
return id;
|
return "MusicAlbum-MusicBrainzReleaseGroup-" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = this.GetProviderId(MetadataProviders.Musicbrainz);
|
id = this.GetProviderId(MetadataProviders.Musicbrainz);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(id))
|
if (!string.IsNullOrEmpty(id))
|
||||||
{
|
{
|
||||||
return id;
|
return "MusicAlbum-Musicbrainz-" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.GetUserDataKey();
|
return base.GetUserDataKey();
|
||||||
|
@ -72,7 +72,13 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
public override string GetUserDataKey()
|
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>
|
/// <returns>System.String.</returns>
|
||||||
public override string GetUserDataKey()
|
public override string GetUserDataKey()
|
||||||
{
|
{
|
||||||
return GameSystemName ?? base.GetUserDataKey();
|
if (!string.IsNullOrEmpty(GameSystemName))
|
||||||
|
{
|
||||||
|
return "GameSystem-" + GameSystemName;
|
||||||
|
}
|
||||||
|
return base.GetUserDataKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user