Conversation
|
Accidentally based this on master, switched it to dev. Will checks re-run? |
|
Hello, |
|
P.S.: Checks will re-run at the next commit in that PR. |
|
Closing/reopening retriggers Travis. I'm not sure if that's a bug or a feature but there you go. ;-) |
|
I think PostgreSQL can probably do something different-but-equivalent to MySQL's FIND_IN_SET and GROUP_CONCAT with arrays. SQLite may not have equivalent functionality at all. It could require multiple queries, temporary tables, or work done outside of the DB to rank the unread entries in each category. |
|
Nothing happened here in the last 1,5 year... |
|
@math-GH Sorting by another criteria than what we have at the moment requires quite some more implementation efforts to be robust with all the cases we need to support. I might work on that when I am done with some of my more important own wishes. This could be in relation with an an automatic weighting of articles based on guessed importance. See related issues / drafts about sorting order |
|
I reimplemented this in a way where it ought to be able to work with the other databases. https://github.com/mdemoss/FreshRSS/tree/1.18.0-with-mdd-shuffle Got stuck trying to figure out how to safely change the DB schema; I need to record when entries get marked as read. |
Problems with chronological sort
I subscribe to a lot of feeds, and feeds differ widely in terms of how often they update and how much time I need to spend on an entry before marking it read. Funny pictures of cats take a second or two to appreciate and crowd the top of the timeline while that two hour long video on the history of pineapple pizza tends to sink lower and lower in the feed, never to be seen again.
So I set about trying to make the less-frequently-updating, more-attention-demanding feeds more visible in a shuffle sort option for FreshRSS.
Description of the shuffle algorithm
Imagine each feed as a stack of cards, with the most recent entries on top. Draw 3 from each stack, shuffle those cards together, and deal. Then repeat the process as the user keeps scrolling. The "shuffle" changes every day because I throw the current date into the hash as well.
This isn't strictly-speaking random, but most user-facing shuffle features in mp3 players and the like aren't really random either.
Limitations
It only works on MySQL (or MariaDB)
I wrote this for MySQL and not all of features I'm using are available in SQLite and Postgres.
This is addressed for the moment just by conditionally hiding the shuffle button.
My guess is this method of shuffling is probably possible in Postgres using different functionality, but may not be possible with SQLite.
Lack of a when-marked-as-read column
When an entry gets marked as read, this alters the sort order of the other entries in that feed. Not ideal. We could stop elements from 'jumping around' if we could mark when an entry was marked read and check for that when building the list of entries from each feed.
I thought the lastSeen column could be used this way, but it can't. It relatates to the last time the entry was seen when updating the feed from its source.
Even without those checks this hasn't turned out to be too noticable. Marking down the date and time when entries are read could enable some more interesting statistics.
Code
It works now, and I've been using it almost every day.
The query when it's put together looks something like this: