Undo mark all read
Undo mark all read
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
Thanks,
Chris
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: Undo mark all read
ttrss_user_entries.last_read
Re: Undo mark all read
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'
UPDATE `cbrannon_ttrss`.`ttrss_user_entries` SET `ttrss_user_entries`.`unread` = '1' WHERE `ttrss_user_entries`.`last_read` = '2013-11-02 18:31:17'
- sleeper_service
- Bear Rating Overlord
- Posts: 884
- Joined: 30 Mar 2013, 23:50
- Location: Dallas, Texas
Re: Undo mark all read
*thumbs up*
Re: Undo mark all read
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
+1 for a plugin that adds "undo mark all as read" function
Re: Undo mark all read
Oops. Thanks for the query, i would never have found that out in my panicked state
- Attachments
-
- Oops
- Screen Shot 2014-11-20 at 20.55.07.png (37.76 KiB) Viewed 7959 times
Re: Undo mark all read
Thanks! Solved my "Mark as read" user failure
Re: Undo mark all read
Code: Select all
UPDATE "public"."ttrss_user_entries"
SET "unread" = 't'
WHERE "ttrss_user_entries"."last_read" = '2015..'
This worked for me,
Re: Undo mark all read
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
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
- sleeper_service
- Bear Rating Overlord
- Posts: 884
- Joined: 30 Mar 2013, 23:50
- Location: Dallas, Texas
Re: Undo mark all read
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.
-
- Bear Rating Trainee
- Posts: 16
- Joined: 27 Mar 2014, 12:29
Re: Undo mark all read
For PostgreSQL on a terminal I had to do a few more steps (?):
Connect to your database:
Find out the exact time when the "Mark as read" happened:
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:
Then run:
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
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:
Write it down / copy it.2016-02-11 09:10:24.577955
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
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
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.
- 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
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
Who is online
Users browsing this forum: No registered users and 3 guests