Widget Duration Update in Layouts

Hey All,

Version 1.8.1

I am setting the duration for png images in one of my layouts.

Now the API call i make successfully changes the duration and updates it in the layout\widget as per the body of my request:

$Durationbody = @{
“name” = “$Name”
“duration” = “30”
“retired” = “0”
“updateInLayouts” = “1”
}

the call i am making is:
invoke-webrequest -Method PUT -Uri “WEBADDRESS/api/library/$mediaid” -Headers $Durationhead -Body $Durationbody

Everything seems to work fine. The only things i cant quite get is the ‘Set a duration’ tick box doesn’t get ticked in the widget edit image section.

Is this a bug or am i not making the correct URI call?

Thanks heaps,

Sam

Bit of an update. I think i may need to grab the Widget Id’s and use the ‘useduration=1’ to get this happening.
On the documentation on https://xibo.org.uk/manual/api/#/widget/WidgetEdit

Managed to get it sorted by using the following (note this is in powershell)

ForEach ($W in $Widgets){

$Durationhead = @{
“accept” = “application/json”
“content-type” = “application/x-www-form-urlencoded”
“authorization” = “Bearer $access_token”
“access_token” = “$access_token”}

$Durationbody = @{
“useDuration” = “1”
}
invoke-webrequest -Method PUT -Uri “https://WEBURI/api/playlist/widget/$W” -Headers $Durationhead -Body $Durationbody
}