Dataview booklist for homepage

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I’m trying to create a dataview list that links to books I have set as Completed, Reading, and To Read. I want to have it show most recent updates so if I finish reading a book it shows up in the Completed column.

Things I have tried

> [!multi-column]
> > [!done] Completed
>>  ```dataview
> list
> From #book
where contains(status,"Complete")
> Sort file.ctime DESC
> limit 3
> 
> > [!summary] Reading
>> ```dataview
> list
> > From #book
where contains(status,"Reading")
> Sort file.ctime DESC
> limit 3
> 
>> [!warning] Up Next
>>  ```dataview
>> 	list
>> 	From #book
where contains(status,"To Read")
>> 	Sort file.mtime DESC
>> 	limit 3
>>```
---

Does your script work, or not? Is this a showcase, or is there some hidden question somewhere?

2 Likes

It’s not a showcase. The script runs but I am not sure if it will show my most recent three books in each status. so if I finish reading one book will it now show up in my completed card or will it continue to show just the top 3 that I made?

For something like this, only you yourself will be able to test it out.

Try creating new book files in the same format as your book files and see if the new file replace the old ones in the queries

1 Like

Thanks!

You should most likely use file.mtime consistently, and not file.ctime. That should make your queries return the three most recently modified books. And assuming the last modification was the change of the status, you should be good to go.

Alternatively, you’ll need to start recording properties for when you started to read and/or finished reading any given book, and use that to sort on. Then you wouldn’t be as vulnerable to actually changing other stuff in any given book.

Consider this use case: You’ve completed reading a book a month ago, and changed the status to Complete. Then today you discovered you had made a typo in the book title, so you changed it. Now it was modified today, so the file.mtime is updated, and it’ll show in your Completed column…