INTERACT FORUM

More => Old Versions => JRiver Media Center 27 for Windows => Topic started by: zybex on September 15, 2020, 04:20:29 am

Title: MCWS Setinfo() failure when value to write = current value
Post by: zybex on September 15, 2020, 04:20:29 am
When calling SetInfo to set a field value with the same value as the field already has, the API returns "failure".
i.e., calling Setinfo to set "Media Type = Audio" when it's already set to Audio, returns an error.

This is misleading in my view as the call didn't fail - the field was set to the desired value, so there's no error to handle. It should return success.

The same happens on the corresponding COM API call, file.Set(field, value). Please fix.
Title: Re: MCWS Setinfo() failure when value to write = current value
Post by: Matt on September 15, 2020, 09:14:50 am
Next build:
Changed: When no changes are made with a MCWS/v1/File/SetInfo call, the response "No changes." is provided with the failure.
Title: Re: MCWS Setinfo() failure when value to write = current value
Post by: zybex on September 15, 2020, 01:27:19 pm
Thanks Matt.
But why return Failure at all, there is no error. "ok, no change" makes more sense to me.
The COM API only returns true/false... any change there?
Title: Re: MCWS Setinfo() failure when value to write = current value
Post by: Matt on September 15, 2020, 01:46:11 pm
True is only returned when the value is changed.
Title: Re: MCWS Setinfo() failure when value to write = current value
Post by: zybex on September 15, 2020, 06:20:16 pm
This was a recent change, it was not so on v26.0.103 - it returned OK on this scenario. Making breaking protocol changes on the last few versions of a branch is not good practice, and returning an error on an operation that had in fact the desired outcome is nonsensical.