Source filters are not documented in the API specification of selfoss. However, they are among the information regarding a source in the /sources responses and are a valid parameter when creating or modifying a source.
This PR adds support for source filter modification. It attempts to modify source filters only if the selfoss API version is > 1. Source filters were supported before then, but it is impossible to determine whether the selfoss instance does support them or not.
Source filters are not documented in the API specification of selfoss. However, they are among the information regarding a source in the /sources responses and are a valid parameter when creating or modifying a source.
This PR adds support for source filter modification. It attempts to modify source filters only if the selfoss API version is > 1. Source filters were supported before then, but it is impossible to determine whether the selfoss instance does support them or not.
## Types of changes
- [x] I have read the **CONTRIBUTING** document.
- [x] My code follows the code style of this project.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] This is **NOT** translation related.
This is implements feature #146
The API for filter is undocumented on the Selfoss API reference, but does exist. We can now allow users setting and modifying filters inside the application.
Source filters have been implemented in 2014 (commit 849957ca) but there is no reliable way to determine whether the selfoss instance does support source filters.
In the createSouce method, you could add an optional parameter filter and add it to the form parameters with something like
if (filter.notNull()) append("filter", filter)
There's no need to create a new method.
In the `createSouce` method, you could add an optional parameter `filter` and add it to the form parameters with something like
```
if (filter.notNull()) append("filter", filter)
```
Sure, sorry for not getting back earlier; I was away on a conference.
I'll address these comments as I get some time - I'm currently flooded in emails.
Sure, sorry for not getting back earlier; I was away on a conference.
I'll address these comments as I get some time - I'm currently flooded in emails.
Some required checks failed
Check PR code / translations (pull_request) Successful in 31s
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Source filters are not documented in the API specification of selfoss. However, they are among the information regarding a source in the /sources responses and are a valid parameter when creating or modifying a source.
This PR adds support for source filter modification. It attempts to modify source filters only if the selfoss API version is > 1. Source filters were supported before then, but it is impossible to determine whether the selfoss instance does support them or not.
Types of changes
This is implements feature #146
@@ -645,2 +645,3 @@createSource(title, url, spout, tags, filter)} else {createSource("tags", title, url, spout, tags)createSourceOld(title, url, spout, tags)There's no need to create a new method.
In the
createSoucemethod, you could add an optional parameterfilterand add it to the form parameters with something like@@ -701,2 +743,3 @@updateSource(id, title, url, spout, tags, filter)} else {updateSource(id, "tags", title, url, spout, tags)updateSourceOld(id, title, url, spout, tags)Same here.
Could you also please rebase your branch ? I fixed an issue with the translation workflow.
Sure, sorry for not getting back earlier; I was away on a conference.
I'll address these comments as I get some time - I'm currently flooded in emails.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.