Skip to content

Commit

Permalink
Upload images instead of decals (#72)
Browse files Browse the repository at this point in the history
* upload as image and not asset

* upload image not decal

* remove decal reference
  • Loading branch information
afujiwara-roblox authored Jan 31, 2025
1 parent 7ea0a08 commit 30292b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tarmac"
description = "Resource compiler and asset manager for Roblox projects"
version = "0.8.1"
version = "0.8.2"
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
edition = "2018"
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/commands/upload_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use fs_err as fs;

use crate::{
options::{GlobalOptions, UploadImageOptions},
roblox_web_api::{RobloxApiClient, RobloxOpenCloudCredentials, DECAL},
roblox_web_api::{RobloxApiClient, RobloxOpenCloudCredentials, IMAGE},
roblox_web_api_types::{ImageUploadData, ImageUploadMetadata},
};

Expand All @@ -18,7 +18,7 @@ pub fn upload_image(
let upload_data = ImageUploadData {
image_data: image_data.into(),
image_metadata: ImageUploadMetadata::new(
DECAL.to_string(),
IMAGE.to_string(),
options.name.to_string(),
options.description.to_string(),
options.user_id,
Expand Down
2 changes: 1 addition & 1 deletion src/roblox_web_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const OPEN_CLOUD_ASSET_OPERATIONS_USER_AUTH: &str =
const OPEN_CLOUD_ASSET_OPERATIONS: &str = "https://apis.roblox.com/assets/v1/operations";

const OPEN_CLOUD_API_KEY_HEADER: &str = "X-API-Key";
pub const DECAL: &str = "Decal";
pub const IMAGE: &str = "Image";

pub struct RobloxOpenCloudCredentials {
auth: RobloxOpenCloudAuth,
Expand Down
4 changes: 2 additions & 2 deletions src/sync_backend.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{borrow::Cow, io, path::Path, thread, time::Duration};

use crate::roblox_web_api::{RobloxApiClient, RobloxApiError, DECAL};
use crate::roblox_web_api::{RobloxApiClient, RobloxApiError, IMAGE};
use crate::roblox_web_api_types::{
ImageUploadData, ImageUploadMetadata, RobloxAuthenticationError,
};
Expand Down Expand Up @@ -45,7 +45,7 @@ impl<'a> SyncBackend for RobloxSyncBackend<'a> {
let upload_data = ImageUploadData {
image_data: Cow::Owned(data.contents),
image_metadata: ImageUploadMetadata::new(
DECAL.to_string(),
IMAGE.to_string(),
data.name.to_string(),
"Uploaded by Tarmac.".to_string(),
None,
Expand Down

0 comments on commit 30292b7

Please sign in to comment.