Write URL to JSON file into entries.
This commit is contained in:
parent
f48ad494b5
commit
d8212c261f
|
@ -1,5 +1,5 @@
|
||||||
/* This file is part of FediBlock-backend.
|
/* 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
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
#include "files.hpp"
|
#include "files.hpp"
|
||||||
|
|
||||||
|
#include "config.hpp"
|
||||||
#include "fs-compat.hpp"
|
#include "fs-compat.hpp"
|
||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
@ -152,6 +153,8 @@ string get_access_token()
|
||||||
|
|
||||||
vector<entry_type> read_json_files(const bool cache)
|
vector<entry_type> read_json_files(const bool cache)
|
||||||
{
|
{
|
||||||
|
using namespace FediBlock::config;
|
||||||
|
|
||||||
vector<entry_type> entries;
|
vector<entry_type> entries;
|
||||||
|
|
||||||
// clang-format off
|
// 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);
|
entries.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* This file is part of FediBlock-backend.
|
/* 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
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
@ -34,6 +34,7 @@ struct entry_type
|
||||||
string description;
|
string description;
|
||||||
vector<string> screenshot_filepaths;
|
vector<string> screenshot_filepaths;
|
||||||
string report_time;
|
string report_time;
|
||||||
|
string json_url;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class http_method
|
enum class http_method
|
||||||
|
|
Reference in New Issue