public static void ProcessArtistData(BaseItem artist, LastfmArtist data) { var yearFormed = 0; if (data.bio != null) { Int32.TryParse(data.bio.yearformed, out yearFormed); if (!artist.LockedFields.Contains(MetadataFields.Overview)) { artist.Overview = data.bio.content; } if (!string.IsNullOrEmpty(data.bio.placeformed) && !artist.LockedFields.Contains(MetadataFields.ProductionLocations)) { artist.AddProductionLocation(data.bio.placeformed); } } artist.PremiereDate = yearFormed > 0 ? new DateTime(yearFormed, 1, 1, 0, 0, 0, DateTimeKind.Utc) : (DateTime?)null; artist.ProductionYear = yearFormed; if (data.tags != null && !artist.LockedFields.Contains(MetadataFields.Tags)) { AddTags(artist, data.tags); } var musicArtist = artist as MusicArtist; string imageSize; if (musicArtist != null) { musicArtist.LastFmImageUrl = GetImageUrl(data, out imageSize); musicArtist.LastFmImageSize = imageSize; } var artistByName = artist as Artist; if (artistByName != null) { artistByName.LastFmImageUrl = GetImageUrl(data, out imageSize); artistByName.LastFmImageSize = imageSize; } }
public static void ProcessArtistData(BaseItem artist, LastfmArtist data) { var yearFormed = 0; if (data.bio != null) { Int32.TryParse(data.bio.yearformed, out yearFormed); if (!artist.LockedFields.Contains(MetadataFields.Overview)) { artist.Overview = data.bio.content; } if (!string.IsNullOrEmpty(data.bio.placeformed) && !artist.LockedFields.Contains(MetadataFields.ProductionLocations)) { artist.AddProductionLocation(data.bio.placeformed); } } artist.PremiereDate = yearFormed > 0 ? new DateTime(yearFormed, 1, 1, 0, 0, 0, DateTimeKind.Utc) : (DateTime?)null; artist.ProductionYear = yearFormed; if (data.tags != null && !artist.LockedFields.Contains(MetadataFields.Tags)) { AddTags(artist, data.tags); } var musicArtist = artist as MusicArtist; string imageSize; if (musicArtist != null) { musicArtist.LastFmImageUrl = GetImageUrl(data, out imageSize); musicArtist.LastFmImageSize = imageSize; } var artistByName = artist as Artist; if (artistByName != null) { artistByName.LastFmImageUrl = GetImageUrl(data, out imageSize); artistByName.LastFmImageSize = imageSize; } }
public static void ProcessArtistData(BaseItem artist, LastfmArtist data) { var yearFormed = 0; if (data.bio != null) { Int32.TryParse(data.bio.yearformed, out yearFormed); artist.Overview = data.bio.content; if (!string.IsNullOrEmpty(data.bio.placeformed)) { artist.AddProductionLocation(data.bio.placeformed); } } artist.PremiereDate = yearFormed > 0 ? new DateTime(yearFormed, 1, 1, 0, 0, 0, DateTimeKind.Utc) : (DateTime?)null; artist.ProductionYear = yearFormed; if (data.tags != null) { AddTags(artist, data.tags); } }
public static void ProcessArtistData(BaseItem artist, LastfmArtist data) { var yearFormed = 0; if (data.bio != null) { Int32.TryParse(data.bio.yearformed, out yearFormed); if (!artist.LockedFields.Contains(MetadataFields.Overview)) { artist.Overview = data.bio.content; } if (!string.IsNullOrEmpty(data.bio.placeformed) && !artist.LockedFields.Contains(MetadataFields.ProductionLocations)) { artist.AddProductionLocation(data.bio.placeformed); } } artist.PremiereDate = yearFormed > 0 ? new DateTime(yearFormed, 1, 1, 0, 0, 0, DateTimeKind.Utc) : (DateTime?)null; artist.ProductionYear = yearFormed; if (data.tags != null && !artist.LockedFields.Contains(MetadataFields.Tags)) { AddTags(artist, data.tags); } }