tajik public data #498
This commit is contained in:
parent
c8782e73e2
commit
97f3d7f6f9
@ -8,6 +8,7 @@ using Newtonsoft.Json;
|
||||
using RMuseum.Models.Auth.Memory;
|
||||
using RMuseum.Models.Auth.ViewModel;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.PublicExport;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.GanjoorAudio.ViewModels;
|
||||
using RMuseum.Models.GanjoorIntegration;
|
||||
@ -2423,6 +2424,81 @@ namespace RMuseum.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// start exporting all published Ganjoor data to the public git-tracked JSON data set
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("publicdata/batchexport")]
|
||||
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + RMuseumSecurableItem.ImportOperationShortName)]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.Unauthorized)]
|
||||
public IActionResult StartBatchExportPublicGitData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = _ganjoorService.StartBatchExportPublicGitData();
|
||||
if (!string.IsNullOrEmpty(res.ExceptionString))
|
||||
return BadRequest(res.ExceptionString);
|
||||
return Ok();
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
return BadRequest(exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// start exporting the Tajik (Cyrillic) overlay data to its own, separate public
|
||||
/// git-tracked JSON data set — only poets/categories/poems with an actual Tajik
|
||||
/// translation are included
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("tajik/publicdata/batchexport")]
|
||||
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + RMuseumSecurableItem.ImportOperationShortName)]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.Unauthorized)]
|
||||
public IActionResult StartBatchExportTajikPublicGitData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = _ganjoorService.StartBatchExportTajikPublicGitData();
|
||||
if (!string.IsNullOrEmpty(res.ExceptionString))
|
||||
return BadRequest(res.ExceptionString);
|
||||
return Ok();
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
return BadRequest(exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (re)build local Ganjoor content from a public data export tree (local folder or HTTP) —
|
||||
/// intended for local development use, not for production servers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("publicdata/import")]
|
||||
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + RMuseumSecurableItem.ImportOperationShortName)]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.Unauthorized)]
|
||||
public IActionResult StartImportFromPublicDataRepo([FromBody] PublicDataImportRequestDto request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = _ganjoorService.StartImportFromPublicDataRepo(request.UseHttp, request.Location, request.PoetId);
|
||||
if (!string.IsNullOrEmpty(res.ExceptionString))
|
||||
return BadRequest(res.ExceptionString);
|
||||
return Ok();
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
return BadRequest(exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user public profile
|
||||
/// </summary>
|
||||
|
||||
@ -1775,6 +1775,27 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.StartBatchExportPublicGitData">
|
||||
<summary>
|
||||
start exporting all published Ganjoor data to the public git-tracked JSON data set
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.StartBatchExportTajikPublicGitData">
|
||||
<summary>
|
||||
start exporting the Tajik (Cyrillic) overlay data to its own, separate public
|
||||
git-tracked JSON data set — only poets/categories/poems with an actual Tajik
|
||||
translation are included
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.StartImportFromPublicDataRepo(RMuseum.Models.Ganjoor.PublicExport.PublicDataImportRequestDto)">
|
||||
<summary>
|
||||
(re)build local Ganjoor content from a public data export tree (local folder or HTTP) —
|
||||
intended for local development use, not for production servers
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetUserPublicProfile(System.Guid)">
|
||||
<summary>
|
||||
Get user public profile
|
||||
@ -17523,6 +17544,31 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.StartBatchExportPublicGitData">
|
||||
<summary>
|
||||
start exporting all published data (poets/categories/poems/verses) to the public
|
||||
git-tracked JSON data set, committing and pushing changes since the last run
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.StartBatchExportTajikPublicGitData">
|
||||
<summary>
|
||||
start exporting the Tajik (Cyrillic) overlay data to its own separate git-tracked JSON
|
||||
data set — only entities that actually have a Tajik translation are included
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.StartImportFromPublicDataRepo(System.Boolean,System.String,System.Int32)">
|
||||
<summary>
|
||||
(re)build local Ganjoor content (poets/categories/poems/verses/sections + their pages)
|
||||
from a public data export tree, read locally or over HTTP. Safe to re-run — existing
|
||||
entities (by id) are left untouched, only missing ones are added.
|
||||
</summary>
|
||||
<param name="useHttp">true: fetch over HTTP (location is a base URL). false: read from a local folder (location is a path).</param>
|
||||
<param name="location">base URL or local folder path of the exported data tree</param>
|
||||
<param name="poetId">0 imports every poet; a specific id imports only that poet (useful on a slow connection)</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.HealthCheckContents">
|
||||
<summary>
|
||||
examine site pages for broken links
|
||||
|
||||
@ -633,6 +633,31 @@ namespace RMuseum.Services
|
||||
/// <returns></returns>
|
||||
RServiceResult<bool> StartBatchGenerateGDBFiles();
|
||||
|
||||
/// <summary>
|
||||
/// start exporting all published data (poets/categories/poems/verses) to the public
|
||||
/// git-tracked JSON data set, committing and pushing changes since the last run
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
RServiceResult<bool> StartBatchExportPublicGitData();
|
||||
|
||||
/// <summary>
|
||||
/// start exporting the Tajik (Cyrillic) overlay data to its own separate git-tracked JSON
|
||||
/// data set — only entities that actually have a Tajik translation are included
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
RServiceResult<bool> StartBatchExportTajikPublicGitData();
|
||||
|
||||
/// <summary>
|
||||
/// (re)build local Ganjoor content (poets/categories/poems/verses/sections + their pages)
|
||||
/// from a public data export tree, read locally or over HTTP. Safe to re-run — existing
|
||||
/// entities (by id) are left untouched, only missing ones are added.
|
||||
/// </summary>
|
||||
/// <param name="useHttp">true: fetch over HTTP (location is a base URL). false: read from a local folder (location is a path).</param>
|
||||
/// <param name="location">base URL or local folder path of the exported data tree</param>
|
||||
/// <param name="poetId">0 imports every poet; a specific id imports only that poet (useful on a slow connection)</param>
|
||||
/// <returns></returns>
|
||||
RServiceResult<bool> StartImportFromPublicDataRepo(bool useHttp, string location, int poetId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// examine site pages for broken links
|
||||
/// </summary>
|
||||
|
||||
@ -292,6 +292,9 @@ namespace RMuseum.Services.Implementation
|
||||
return
|
||||
$@"# ganjoor-tajik-data
|
||||
|
||||
**[▶ Live demo](https://ganjoor.github.io/tjmini/)** — Мини-Ганҷур, a minimal reading app built
|
||||
on this data, running client-side in your browser with no server of its own.
|
||||
|
||||
Cyrillic Tajik transliteration/translation overlay for [Ganjoor](https://ganjoor.net)'s poetry
|
||||
content. This is a **separate, sparser** data set from
|
||||
[ganjoor-data](https://github.com/ganjoor/ganjoor-data) — Tajik coverage only exists for some
|
||||
|
||||
Loading…
Reference in New Issue
Block a user