From e91e7be5f78e02fff9d8c20cbe92aad68872198e Mon Sep 17 00:00:00 2001 From: garfield69 Date: Wed, 9 Feb 2022 18:57:06 +1300 Subject: [PATCH] Updated Definition format (markdown) --- Definition-format.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Definition-format.md b/Definition-format.md index 1776f7a..116117b 100644 --- a/Definition-format.md +++ b/Definition-format.md @@ -642,9 +642,9 @@ search: fields: # All the regular filters are available as described elsewhere in the Wiki. I've included some examples. # - # If you have not defined an attribute in the response block above, then all the fields are extracted + # If you have not defined an attribute in the rows block above, then all the fields are extracted # from the rows set. - # If you have defined an attribute in the response block above, then a prefix of .. means that this field + # If you have defined an attribute in the rows block above, then a prefix of .. means that this field # is extracted directly from the rows set, and without a .. prefix you are indicating that the field is # to be extracted from the attribute subset. # @@ -778,6 +778,27 @@ search: # 7 day (as seconds = 7 x 24 x 60 x 60) text: 604800 ``` +The use of `:has()`, `:not()` and `:contains()` are supported by the rows selector and fields selectors. +Examples: +```yaml + rows: + selector: data:has(attributes.size):has(attributes.name:contains(1080)):has(attributes.poster:contains(.jpg)):not(attributes.fake_att):not(attributes.uploader:contains(DarkSwan2001)) + fields: + title_dts: + selector: name:contains(DTS) + optional: true + filters: + - name: re_replace + args: ["DTS", "DTSSS"] + title_notdts: + selector: name:not(:contains(DTS)) + optional: true + title: + text: "{{ if .Result.title_dts }}{{ .Result.title_dts }}{{ else }}{{ .Result.title_notdts }}{{ end }}" + filters: + - name: re_replace + args: ["\\[", " "] +``` ### Search XML This is similar to the JSON method except you code type xml: