本文整理汇总了C#中MediaBrowser.Model.Dto.BaseItemDto.GetProviderId方法的典型用法代码示例。如果您正苦于以下问题:C# BaseItemDto.GetProviderId方法的具体用法?C# BaseItemDto.GetProviderId怎么用?C# BaseItemDto.GetProviderId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaBrowser.Model.Dto.BaseItemDto
的用法示例。
在下文中一共展示了BaseItemDto.GetProviderId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateItem
private void UpdateItem(BaseItemDto request, BaseItem item)
{
if (item.LocationType == LocationType.Offline)
{
throw new InvalidOperationException(string.Format("{0} is currently offline.", item.Name));
}
item.Name = request.Name;
// Only set the forced value if they changed it, or there's already one
if (!string.Equals(item.SortName, request.SortName) || !string.IsNullOrEmpty(item.ForcedSortName))
{
item.ForcedSortName = request.SortName;
}
item.DisplayMediaType = request.DisplayMediaType;
item.CommunityRating = request.CommunityRating;
item.HomePageUrl = request.HomePageUrl;
item.Budget = request.Budget;
item.Revenue = request.Revenue;
item.CriticRating = request.CriticRating;
item.CriticRatingSummary = request.CriticRatingSummary;
item.IndexNumber = request.IndexNumber;
item.ParentIndexNumber = request.ParentIndexNumber;
item.Overview = request.Overview;
item.Genres = request.Genres;
item.Tags = request.Tags;
item.Studios = request.Studios.Select(x => x.Name).ToList();
item.People = request.People.Select(x => new PersonInfo { Name = x.Name, Role = x.Role, Type = x.Type }).ToList();
item.EndDate = request.EndDate != default(DateTime) ? request.EndDate : null;
item.PremiereDate = request.PremiereDate != default(DateTime) ? request.PremiereDate : null;
item.ProductionYear = request.ProductionYear;
item.AspectRatio = request.AspectRatio;
item.Language = request.Language;
item.OfficialRating = request.OfficialRating;
item.CustomRating = request.CustomRating;
item.DontFetchMeta = !(request.EnableInternetProviders ?? true);
if (request.EnableInternetProviders ?? true)
{
item.LockedFields = request.LockedFields;
}
else
{
item.LockedFields.Clear();
}
foreach (var pair in request.ProviderIds.ToList())
{
if (string.IsNullOrEmpty(pair.Value))
{
request.ProviderIds.Remove(pair.Key);
}
}
item.ProviderIds = request.ProviderIds;
var game = item as Game;
if (game != null)
{
game.PlayersSupported = request.Players;
}
var song = item as Audio;
if (song != null)
{
song.Album = request.Album;
song.AlbumArtist = request.AlbumArtist;
song.Artist = request.Artists[0];
}
var musicAlbum = item as MusicAlbum;
if (musicAlbum != null)
{
musicAlbum.MusicBrainzReleaseGroupId = request.GetProviderId("MusicBrainzReleaseGroupId");
}
var musicVideo = item as MusicVideo;
if (musicVideo != null)
{
musicVideo.Artist = request.Artists[0];
musicVideo.Album = request.Album;
}
var series = item as Series;
if (series != null)
{
series.Status = request.Status;
series.AirDays = request.AirDays;
series.AirTime = request.AirTime;
}
}