What I’m trying to do
I have a digital library where I keep track of my books. Up until recently I never had the need to track re-reads books. As I am planning to do some re-reads I was trying to figure out a way to represent that into my obsidian vault - meaning that I want them to appear correctly on my “shelfs” and the data (number of books read per year and etc.)
Things I have tried
The only reference that I could find for this is here but I cant make it work because I can’t figure out how the author was able to make that readdates
property work.
I also tries to add a boolean ReRead
property on the book note which kinda works but my struggle is to tell dataview when it was re-read and make it appear on the read books shelf - I have a note where I have the read books divided by year.
If I try to make a list for the re-read years it seems that dataview handles that as a single “number”.
Example metadata of a book
---
tags:
- book
- fiction
- fantasy
- legendarium
Cover: https://www.dymocks.com.au/Pages/ImageHandler.ashx?q=9780007597338&w=&h=570
Type:
- Fiction
- Fantasy
Series: Legendarium
Order: 1.3
Author: J. R. R. Tolkien
Status: Read
Year: 2024
Month: April
Pages: 259
OrderInYear: 21
StartedDate: 2024-01-29
FinishedDate: 2024-04-10
---
I realize that it would be pretty much impossible to have some properties work properly like OrderInYear
but I am ok with that
Example of a query to show all books read after 2023:
let groups = dv.pages("#book and -#manga").where(p => p.Year != null && p.Year > "2023")
.groupBy(p => p.Year)
for (let group of groups.sort(g => g.key, 'desc')) {
dv.header(2, group.key);
dv.table(
["Cover", "Title", "Pages", "FinishedDate"],
group.rows
.sort(k => k.OrderInYear, 'asc')
.map(k => ["", k.file.link, k["Pages"], k["FinishedDate"]]))
}
Example of a query to show the number of books read per year:
TABLE length(rows)
FROM #book AND -#manga
GROUP BY Year
WHERE Year != null
I know that this might not be possible and appreciate the help in advance!