FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › Nightlies Feedback › [r1696] ‘AND’ operator not working in XmlApi.
- This topic has 1 reply, 2 voices, and was last updated 14 years, 10 months ago by Anonymous.
-
AuthorPosts
-
01/06/2009 at 4:15 PM #2914AnonymousInactive
As specified in the XmlApi documentation:
You can OR two expresions with a comma (,), and AND two expressions with a plus (+).
GET /databases/1/items?output=xml&query=’daap.songartist:Morrissey’,’daap.songartist:The Smiths’
This would return all songs performed by The Smiths or by Morrissey.
GET /databases/1/items?output=xml&query=’daap.songformat:mp3’+’daap.songbitrate+128′
This would get all mp3s with a bitrate higher than 128Kb.
However, when trying to perform a query with the AND (+) operator, it tosses an error and returns ALL of the items in the library.
LOG OUTPUT:
2009-06-01 12:09:44 (b4cffb90): Request: GET /databases/1/items?output=xml&query=’daap.songartist:Korn’+’daap.songalbum:Greatest%20Hits’ HTTP/1.1
2009-06-01 12:09:44 (b4cffb90): Ignoring bad query (‘daap.songartist:Korn’ ‘daap.songalbum:Greatest Hits’): Offset 24: Expecting end of statementIn contrast, the OR (-) operator functions correctly as expected.
15/06/2009 at 11:50 AM #18592AnonymousInactive@undertow wrote:
However, when trying to perform a query with the AND (+) operator, it tosses an error and returns ALL of the items in the library.
LOG OUTPUT:
2009-06-01 12:09:44 (b4cffb90): Request: GET /databases/1/items?output=xml&query=’daap.songartist:Korn’+’daap.songalbum:Greatest%20Hits’ HTTP/1.1
2009-06-01 12:09:44 (b4cffb90): Ignoring bad query (‘daap.songartist:Korn’ ‘daap.songalbum:Greatest Hits’): Offset 24: Expecting end of statementAs the log shows, your + sign gets decoded to a space. + sign in the query string decodes to space, if you really mean a + sign you need to encode it. Try again with %2b instead of + in your request.
-
AuthorPosts
- The forum ‘Nightlies Feedback’ is closed to new topics and replies.