I recently lost all my saved searches (my own fault) and while I have recovered them from a backup, there were a few tweaks I did that I can't for the life of me remember how I did them. There is one, in particular, I hope to get help with.
I currently have three different "Last Read" versions on my ebooks/fics:
- <b>Last Read:</b> <br/><br/>
- <b>Last Read:</b><em>N/A</em><br/><br/>
- <b>Last Read:</b> 02/02/2022<br/><br/>
Here is the "Find" I have recovered from my backup, which I can get to work for the 2nd & 3rd versions above:
Code:
(<em>N/A</em>| \d{1,2}/\d{2}/\d{4})
but I had at some point modified things so that I could also search for just a space, but I don't know what I did to accomplish that. My current replace (what I had before and now, since this wasn't affected by the loss of my saved searches) is:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
from datetime import datetime
return datetime.now().strftime(" %m/%d/%Y")
I have no idea what I did, but for the last 2 months or so, whenever I would add a book, my title page would have the first option of Last Read above, and when I was done, I would just run my saved search and it would insert the correct date. I just don't remember how I did it.
Can anyone help?
(I *might* have set up a separate S&R for that one, but I'm 98% positive I didn't.)