prefix game/music user data id's to avoid collisions with movies and tv

pull/702/head
Luke Pulverenti 11 years ago
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…
Cancel
Save