INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS Setinfo() failure when value to write = current value  (Read 550 times)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
MCWS Setinfo() failure when value to write = current value
« 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.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42388
  • Shoes gone again!
Re: MCWS Setinfo() failure when value to write = current value
« Reply #1 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.
Logged
Matt Ashland, JRiver Media Center

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: MCWS Setinfo() failure when value to write = current value
« Reply #2 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?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42388
  • Shoes gone again!
Re: MCWS Setinfo() failure when value to write = current value
« Reply #3 on: September 15, 2020, 01:46:11 pm »

True is only returned when the value is changed.
Logged
Matt Ashland, JRiver Media Center

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: MCWS Setinfo() failure when value to write = current value
« Reply #4 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.


Logged
Pages: [1]   Go Up