![]() |
#1 | |
Connoisseur
![]() Posts: 56
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
|
Get System File Date
I'm looking for a way to make a column that pulls the system file modified date for each type of file associated with a book.
I found this piece of code on this thread Code:
{:'re(list_item(formats_modtimes('yyyy-MM-dd'), 0, ','), '^.*?:', '')'} Quote:
Is there a way to modify this code to search for only 'epub' or only 'azw' files? I tried editing the part of the equation with the asterisk, but my attempts at trying to figure it out in the template tester only managed to get it to show me the file type modified in the results. I'm intending to make a separate column for each of those book types. |
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,340
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Use
Code:
{:'select(formats_modtimes('yyyy-MM-dd'), 'EPUB')'} Note that getting the modtime requires going to the file system, which can be slow. Having multiple columns isn't more of a problem because the modtimes will be cached when the first column is evaluated |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@tamarissa: You got a response fro @chaley, but, I'd looked at it a bit in that time and had a different response, and a question, so...
That template you have is only looking at the first format returned in the list. I think the following is closer to what you want: Code:
{:'list_re(formats_modtimes('yyyy-MM-dd'), ',', '^(EPUB|AZW).*', '')'} Code:
EPUB:2018-09-02, AZW3:2018-07-22 EPUB:2016-01-14 The real question is: What are you trying to achieve? The file modification date will change as you do things. If you do a conversion, edit the book or use Embed metadata to update the metadata, then the file modification will change. Because of that, I don't know what use this actually is in the day-to-day book management. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 56
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
|
@chaley
That worked up to a point... It definitely visually put the right date dates for the files I cross-checked. But I don't think it puts the date in the column as an actual date. When I tried to search based on dates, I couldn't get any results. I tried to get dates before, dates after, specific dates, and yesterday (I added a new epub yesterday, so there should definitely be a result for that) and couldn't get any results. I used:
Is there something that can make the result a searchable date, or am I missing something (blindingly obvious most likely) in my search? @davidfor As you could likely figure out from my comments above, I'm looking to be able to have a searchable (filterable?) list of dates for when the actual files are last modified. I didn't think that was likely doable from one column, which was why I had them separated into 2 columns. Is it possible to have the results produced from your suggestion give me searchable dates? Most specifically in your scenario, I would be looking for it to show me any books of any type returned that haven't been updated since a specific date. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@tamarissa: Neither mine or @chaley's solutions were complete. Both were just getting the date for a format in the easiest way we could. They needed more work based on what you were trying to do. And, the issue you seemed to be having was getting the modified date for the format. I think we both thought the next step was obvious.
In any case, the following will produce just the date: Code:
{:'list_item(list_item(list_re(formats_modtimes('yyyy-MM-dd'), ',', '^(EPUB|AZW).*', ''),0,','),1,':')'} But, I'm not sure of what the point is. What are you planning to do with this date? Sure, you can search on it or sort by it, but, what will that achieve? About the only thing I can see to use it for is to look for all books where the format is older than calibres modified date and then do an Embed metadata on them. That will update the formats that calibre can do this for, but, I don't see the point in doing this. If you export the book, either via save-to-disk or send-to-device, the metadata is updated in the copy produced. Unless you are doing something else with the book in the library, I don't see the point of doing this. Asking what you are doing is partly curiosity. But, there might be a better way to do what you want to do. Or possibly no way to do it all. Also, I can't quickly see how to get the oldest date of the formats. My code above just takes the first in the list. I think that is the format first added to the book, but, it I'm not sure. And if it is, then it might have have been modified so that doesn't have the oldest modified date. Or have been modified for a reason different to what you are trying to track, but, still needs those changes. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() Posts: 56
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
|
I see... I thought it was just that easy based on the other default date columns in Calibre. And I figured that stating I had to find a code showed I knew nothing about creating a code myself. Sorry. I can sometimes get them adapted to what I want if their super simple, but generally probably less than 50/50 odds.
I knew the searching by date thing was going to be something super simple I just couldn't see, thanks for that ![]() I'm using this information so that I can see when I last updated the metadata to the file. I understand why, but it still drives me nuts that the actual book metadata can only be manually updated. My type-A personality likes to have that information embedded in the book itself as a fail-safe, but I don't need to update every single book every time; this way I can just update the books that have had any metadata updated (read status, series correction, etc.) since it was added to Calibre (if the modification date is greater than the file modification date, the book needs updating). Okay, I think for my purposes and skill level that having separate columns will work just fine for me, now that I know how to make it searchable by date. Thanks for your help! Last edited by tamarissa; 06-02-2020 at 05:33 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sort by system file creation date | Alaa | Calibre | 3 | 02-22-2019 01:41 PM |
Searching by date does not consider System Locale when using ambiguous dates | tempura | Library Management | 2 | 04-12-2014 06:31 AM |
How to show/sort system date of a (epub) file | PalingB | Library Management | 11 | 05-12-2012 11:46 AM |
Pocket Pro System Date | Yanikou | Astak EZReader | 4 | 09-17-2009 12:57 PM |
how to clean more disk space in root file system to upgrade system | chinaet | iRex | 1 | 12-18-2006 03:54 PM |