INTERACT FORUM

Please login or register.

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

Author Topic: MCWS Response Change from MC29 to MC30  (Read 1026 times)

hoyt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 865
MCWS Response Change from MC29 to MC30
« on: October 02, 2022, 12:37:00 pm »

I had noticed but hadn't put time in to troubleshooting yet that something was screwing up my python import scripts.  I finally nailed down where the issue is.  I call this:

Code: [Select]
http://127.0.0.1:52199/MCWS/v1/Files/Search?Action=JSON&Fields=Key&Query=[Filename]=%22Y:%5Cfolder%5C2022%5Csubfolder%5Cnew_file.flac%22
In MC29, the response was a blank JSON file if the file wasn't found, so I then knew that this was a new file to be imported.  In MC30, instead I get a server 500 error.  I feel like this was a change at some point recently, but couldn't find it in the forum logs.
Logged

hoyt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 865
Re: MCWS Response Change from MC29 to MC30
« Reply #1 on: October 02, 2022, 12:43:46 pm »

Actually looks like it worked as I expect on 30.0.5, but not 30.0.6:

4. Changed: The MCWS function Files/Search returns a failure if no matching files are found.

That seems wrong.  The server didn't fail....
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10925
Re: MCWS Response Change from MC29 to MC30
« Reply #2 on: October 02, 2022, 01:25:47 pm »

I agree, if anything it should maybe return a 404 and definitely not a 500. But an empty response seems like the most sensible otherwise.
Logged
~ nevcairiel
~ Author of LAV Filters

hoyt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 865
Re: MCWS Response Change from MC29 to MC30
« Reply #3 on: October 02, 2022, 02:56:54 pm »

I agree, if anything it should maybe return a 404 and definitely not a 500. But an empty response seems like the most sensible otherwise.

Yeah.  My thought is that the request is to search.  The search succeeded, so it should be a 200.  The results are just blank.  It's not like I'm calling something by a key value and I'm supplying an invalid key.
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3098
Re: MCWS Response Change from MC29 to MC30
« Reply #4 on: October 04, 2022, 09:09:25 am »

Sorry, this was my change and is useful when you are trying to "play" by the search.  I will modify it to only return an error if you specify the "Play" action and otherwise return an empty response as before.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: MCWS Response Change from MC29 to MC30
« Reply #5 on: October 28, 2022, 02:28:50 pm »

There is still another server error returned for valid SetInfo request when data type is Date or Date (float) and data is not changed. Could you also fix this. If server error response cannot be changed, could you please at least add that "No changes" note to Date scenarios also. This was partially fixed years ago to other field types.


Example:
This call will work the first time (if the value provided ultimately changes the "Date" field):
Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Date&FileType=Filename&Value=2022%2F10%2F26&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3Calling it again will fail, and there is no informational "No changes" message returned.  So it's impossible to determine the difference between a benign 500 server reply and a fatal 500 error.

If the field is changed to be a String field, such as Comment, then the correct informational "No changes" is returned in the server 500 error when there are no changes, so the 500 "error" can be safely ignored.

Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Comment&FileType=Filename&Value=2022%2F10%2F26&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3
And using an unformatted value for a Date field works correctly, the No changes message is returned on subsequent runs, or it just accepts the value and never produces an error.

Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Date&FileType=Filename&Value=44860.7444444444408873&Formatted=0&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3
Logged

Outlaw Audio

  • Junior Woodchuck
  • **
  • Posts: 69
  • Dogs......because people suck
Re: MCWS Response Change from MC29 to MC30
« Reply #6 on: November 05, 2022, 03:02:12 pm »

There is still another server error returned for valid SetInfo request when data type is Date or Date (float) and data is not changed. Could you also fix this. If server error response cannot be changed, could you please at least add that "No changes" note to Date scenarios also. This was partially fixed years ago to other field types.


Example:
This call will work the first time (if the value provided ultimately changes the "Date" field):
Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Date&FileType=Filename&Value=2022%2F10%2F26&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3Calling it again will fail, and there is no informational "No changes" message returned.  So it's impossible to determine the difference between a benign 500 server reply and a fatal 500 error.

If the field is changed to be a String field, such as Comment, then the correct informational "No changes" is returned in the server 500 error when there are no changes, so the 500 "error" can be safely ignored.

Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Comment&FileType=Filename&Value=2022%2F10%2F26&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3
And using an unformatted value for a Date field works correctly, the No changes message is returned on subsequent runs, or it just accepts the value and never produces an error.

Code: [Select]
http://127.0.0.1:52199/MCWS/v1/File/SetInfo?Field=Date&FileType=Filename&Value=44860.7444444444408873&Formatted=0&File=%2Fprivate%2Ftmp%2Ftest%2Ftrack1.mp3

Matt, any feedback on this issue?  Its not particularly crucial to those only running JRiver but becomes more so for those of us running third party apps
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42344
  • Shoes gone again!
Re: MCWS Response Change from MC29 to MC30
« Reply #7 on: November 07, 2022, 08:38:15 am »

I've worked with Outlaw Audio over email and this should be sorted in the next build.  Thanks for the help.
Logged
Matt Ashland, JRiver Media Center

Outlaw Audio

  • Junior Woodchuck
  • **
  • Posts: 69
  • Dogs......because people suck
Re: MCWS Response Change from MC29 to MC30
« Reply #8 on: November 07, 2022, 09:38:18 am »

I've worked with Outlaw Audio over email and this should be sorted in the next build.  Thanks for the help.

Thanks for taking care of this Matt!
Logged
Pages: [1]   Go Up