Allow modifying source filters #198

Open
davidoskky wants to merge 3 commits from davidoskky/ReaderForSelfoss-multiplatform:filters into master
Contributor

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

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This is NOT translation related.

This is implements feature #146

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
davidoskky added 3 commits 2025-04-13 18:03:39 +00:00
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.
Add filters only with selfoss >= 2.19
Some checks failed
Check PR code / translations (pull_request) Successful in 31s
Check PR code / Lint (pull_request) Failing after 37s
Check PR code / build (pull_request) Has been skipped
9e140aefa6
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.
AmineB requested changes 2025-04-15 19:36:19 +00:00
@ -645,2 +645,3 @@
createSource(title, url, spout, tags, filter)
} else {
createSource("tags", title, url, spout, tags)
createSourceOld(title, url, spout, tags)
Owner

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) 
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) ```
@ -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)
Owner

Same here.

Same here.
Owner

Could you also please rebase your branch ? I fixed an issue with the translation workflow.

Could you also please rebase your branch ? I fixed an issue with the translation workflow.
Some checks failed
Check PR code / translations (pull_request) Successful in 31s
Check PR code / Lint (pull_request) Failing after 37s
Check PR code / build (pull_request) Has been skipped
This pull request has changes conflicting with the target branch.
  • shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/Repository.kt

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u filters:davidoskky-filters
git checkout davidoskky-filters
Sign in to join this conversation.
No description provided.