This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Media
Ahmed Castro edited this page Sep 3, 2018
·
8 revisions
void Instance::addModLogo(u32 mod_id, std::string logo_path, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Uploads a new logo image to a corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
logo_path | const std::string& |
Image's local path to be uploaded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.addModLogo(mod_id, "ModExample/logo.png", [&](const modio::Response& response)
{
if(response.code == 201)
{
//Mod logo added successfully
}
});
void Instance::addModImages(u32 mod_id, std::vector<std::string> image_paths, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Uploads a list of images to the corresponding mod's gallery.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
image_paths | std::vector<std::string> |
Image's local paths to be uploaded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> images;
images.push_back("ModExample/Screenshot1.png");
images.push_back("ModExample/Screenshot2.png");
modio_instance.addModImages(mod_id, images, [&](const modio::Response& response)
{
if(response.code == 201)
{
//Images added successfully
}
});
void Instance::addModYoutubeLinks(u32 mod_id, std::vector<std::string> youtube_links, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Adds a list of youtube links to the corresponding mod's profile.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
youtube_links | std::vector<std::string> |
Youtube links to be added. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> youtube_links;
youtube_links.push_back("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
youtube_links.push_back("https://www.youtube.com/watch?v=JM5v_cR-tCI");
modio_instance.addModYoutubeLinks(mod_id, youtube_links, [&](const modio::Response& response)
{
if(response.code == 201)
{
//Youtube links added successfully
}
});
void Instance::addModSketchfabLinks(u32 mod_id, std::vector<std::string> sketchfab_links, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Adds a list of sketchfab links to the corresponding mod's profile.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
sketchfab_links | std::vector<std::string> |
Sketchfab links to be added. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> sketchfab_links;
sketchfab_links.push_back("https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74");
sketchfab_links.push_back("https://sketchfab.com/models/d66fee8c6cb747509a9bc09c494a726d");
modio_instance.addModSketchfabLinks(mod_id, sketchfab_links, [&](const modio::Response& response)
{
if(response.code == 201)
{
//Sketchfab links added successfully
}
});
void Instance::deleteModImages(u32 mod_id, std::vector<std::string> image_paths, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Deletes a list of images from the corresponding mod's gallery.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
image_paths | std::vector<std::string> |
Images to be deleted. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> image_paths;
image_paths.push_back("Screenshot1.png");
image_paths.push_back("Screenshot2.png");
modio_instance.deleteModImages(mod_id, image_paths, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Images deleted successfully
}
});
void Instance::deleteModYoutubeLinks(u32 mod_id, std::vector<std::string> youtube_links, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Deletes a list of youtube links from the corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
youtube_links | std::vector<std::string> |
Youtube links to be deleted. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> youtube_links;
youtube_links.push_back("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
youtube_links.push_back("https://www.youtube.com/watch?v=JM5v_cR-tCI");
modio_instance.deleteModYoutubeLinks(mod_id, youtube_links, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Images deleted successfully
}
});
void deleteModSketchfabLinks(u32 mod_id, std::vector<std::string> sketchfab_links, const std::function<void(const modio::Response &response)> &callback);
API endpoint used: Add Mod Media
Deletes a list of sketchfab links from the corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
sketchfab_links | std::vector<std::string> |
Sketchfab links to be deleted. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> sketchfab_links;
sketchfab_links.push_back("https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74");
sketchfab_links.push_back("https://sketchfab.com/models/d66fee8c6cb747509a9bc09c494a726d");
modio_instance.deleteModSketchfabLinks(mod_id, sketchfab_links, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Images deleted successfully
}
});
void Instance::downloadImage(const std::string& image_url, const std::string& path, const std::function<void(const modio::Response&)>& callback);
Downloads an image to a desired path given the image url.
Name | Type | Description |
---|---|---|
image_url | const std::string& |
Image url. |
path | const std::string& |
Path where the image will be downloaded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.downloadImage(mod.logo.original, "mods_dir/original.png", [&](const modio::Response& response)
{
if(response.code == 200)
{
//Image downloaded successfully
}
});
- Home
- Table of Contents
- Getting Started
- SDK Methods
- Creators
- Editors
- Schemas
- modio::Avatar
- modio::Comment
- modio::Dependency
- modio::Download
- modio::Error
- modio::Filehash
- modio::Game
- modio::GameTagOption
- modio::Header
- modio::Icon
- modio::Image
- modio::InstalledMod
- modio::Logo
- modio::Media
- modio::MetadataKVP
- modio::Mod
- modio::ModEvent
- modio::Modfile
- modio::QueuedModDownload
- modio::QueuedModfileUpload
- modio::Rating
- modio::Response
- modio::Stats
- modio::Tag
- modio::User
- Debugging
- Constants
-
C Compatibility
- Methods
- Initialization, Process and Shutdown (C compatible)
- User Authentication (C compatible)
- Mods (C compatible)
- Modfiles (C compatible)
- Media (C compatible)
- Subscriptions (C compatible)
- Events (C compatible)
- Stats (C compatible)
- Tags (C compatible)
- Ratings (C compatible)
- Metadata KVP (C compatible)
- Dependencies (C compatible)
- Comments (C compatible)
- Reports (C compatible)
- Me (C compatible)
- Downloads (C compatible)
- Uploads (C compatible)
- Logs (C compatible)
- External Auth (C compatible)
- Configuration (C compatible)
- Creators
- Editors
- Schemas
- ModioAvatar
- ModioComment
- ModioDependency
- ModioDownload
- ModioError
- ModioFilehash
- ModioGame
- ModioGameTagOption
- ModioHeader
- ModioIcon
- ModioImage
- ModioInstalledMod
- ModioListNode
- ModioLogo
- ModioMedia
- ModioMetadataKVP
- ModioMod
- ModioModEvent
- ModioModfile
- ModioQueuedModDownload
- ModioQueuedModfileUpload
- ModioRating
- ModioResponse
- ModioStats
- ModioTag
- ModioUser
- Methods
- Building