INTERACT FORUM
More => Old Versions => JRiver Media Center 25 for Windows => Topic started by: DrKNo on April 07, 2019, 10:09:32 am
-
Is it possible to query the field type via mcws? The documentation doesn't mention anything. Apparently it is possible to create fields along with a type, but not possible to query the type. This would be really useful for automatic type conversion in scripts. Soooo.... pretty please? =)
-
Could you expand a little on what you're thinking? A way to specify a type like "String" and get a list of all the matching fields?
It's a little tricky because fields have a data type and an edit type and I'm not sure which we would search.
Thanks for any clarification.
-
I figure he wants to determine the type of existing fields, not search by type, so if you get a list of values you know eg. which is a Date field, and which is a plain number field. I've had this thought before when w orking on JRemote, since it just wouldn't know which kind of field is a Date.
-
So would it be adding the data type and/or edit type to the Library/Fields function?
-
Thank you for your consideration!
When creating a field, you have to specifiy a data type (e.g. Date, String, Integer...). When querying fields from mcws, knowing these field types would allow proper casting. I didn't even consider the edit type, but this would actually be useful as well in order to provide the best input field for users.
Hendrick got what I meant: Ideally I'd need an endpoint that returns the field names along with the data and edit types, or, optionally, an endpoint that I give a field name as parameter, and input and edit type are returned. Adding this data to the Library/Fields function would be ideal from my point of view, I don't know if that would break backwards compatibility though.
Edit: On the risk of sounding ungrateful, but could we maybe get relational type and allowed values as well? :)
-
I can add that tomorrow. Thanks for the idea ;)
-
It would be nice to expand:
http://localhost:52199/MCWS/v1/Library/Fields
to return some XML which indicated the field's edit and data types, acceptable values, etc. Currently it returns only the field name for non-calculated fields, and the field name + expression for calculated fields.
Likewise, the CreateFields input should take the same XML structure to be able to fully specify the created fields.
I use these new features frequently, so thanks for adding them.
-
I can add that tomorrow. Thanks for the idea ;)
Thank you so much, Matt <3
-
Coming next build:
NEW: Added the edit type and data type to the MCWS Library/Fields function.
Thanks again for the suggestion.