Write URL to JSON file into entries.

This commit is contained in:
tastytea 2021-01-09 14:35:58 +01:00
parent f48ad494b5
commit d8212c261f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* This file is part of FediBlock-backend.
* Copyright © 2020 tastytea <tastytea@tastytea.de>
* Copyright © 2020, 2021 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -15,6 +15,7 @@
*/
#include "files.hpp"
#include "config.hpp"
#include "fs-compat.hpp"
#include "json.hpp"
#include "types.hpp"
@ -152,6 +153,8 @@ string get_access_token()
vector<entry_type> read_json_files(const bool cache)
{
using namespace FediBlock::config;
vector<entry_type> entries;
// clang-format off
@ -210,6 +213,10 @@ vector<entry_type> read_json_files(const bool cache)
}
}
}
entry.json_url = format("https://{:s}/{:s}/{:s}/raw/branch/{:s}/{:s}",
forge_domain, forge_org, forge_repo_data,
forge_repo_data_branch,
path.filename().string());
entries.push_back(entry);
}

View File

@ -1,5 +1,5 @@
/* This file is part of FediBlock-backend.
* Copyright © 2020 tastytea <tastytea@tastytea.de>
* Copyright © 2020, 2021 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -34,6 +34,7 @@ struct entry_type
string description;
vector<string> screenshot_filepaths;
string report_time;
string json_url;
};
enum class http_method