mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-14 18:23:52 -04:00
Better OPML import of feeds in multiple categories (#3286)
#fix https://github.com/FreshRSS/FreshRSS/issues/3284 Helps https://github.com/FreshRSS/FreshRSS/issues/1989 In OPMLs files in which feeds are listed several times, favour the version in a category instead of in no category.
This commit is contained in:
committed by
GitHub
parent
4abb30228b
commit
4f74215199
@@ -251,6 +251,13 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
|
||||
$nb_cats = count($this->catDAO->listCategories(false));
|
||||
$limits = FreshRSS_Context::$system_conf->limits;
|
||||
|
||||
//Sort with categories first
|
||||
usort($opml_elements, function ($a, $b) {
|
||||
return strcmp(
|
||||
(isset($a['xmlUrl']) ? 'Z' : 'A') . $a['text'],
|
||||
(isset($b['xmlUrl']) ? 'Z' : 'A') . $b['text']);
|
||||
});
|
||||
|
||||
foreach ($opml_elements as $elt) {
|
||||
if (isset($elt['xmlUrl'])) {
|
||||
// If xmlUrl exists, it means it is a feed
|
||||
|
||||
Reference in New Issue
Block a user