{"action":"created","issue":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/2157","repository_url":"https://api.github.com/repos/Flexget/Flexget","labels_url":"https://api.github.com/repos/Flexget/Flexget/issues/2157/labels{/name}","comments_url":"https://api.github.com/repos/Flexget/Flexget/issues/2157/comments","events_url":"https://api.github.com/repos/Flexget/Flexget/issues/2157/events","html_url":"https://github.com/Flexget/Flexget/pull/2157","id":334032058,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTAzNTk4","number":2157,"title":"[WIP] change irc daemon task_re configuration structure to enable AND conditions","user":{"login":"aidan-","id":327286,"node_id":"MDQ6VXNlcjMyNzI4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/327286?v=4","gravatar_id":"","url":"https://api.github.com/users/aidan-","html_url":"https://github.com/aidan-","followers_url":"https://api.github.com/users/aidan-/followers","following_url":"https://api.github.com/users/aidan-/following{/other_user}","gists_url":"https://api.github.com/users/aidan-/gists{/gist_id}","starred_url":"https://api.github.com/users/aidan-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidan-/subscriptions","organizations_url":"https://api.github.com/users/aidan-/orgs","repos_url":"https://api.github.com/users/aidan-/repos","events_url":"https://api.github.com/users/aidan-/events{/privacy}","received_events_url":"https://api.github.com/users/aidan-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-20T11:16:56Z","updated_at":"2018-06-24T09:29:31Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Flexget/Flexget/pulls/2157","html_url":"https://github.com/Flexget/Flexget/pull/2157","diff_url":"https://github.com/Flexget/Flexget/pull/2157.diff","patch_url":"https://github.com/Flexget/Flexget/pull/2157.patch"},"body":"### Motivation for changes:\r\nThe current `task_re` functionality in the `irc_daemon` plugin allows users to define one or more regex that when matched will cause that task to execute.  When more than one regex is defined for a task, the task is executed when ANY of them are a match.  If you want to only execute a task when regex1 matches AND regex2 matches, this cannot currently be done.\r\n\r\nThis pull request restructures the format of the `task_re` config so both AND conditions and OR conditions can be achieved.\r\n\r\n### Detailed changes:\r\nChange format of `task_re` config to allow a task multiple times with different regexes (OR condition) and multiple regexes to be defined for a single task (AND condition).\r\n\r\n### Config usage if relevant (new plugin or updated schema):\r\nIn this example, the tasks will only execute when both of their respective patterns are a match:\r\n```\r\ntask_re:\r\n  - task: get_movie_entry\r\n    patterns:\r\n      - regexp: (MovieHD)\r\n        field: irc_category\r\n      - regexp: 'true'\r\n        field: irc_scene\r\n  - task: get_tv_entry\r\n    patterns:\r\n      - regexp: (TvHD)\r\n        field: irc_category\r\n      - regexp: 'true'\r\n        field: irc_scene\r\n```\r\nIn this example, the `get_tv_entry` will execute if either regex matches (or both):\r\n```\r\ntask_re:\r\n  - task: get_tv_entry\r\n    patterns:\r\n      - regexp: (TvSD)\r\n        field: irc_category\r\n  - task: get_tv_entry\r\n    patterns:\r\n      - regexp: (TvHD)\r\n        field: irc_category\r\n```\r\n\r\n#### To Do:\r\n\r\n- [ ] Update documentation\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/comments/399742638","html_url":"https://github.com/Flexget/Flexget/pull/2157#issuecomment-399742638","issue_url":"https://api.github.com/repos/Flexget/Flexget/issues/2157","id":399742638,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTc0MjYzOA==","user":{"login":"aidan-","id":327286,"node_id":"MDQ6VXNlcjMyNzI4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/327286?v=4","gravatar_id":"","url":"https://api.github.com/users/aidan-","html_url":"https://github.com/aidan-","followers_url":"https://api.github.com/users/aidan-/followers","following_url":"https://api.github.com/users/aidan-/following{/other_user}","gists_url":"https://api.github.com/users/aidan-/gists{/gist_id}","starred_url":"https://api.github.com/users/aidan-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidan-/subscriptions","organizations_url":"https://api.github.com/users/aidan-/orgs","repos_url":"https://api.github.com/users/aidan-/repos","events_url":"https://api.github.com/users/aidan-/events{/privacy}","received_events_url":"https://api.github.com/users/aidan-/received_events","type":"User","site_admin":false},"created_at":"2018-06-24T09:29:31Z","updated_at":"2018-06-24T09:29:31Z","author_association":"CONTRIBUTOR","body":"Yep! I am happy with this.  How/when should I update the documentation?  Should there be a notice about the change in configuration structure?"}}
{"actor":{"display_login":"aidan-"}}