// public FeedAttachmentVideo(ActivityAttachment attachment, ulong actionId) { _video = Videos.GetById(attachment.id); attachment_id = attachment.id; attachment_video_type = _video.GetVIdeoType(); attachment_type = "video"; title = _video.title; body = HttpUtility.HtmlDecode(_video.description); attachment_video_url = _video.GetVideoUrl(ServiceUrlPrefixes.CouldFront); if (_video.type == "fb") { Dictionary <string, string> data = JsonConvert.DeserializeObject <Dictionary <string, string> >(_video.code); image_main = new FeedImage() { src = data["thumb"], size = new FeedImageSize() { height = 300, width = 300 } }; attachment_video_code = "mp4"; } else { attachment_video_code = _video.code; image_main = _video.photo_id > 0 ? new FeedImage(_video.photo_id) : null; } content_url = $"https://beta.koobeca.com/view.php?action_id={actionId}"; //content_url = uri = $"https://beta.koobeca.com/videos/{_video.owner_id}/{_video.video_id}/video"; mode = (uint)(attachment.mode ? 1 : 0); }
public FeedAttachmentCore(ActivityAttachment attachment, ulong actionId) { var coreLink = CoreLinks.GetById(attachment.id); title = coreLink.title; body = HttpUtility.HtmlDecode(coreLink.description); //uri = $"https://beta.koobeca.com/core/link/index/id/{coreLink.link_id}/key/{Md5.CalculateMd5Hash(coreLink.link_id + coreLink.uri)}/action_id/{actionId}"; uri = $"https://beta.koobeca.com/view.php?action_id={actionId}"; image_main = coreLink.photo_id > 0 ? new FeedImage(coreLink.photo_id) : null; if (image_main == null) // && !string.IsNullOrEmpty(coreLink.@params)){ { var iframely = coreLink.GetIFramely(); if (iframely != null) { try { image_main = new FeedImage(iframely); } catch { Logger.Instance.Error($"Bad iframley in corelink {coreLink.link_id} : {coreLink.@params}"); } } } attachment_id = attachment.id; mode = (uint)(attachment.mode ? 1 : 0); }
// public FeedAttachmentPhoto(ActivityAttachment attachment, ulong actionId) { _photo = AlbumPhotos.GetById(attachment.id); attachment_id = attachment.id; attachment_type = "album_photo"; title = _photo.title; body = HttpUtility.HtmlDecode(_photo.description); //uri = $"https://beta.koobeca.com/advancedalbums/photo/view/album_id/{_photo.album_id}/photo_id/{_photo.photo_id}"; //uri = $"https://beta.koobeca.com/core/link/index/action_id/{actionId}"; uri = $"https://beta.koobeca.com/view.php?action_id={actionId}"; image_main = _photo.file_id > 0 ? new FeedImage(_photo.file_id) : null; mode = (uint)(attachment.mode ? 1 : 0); }