![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Auto-delete news
Given that the auto-connect feature is used primarily to download news and given requests such as NSILMike's, I decided to implement automatic deleting of news "books" after some time, matching what calibre does. If a book has the tag "News" and the author "calibre" (both case sensitive) then it is a candidate for deletion.
There are three new preferences:
The preferences screens are shown below. I intend to release this feature to beta this weekend. Comments? |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
Appreciate your effort very much! Some comments and help(?)
1) How does one tell if a specific book has the 'news' tag? In Calibre, I right click the book, and choose 'edit metadata' 2) If I am reading your 3rd bullet correctly, I think to delete yesterday's news at midnight I would set N = 1. What would happen if I set it to 2, so that early the next day I can read things like news blogs that update late in the day, so are set in Calibre to download at 5PM (for example?) 3) Can N be set to different values for individual items? For instance if I use Calibre to download and sync a weekly or monthly magazine, how would that work? Last edited by NSILMike; 05-14-2015 at 08:31 AM. |
![]() |
![]() |
![]() |
#3 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
When you schedule a news download, calibre lets you add extra tags to the news source that will be applied to every book. My thought is that you could add a special tag that tells CC how long news books downloaded by this source should remain on the device. Possible example: cc_delete_after_N where N is the number of days for this news source. CC would process the news normally using the "master" days number. No book would be deleted if it is younger than this value. CC would then check for the existence of a tag beginning with "cc_delete_after_". If CC finds such a tag it would strip the number off the end and delete the book only if that many days (actually (number * 24) hours) had passed. |
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
that works!
|
![]() |
![]() |
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,327
Karma: 78876004
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
I like this feature! Thumbs up!!
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
With the addition to be able to delete different feeds at different times, I will use this. I have both a news feed and comics feeds, but sometimes don't read the comics every day. News might get old, but comics never do!
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I have added the cc_delete_after_N tag processing. With that each feed can have its own timeout, subject to the minimum in CC's settings. If you want the tag to have total control then set CC's preference to zero.
|
![]() |
![]() |
![]() |
#9 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
So far, it's perfect. I've been setting daily news to zero (and haven't had enough time to test weekly or monthly items yet.) If I set daily to one, then two downloads would co-exist in Companion on my device, right? Could/Would that cause any issues that I'd need to look out for...?
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Yes, if your default setting is 1 day then you can have two issues from a given daily news source in CC. I can be more specific and say that you will have two copies of daily news sources if you use auto-connect and the auto-connect is after 00:01. Because in CC a day is 24 hours, with a default of 1 day a news book won't be a candidate for deletion until the second midnight after it is downloaded. I don't see why this situation would cause a problem. They have different file names because the date is embedded into the path. I did exactly this, had multiple copies of a news source, during testing and it worked fine. |
|
![]() |
![]() |
![]() |
#11 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
If you look in CC's Book Details, does the file name for the news book contain a date? Is a new book created when a subsequent news edition is downloaded? |
|
![]() |
![]() |
![]() |
#13 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
Quote:
Update: If I go to 'choose items to display' in CC's settings and set the path to be displayed, I get the same file name (preceded by the path in storage of course...) Last edited by NSILMike; 06-10-2015 at 06:39 PM. |
|
![]() |
![]() |
![]() |
#14 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Looking at calibre's code, in some (perhaps all) situations it sets the pubdate to the current time. The date used in the file name comes from the pubdate. This could lead to interesting consequences if a news article for day X is downloaded in a timezone with the current time having day X-1 or X+1. Calibre's pubdate will not match the news "day". What it looks like is that two CNET downloads happened on the same localtime day, perhaps one just after midnight and one just before midnight. That would give them the same file name but different metadata. Because the file names are the same, CC thinks that the book is not new. The "added to CC" date will not change, although everything else about the book might. So, to end this flight of speculation, when does calibre download the news? Is the date in the news file name always one day old? Does the newest edition always overwrite the previous edition? |
|
![]() |
![]() |
![]() |
#15 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
|
Quote:
2) I have windows set to start Calibre automatically at 4PM each day, and Calibre is set to download several news sources each day at slightly staggered times between 4PM and 5:30PM. Many are set to cc_delete_after_0, but a few are set to cc_delete_after_1. In this specific case (CNET) it's set to 1. This is not much of an issue, so if difficult to fix (as it apparently is...) in CC, I'm fine with it as is. I am getting the updated news source which is my primary objective, and I could just default to cc_delete_after_0 for the daily items. Many thanks for your efforts. Last edited by NSILMike; 06-11-2015 at 08:08 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
auto delete old issues of fetched news? | mukarakaplan | Calibre | 0 | 08-02-2012 04:59 AM |
Is there a way to delete old news from the device when downloading new news? | mwheinz | Library Management | 2 | 01-16-2012 12:15 PM |
Auto-delete source files? | Phyrefly | Library Management | 5 | 06-22-2011 09:16 AM |
Way to Sync Auto-Delete of News with Kindle? | Sawdust99 | Devices | 3 | 03-31-2011 07:58 AM |
Auto-delete old news from device | raduma | Calibre | 3 | 12-16-2009 08:34 PM |