Skip to content

Commit

Permalink
feat: UIGF v4.0 Export Support
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Jul 26, 2024
1 parent f7b5430 commit 17f608d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public class GachaRecordsInfo
public string ExportApp { get; } = "Hollow";

[JsonPropertyName("export_app_version")]
public string ExportAppVersion { get; set; } = "1.0.0";
public string ExportAppVersion { get; set; } = AppInfo.AppVersion;

// TODO: UIGF 4.0 Support
[JsonPropertyName("version")]
public string UigfVersion { get; } = "v4.0 READY";
public string UigfVersion { get; } = "v4.0";
}
1 change: 0 additions & 1 deletion Hollow/Services/GachaService/GachaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public async Task<Response<GachaRecords>> GetGachaRecords(GachaUrlData gachaUrlD
gachaRecords.Profiles.Add(targetProfile);

gachaRecords.Info.ExportTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();
gachaRecords.Info.ExportAppVersion = AppInfo.AppVersion;
progress.Report(new Response<string>(true, $"success {fetchRecordsCount} {newRecordsCount}"));
Log.Information("[GachaService] Fetched {0} new records", newRecordsCount);

Expand Down
4 changes: 2 additions & 2 deletions Hollow/ViewModels/Pages/SignalSearchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void DeleteProfile()
async void UidDeleteConfirmCallback(bool confirmed)
{
if (!confirmed) return;
var gachaRecords = new GachaRecords { Info = { ExportAppVersion = AppInfo.AppVersion, ExportTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() }, Profiles = UidList.Where(uid => uid != SelectedUid).Select(uid => _gachaProfiles![uid]).ToList() };
var gachaRecords = new GachaRecords { Info = { ExportTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() }, Profiles = UidList.Where(uid => uid != SelectedUid).Select(uid => _gachaProfiles![uid]).ToList() };
await File.WriteAllTextAsync(AppInfo.GachaRecordPath, JsonSerializer.Serialize(gachaRecords, HollowJsonSerializer.Options));
await LoadGachaRecords();
Log.Information("[SignalSearch] Profile deleted: {Uid}", SelectedUid);
Expand All @@ -147,7 +147,7 @@ private void ExportRecords()
async void SelectedUidListCallback(string[] selectedUidList)
{
if (selectedUidList.Length == 0) return;
var gachaRecords = new GachaRecords { Info = { ExportAppVersion = AppInfo.AppVersion, ExportTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() }, Profiles = selectedUidList.Select(uid => _gachaProfiles![uid]).ToList() };
var gachaRecords = new GachaRecords { Info = { ExportTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() }, Profiles = selectedUidList.Select(uid => _gachaProfiles![uid]).ToList() };

var topLevel = TopLevel.GetTopLevel(App.GetService<MainWindow>());
var file = await topLevel!.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions { SuggestedFileName = $"Hollow_{gachaRecords.Info.ExportTimestamp}.json"});
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ WIP
- [ ] 游戏设置
- [x] 公告 *切换时有一定概率卡死,取决于切换页面的频率*
- [x] 调频记录
- [x] 多账号支持 *初步测试*
- [ ] UIGF 导入/导出 *等待标准制定*
- [x] 多账号支持 *不稳定,需要测试*
- [ ] UIGF 导入
- [x] UIGF 导出
- [x] 简单分析
- [ ] 国际服支持
- [x] 国际服支持 *不稳定,需要测试*
- [ ] 游戏截图
- [ ] 情报站
- [ ] 代理人
Expand Down

0 comments on commit 17f608d

Please sign in to comment.