public override void BeforeSquareWideUpdate(XmlDocument doc, MusicItem track, Uri imageUri) { var largeXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare310x310ImageAndText02); TileUtil.SetImage(largeXml, imageUri); SetMeta(largeXml, track, includeAlbum: false); TileUtil.Embed(src: largeXml, dest: doc); }
/// <summary> /// Cover to the left, title, album, artist to the right. /// </summary> /// <param name="track"></param> /// <returns></returns> public override async Task Update(MusicItem track) { // wide var wideXml = TileUpdateManager.GetTemplateContent(wideImageText02); var imageUri = await SetImageAndMeta(wideXml, track); // square var squareXml = TileUpdateManager.GetTemplateContent(squareText03); SetMeta(squareXml, track); TileUtil.Embed(squareXml, wideXml); BeforeSquareWideUpdate(wideXml, track, imageUri); var trackDuration = track.Duration; var trackDurationSeconds = trackDuration.TotalSeconds; var isTrackDurationValid = trackDurationSeconds > 0 && trackDurationSeconds < 10000; var expiration = isTrackDurationValid ? trackDuration : TimeSpan.FromMinutes(5); TileUtil.Update(wideXml, expiration); }