C
C#2y ago
EliasGPS

❔ version switch

I'm working on a contentful project. I'm trying to publish my assets but it immeditialy changed my version? Can someone help me?
11 Replies
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
this is the published information
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
this is the second you see the current version changed the code behind this
TwitterData twitterData = new TwitterData();
var profilePicturesList = twitterData.twitter_profilePictures_list_function();

var counter = 1;
var asset = new ManagementAsset();

foreach (var imageUrl in profilePicturesList)
{

String new_asset_id = "asset" + counter;


asset.SystemProperties = new SystemProperties();
asset.SystemProperties.Id = new_asset_id;
asset.SystemProperties.Version = 3;

asset.Title = new Dictionary<string, string> {
{ "en-US", new_asset_id }
};

asset.Files = new Dictionary<string, File>
{
{ "en-US", new File()
{
ContentType = "TwitterFollowers",
FileName = "image.png",
UploadUrl = imageUrl
}
}
};


await client.CreateOrUpdateAsset(asset);
await client.ProcessAsset(new_asset_id, 2, "en-US");
await client.PublishAsset(new_asset_id, 2);
counter++;

}
TwitterData twitterData = new TwitterData();
var profilePicturesList = twitterData.twitter_profilePictures_list_function();

var counter = 1;
var asset = new ManagementAsset();

foreach (var imageUrl in profilePicturesList)
{

String new_asset_id = "asset" + counter;


asset.SystemProperties = new SystemProperties();
asset.SystemProperties.Id = new_asset_id;
asset.SystemProperties.Version = 3;

asset.Title = new Dictionary<string, string> {
{ "en-US", new_asset_id }
};

asset.Files = new Dictionary<string, File>
{
{ "en-US", new File()
{
ContentType = "TwitterFollowers",
FileName = "image.png",
UploadUrl = imageUrl
}
}
};


await client.CreateOrUpdateAsset(asset);
await client.ProcessAsset(new_asset_id, 2, "en-US");
await client.PublishAsset(new_asset_id, 2);
counter++;

}
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
it gives me this error how am i be able to set current version always on 3 without the
await client.PublishAsset(new_asset_id, 2);
await client.PublishAsset(new_asset_id, 2);
i'm be able to send them all
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
it the publish one that is doing someting weird
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
i dn't uderstand this
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server