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

This commit is contained in:
Luke Pulverenti 2013-10-04 20:44:43 -04:00
parent 82664bdae8
commit d1d639ce2c
5 changed files with 20 additions and 11 deletions

View File

@ -76,7 +76,7 @@ namespace MediaBrowser.Controller.Entities.Audio
if (!string.IsNullOrEmpty(id))
{
return id;
return "Artist-Musicbrainz-" + id;
}
return "Artist-" + item.Name;

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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();
}
}
}

View File

@ -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();
}
}
}