From ca502fc274c640f1e301a77ecb336ab5a23d348d Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 18 Jun 2018 20:47:38 +0100 Subject: Update to new ContentDB API --- src/content/packages.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/content/packages.h') diff --git a/src/content/packages.h b/src/content/packages.h index 2290bd607..fc60d5703 100644 --- a/src/content/packages.h +++ b/src/content/packages.h @@ -24,20 +24,24 @@ with this program; if not, write to the Free Software Foundation, Inc., struct Package { + std::string author; std::string name; // Technical name std::string title; - std::string author; std::string type; // One of "mod", "game", or "txp" std::string shortDesc; - std::string url; // download URL u32 release; - std::vector screenshots; + std::string thumbnail; + + bool valid() const + { + return !(author.empty() || name.empty() || title.empty() || + type.empty() || release <= 0); + } - bool valid() + std::string getDownloadURL(const std::string &baseURL) const { - return !(name.empty() || title.empty() || author.empty() || - type.empty() || url.empty() || release <= 0); + return baseURL + "/packages/" + author + "/" + name + "/download/"; } }; -- cgit v1.2.3