Repository navigation
Import TT-RSS categories - #5638
Closed
robertdahlem wants to merge 4 commits into
Closed
robertdahlem wants to merge 4 commits into
robertdahlem wants to merge 4 commits into
Conversation
Member
|
Could you please rebase to freshrss:edge? At the moment, this PR also contains #5629 |
Contributor
Author
"origin": {
"category": "..."
},
as category for FreshRSS. When importing a new feed configure the feed
into this category. Creates missiong categories on the fly.
Alkarex
force-pushed
the
import-tt-rss-categories
branch
from
September 10, 2023 15:24
ef64808 to
1d821aa
Compare
Member
It did not work (it was still a mix with the other PR), but I just fixed it. You are welcome to double-check |
| if (!empty($origin['category'])) { | ||
| $new_cat = $this->categoryDAO->searchByName($origin['category']); | ||
| $new_cat_id = $new_cat === null ? $this->categoryDAO->addCategory(['name' => $origin['category']]) : $new_cat->id(); | ||
| if ($new_cat_id != false) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if ($new_cat_id != false) { | |
| if ($new_cat_id !== false) { |
Alkarex
added a commit
that referenced
this pull request
May 4, 2026
* Extension to JSON imports: interpret
"origin": {
"category": "..."
},
as category for FreshRSS. When importing a new feed configure the feed
into this category. Creates missiong categories on the fly.
* Fix syntax
* fix(import): tighten JSON category import follow-ups
- Use strict comparison `!== false` after `addCategory()` so a (theoretical)
zero return from auto-increment is not silently treated as failure
(matches review feedback on #5638).
- Modernise property declaration to typed property syntax, matching the
surrounding `$entryDAO`/`$feedDAO` style.
- Pass `$username` to `createCategoryDao()` in `importFile()` so CLI
imports for a non-current user create categories on the right account,
matching the adjacent entry/feed DAO instantiations.
- Trim the requested category name and skip if it is empty after trim,
so a whitespace-only `"category"` value falls back to the default
category instead of creating a junk row with an empty name. Also
normalises trailing/leading whitespace so `" Tech News "` reuses an
existing `"Tech News"` category.
* Update app/Controllers/importExportController.php
Co-authored-by: Alexandre Alapetite <[email protected]>
---------
Co-authored-by: Robert Dahlem <[email protected]>
Co-authored-by: Alexandre Alapetite <[email protected]>
Co-authored-by: Bjørn A. Andersen <[email protected]>
Member
|
Merged via #8786 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extension to JSON imports: interpret
as category for FreshRSS. When importing a new feed configure the feed into this category. Creates missing categories on the fly.
This is needed by my upcoming TT-RSS exporter. Sorry that this is not relative to
edgebut relative to PR #5629 because I need both for testing.