@post.Title
@{
int i = 0;
foreach (var images in post.Attachments)
{
/*
string toImage = System.IO.Path.Combine(FileSystem.CacheDirectory, System.IO.Path.GetFileName(new Uri(images.Path).LocalPath));
string toFolder = FileSystem.CacheDirectory;
for (int tries = 0; tries < 5; tries++)
{
try
{
if (!System.IO.File.Exists(toImage))
{
Task.Run(() =>
{
using (var s = new HttpClient().GetStreamAsync(images.Link).GetAwaiter().GetResult())
{
if (!Directory.Exists(toFolder))
Directory.CreateDirectory(toFolder);
using (var fs = new FileStream(toImage, FileMode.CreateNew))
{
s.CopyToAsync(fs).GetAwaiter();
}
}
}).GetAwaiter();
}
toImage = Convert.ToBase64String(System.IO.File.ReadAllBytes(toImage));
//DependencyService.Get
().GetImageAsync($"https://kemono.party/data{images.Path}", toFolder, toImage).GetAwaiter();
break;
}
catch (Exception ex)
{
if (tries == 4)
toImage = "logo_vivelapub.png";
//await Task.Delay(500);
}
}
*/
if (System.IO.Path.GetExtension(images.Path) is (".png" or ".jpg" or ".jpeg" or ".gif")){
//if (System.IO.Path.GetExtension(toImage) is (".png" or ".jpg" or ".jpeg" or ".gif")){
string link = images.Link;
string imageId = $"{images.Path}_{i}";
Task.Run(()=>OpenOverlay(imageId,link,images.Name))) style="margin-bottom:10px; width:@(Application.Current.MainPage.Width - 50)px; height:contain;" />
}
//else
//{
// string link = "data:image/png;base64," + toImage;
//string imageId = $"{images.Path}_{i}";
//
OpenOverlay(imageId,link,images.Name)) style="margin-bottom:10px; width:@(Application.Current.MainPage.Width - 50)px; height:contain;" />
//}
}
}
@if(post.Content.Contains(""))
{
post.Content.Replace("","");
}
@((MarkupString)post.Content)
@foreach (var attachment in post.Attachments)
{
string link = "https://kemono.party" + attachment.Path;
@attachment.Name
}
@post.Published