2025-07-27 17:51:50 -05:00
|
|
|
using LANCommander.SDK.Enums;
|
|
|
|
|
using LANCommander.SDK.Models.Manifest;
|
|
|
|
|
using LANCommander.Server.ImportExport.Models;
|
|
|
|
|
using LANCommander.Server.Services;
|
2026-07-02 18:09:14 -05:00
|
|
|
using LANCommander.Server.Services.Mappers;
|
2025-07-27 17:51:50 -05:00
|
|
|
|
|
|
|
|
namespace LANCommander.Server.ImportExport.Exporters;
|
|
|
|
|
|
2026-07-02 18:09:14 -05:00
|
|
|
public class SavePathExporter(ManifestMapper manifestMapper, SavePathService savePathService) : BaseExporter<SavePath, Data.Models.SavePath>
|
2025-07-27 17:51:50 -05:00
|
|
|
{
|
|
|
|
|
public override async Task<ExportItemInfo> GetExportInfoAsync(Data.Models.SavePath record)
|
|
|
|
|
{
|
|
|
|
|
return new ExportItemInfo
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
2025-08-01 02:27:06 -05:00
|
|
|
Type = ImportExportRecordType.SavePath,
|
2025-07-27 17:51:50 -05:00
|
|
|
Name = record.Path,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool CanExport(SavePath record) => ExportContext.DataRecord is Data.Models.Game;
|
|
|
|
|
|
|
|
|
|
public override async Task<SavePath> ExportAsync(Guid id)
|
|
|
|
|
{
|
2026-07-02 18:09:14 -05:00
|
|
|
return await savePathService.GetAsync(id, manifestMapper.ProjectToManifestSavePath);
|
2025-07-27 17:51:50 -05:00
|
|
|
}
|
|
|
|
|
}
|