Page 1 of 2

Undo mark all read

Posted: 02 Nov 2013, 22:56
by cbrannon
I've marked a bunch of articles as read when I shouldn't have. I'm hoping there is a timestamp in the database I can search for that corresponds to that action and flip a 'read/unread' bit on those. I'm poking around in the DB now but if someone can point me to the right table(s)/column(s) that would be helpful.

Thanks,
Chris

Re: Undo mark all read

Posted: 02 Nov 2013, 23:58
by fox
ttrss_user_entries.last_read

Re: Undo mark all read

Posted: 03 Nov 2013, 00:27
by cbrannon
In case this is useful for others, I fixed it with:

UPDATE `cbrannon_ttrss`.`ttrss_user_entries` SET `ttrss_user_entries`.`unread` = '1' WHERE `ttrss_user_entries`.`last_read` = '2013-11-02 18:31:17'

Re: Undo mark all read

Posted: 03 Nov 2013, 00:39
by sleeper_service
*thumbs up*

Re: Undo mark all read

Posted: 03 Nov 2013, 07:37
by bastage
Awesome tip .. thankfully I've never screwed up too badly but for the few times I've had to "fix" a personal user error like this I've done it manually so I'm definitely bookmarking this.

Re: Undo mark all read

Posted: 11 Nov 2014, 17:43
by guly
+1 for a plugin that adds "undo mark all as read" function :)

Re: Undo mark all read

Posted: 20 Nov 2014, 23:56
by Bob
Oops. Thanks for the query, i would never have found that out in my panicked state ;)

Re: Undo mark all read

Posted: 26 Jan 2015, 15:55
by norm
Thanks! Solved my "Mark as read" user failure :)

Re: Undo mark all read

Posted: 10 Feb 2015, 00:35
by k0OAhV

Code: Select all

UPDATE "public"."ttrss_user_entries"
SET "unread" = 't'
WHERE "ttrss_user_entries"."last_read" = '2015..'


This worked for me, :D

Re: Undo mark all read

Posted: 31 Jan 2016, 20:51
by NGPriest
I kinda did

DELETE FROM ttrss_user_entires
WHERE last_read=2016-01-31 hh:mm:ss

And kinda deleted all the rows...
What can i do now? :S

Re: Undo mark all read

Posted: 01 Feb 2016, 03:21
by sleeper_service
NGPriest wrote:I kinda did

DELETE FROM ttrss_user_entires
WHERE last_read=2016-01-31 hh:mm:ss

And kinda deleted all the rows...
What can i do now? :S


this is where the term "backups" comes into play.

Re: Undo mark all read

Posted: 11 Feb 2016, 13:08
by aratistern
For PostgreSQL on a terminal I had to do a few more steps (?):

Code: Select all

sudo -u USERNAME psql


Connect to your database:

Code: Select all

\connect DATABASENAME


Find out the exact time when the "Mark as read" happened:

Code: Select all

SELECT last_read FROM ttrss_user_entries;


This will output a single column with values for all entries in your database. You will see a date/time repeat a lot, that is the exact time when the "Mark as read" happened. In my case for example:
2016-02-11 09:10:24.577955
Write it down / copy it.

Then run:

Code: Select all

update ttrss_user_entries set unread = 't' where last_read='2016-02-11 09:10:24.577955';

Code: Select all

update ttrss_user_entries set last_read = NULL where last_read='2016-02-11 09:10:24.577955';


I noticed that it will take some time / clicking around in the web interface until the unread badges are correctly updated...

With thanks to http://randomjct.blogspot.co.uk/2013/08 ... t-rss.html

Re: Undo mark all read

Posted: 22 Feb 2016, 06:23
by rcaputo
I saw a suggestion to make this a plugin. If someone's writing one, this more sophisticated/overengineered query might help:

Code: Select all

SELECT last_read, COUNT(last_read) AS ct
FROM ttrss_user_entries
GROUP BY last_read
HAVING COUNT(last_read) >= 10
ORDER BY last_read DESC
LIMIT 20;

Re: Undo mark all read

Posted: 22 Feb 2016, 15:40
by pcause
I have actually built and am testing a plugin to extended mark read and also add a mark unread. The plugin allows you to:

- select your timeframe : N {hours/days/weeks/months}
- qualify by search keywords, using the same syntax as the tt-rss search
- mark the items that match the above read or unread.

Use the code from the base "mark read" command for a start and also the function that creates the search string. The thing that isn't working yet is the mark read/under on the top level of labels if you have a search criteria specified. Also, I've only tested postgresql, as that is what I use. I have the mysql code there but it is untested. I expect to have this ready for others to try late this week or on the weekend.

Re: Undo mark all read

Posted: 19 Dec 2016, 19:30
by adhawkins
pcause wrote:I have actually built and am testing a plugin to extended mark read and also add a mark unread.

[snip]

I expect to have this ready for others to try late this week or on the weekend.


Have you made any progress on this? I've just inadvertantly marked all of my unread articles as read. While I managed to undo it using direct database access, having an easy way to undo this would be useful.

Thanks

Andy