-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Articles should be ordered by pubdate when saving them to the database #51
Comments
Also works as expected. Articles are sorted by date added and not by their given published date because there are issues with pagination. The issue is only present the first time you use the app |
I can not confirm that it's working as expected. The sorting is also mixed On Thu, Nov 10, 2016 at 9:35 AM Bernhard Posselt [email protected]
|
They should be in order when they were added. Ordering is done by id which is an auto increment when things are added. So there might be slight differences depending on if the feed reports a wrong date or when articles are added faster than in a different feed. Again, works as expected ;) |
Please read up on the linked issues if you still disagree |
TL;DR: Changes required for fixing this issue are basically the following:
|
I will continue to test the behavior in the next couple of days, but the On Thu, Nov 10, 2016 at 1:34 PM Bernhard Posselt [email protected]
|
Would be interesting if you could provide example feeds. The image was not appended btw |
Here are two examples: http://news.google.com/news?hl=en&gl=us&q=android&um=1&ie=UTF-8&output=rss EDIT: fixed links |
Reason is that google does not publish the articles in order when they were released. A sort by pubdate should work before the loop is being run here https://github.com/nextcloud/news/blob/master/lib/Service/FeedService.php#L238 |
FYI this wont fix the "group" ordering but ordering them by pubdate is probably a good idea when adding new feeds |
The reverse loop can be dropped in favor of a foreach loop. http://php.net/manual/en/function.usort.php can be used to compare items by their pubdate, probably similar to this: usort($items, function ($a, $b) {
return ($a->getPubDate() < $b->getPubDate()) ? -1 : 1;
}); |
@BernhardPosselt Any updates on this matter? 😊 |
@Peque yeah, I stopped maintaing the app. |
@SMillerDev Has this been fixed? Otherwise, if it is not considered a bug, could you simply replace the bug tag with a feature request tag and reopen? 😊 |
Nothing of the original code remains in 15.4, if this issue is still showing a new report should be made. |
Explain the Problem
The list of entries in a group is not sortable by time. It's possible to sort an individual news feed (e.g. newest on top), but as soon as I click on the group to display all feeds in that group, the order gets mixed up.
Steps to Reproduce
System Information
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: