INTERACT FORUM
More => Old Versions => JRiver Media Center 30 for Windows => Topic started by: hoyt on November 26, 2022, 12:54:29 pm
-
Is it possible to make the [Filename] search be an exact match? Or to provide an extra parameter for exact matching? I executed the following:
http://127.0.0.1:52199/MCWS/v1/Files/Search?Action=JSON&Fields=Key&Query=[Filename]=%22Y:%5Calbums%5CDave%20Matthews%20Band%20-%20Live%20Trax,%20Vol%2060%20[1995-08-20%20-%20Cincinnati%20Music%20Hall,%20Cincinnati,%20OH%20(2022)]%5CCD2%5C04%20-%20Two%20Step%20].flac%22
It matched 57 items in my library. Anything that happened to have the word Cincinnati in it. Two examples:
[{"Key":2612445,"Filename":"Y:\\albums\\Justin Hurwitz performed by Various Artists - La La Land (2016)\\26 - Cincinnati.flac","Name":"Cincinnati"}]
[{"Key":993022,"Filename":"Y:\\albums\\Dave Matthews Band - Warehouse 10 Vol 1\\03 Tripping Billies (08.22.07 Riverbend Music Center, Cincinnati, OH).flac","Name":"Tripping Billies (08.22.07 Riverbend Music Center, Cincinnati, OH)"}]
-
Put brackets around your search. More here:
https://wiki.jriver.com/index.php/Search_Language
-
Put brackets around your search. More here:
https://wiki.jriver.com/index.php/Search_Language
Thanks!!
-
I must be missing something:
http://127.0.0.1:52199/MCWS/v1/Files/Search?Action=JSON&Fields=Key&Query=[Filename]=[Y:%5Calbums%5CDave%20Matthews%20Band%20-%20Live%20Trax,%20Vol%2060%20[1995-08-20%20-%20Cincinnati%20Music%20Hall,%20Cincinnati,%20OH%20(2022)]%5CCD2%5C04%20-%20Two%20Step%20].flac]
Still returns the same set of 57 matching files. Do the brackets in the file name screw that up? I tried using url encoding for those brackets too, but same result.
-
If your string contains special chars like double quotes or brackets (in any shape, round, swirly, square), or the slash, you might need to escape them using a slash, eg "/["
URL encoding wouldn't work, because that is already gone by the time MC processes the search. So need to use MC encoding for special characters - which is just escaping with slashes.
-
If your string contains special chars like double quotes or brackets (in any shape, round, swirly, square), or the slash, you might need to escape them using a slash, eg "/["
URL encoding wouldn't work, because that is already gone by the time MC processes the search. So need to use MC encoding for special characters - which is just escaping with slashes.
That did the trick! Thanks! I had always been attempting to URL encode weird characters on that MCWS call, but it makes sense that it wouldn't matter to MC.
-
I have a similar issue to the one prompting this thread, but not identical. I'm trying to query on the Catalog # field, but getting no results, or results not at all what i expect.
A typical query may look like this:
http://localhost:52199/MCWS/v1/Files/Search?Action=JSON&ActiveFile=-1&Zone=-1&ZoneType=ID&Query=([Catalog%20#]=[8.550540])
in which I'm trying to locate files with a Catalog # field = 8.550540
This particular query returns a list of JPEG image files that all seem to contain the string "catalog" in their Filename or Name fields. Not what I would expect.
I've also tried URL-encoding the hash in the field name (i.e., Catalog%20%23), as well as escaping my query value with a right slash (i.e., 8\.550540), all to no effect, or rather, an empty result set.
Could someone kindly tell what I'm doing wrong?
Many thanks in advance.
-
Try this in the search window as a test:
[Catalog #]=8.550540
assuming there is a space in Catalog #.
-
Try this in the search window as a test:
[Catalog #]=8.550540
assuming there is a space in Catalog #.
Thank you for your reply.
Trying as you suggest, I get the same response, i.e., only the image files with "catalog" in the the Name or Filename fields are returned, and not the .FLAC audio files I am expecting.
I don't think there is anything inherently wrong in querying on a field with a space in the field name. For instance, this query:
http://localhost:52199/MCWS/v1/Files/Search?Action=JSON&ActiveFile=-1&Zone=-1&ZoneType=ID&Query=([Album%20Artist]=[Leonard%20Bernstein])
works just fine, i.e., it returns all the files with Album Artist = Leonard Bernstein.
It seems to be something particular to the Catalog # field.
-
In the search window, this seems to work for me: [Catalog #]="" (meaning no Catalog #).
-
In the search window, this seems to work for me: [Catalog #]="" (meaning no Catalog #).
Ah, right. I'm sorry. I did not take your meaning in your earlier reply. When you say 'search window', you mean the top right search box in the Media Center interface.
Okay, so, when I search as you suggest in the search window with [Catalog #]=8.553630, I do get the correct search result expected. However, the same search done using MCWS, as in:
http://localhost:52199/MCWS/v1/Files/Search?Action=JSON&ActiveFile=-1&Zone=-1&ZoneType=ID&Query=([Catalog%20#]=8.553630)
or
http://localhost:52199/MCWS/v1/Files/Search?Action=JSON&ActiveFile=-1&Zone=-1&ZoneType=ID&Query=([Catalog%20#]=[8.553630])
produces only a list of files containing "catalog" in the Name or Filename fields, and definitely not the same search results I got from the Media Center interface.
So, MCWS is not correctly interpreting the search criteria, or at least, not in the same manner as the front-end search interface in Media Center.
I hope that makes sense.
Thank you.
-
Try using %23 in place of #
-
Try using %23 in place of #
I had tried this, as mentioned in one of my earlier messages, but for whatever reason, trying it a second time around, it worked!
Many thanks for prompting me to try again, and to other responders for helping to quickly sort this out.