#445 listing poets

This commit is contained in:
Hamid Reza Mohammadi 2024-07-20 18:06:24 +03:30
parent 298db445ba
commit 3e02c3e5ae
2 changed files with 5 additions and 3 deletions

View File

@ -41,14 +41,16 @@ namespace TajikGanjoor.Pages
return false;
}
poets = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GanjoorPoetViewModel>>();
poets = poets ?? [];
poets = poets.Where(p => !string.IsNullOrWhiteSpace(p.TajikNickName)).ToList();
if (AggressiveCacheEnabled)
{
_memoryCache.Set(cacheKey, poets);
}
}
catch
catch(Exception e)
{
LastError = "خطا در دسترسی به وب سرویس گنجور";
LastError = $"خطا در دسترسی به وب سرویس گنجور - {e}";
return false;
}

View File

@ -5,7 +5,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(
HtmlEncoder.Create(allowedRanges: [ UnicodeRanges.BasicLatin,
UnicodeRanges.Arabic ]));
UnicodeRanges.Arabic, UnicodeRanges.Cyrillic ]));
builder.Services.AddRazorPages(options =>
{