Thank you for sharing. Yeah I can’t figure it out either. I do have more that are unread than currently reading. Have you made a table for books that you have read?
EDIT: I figured out shat the problem was with is being reversed. I was using a Emoji in my title which was causing it to reverse.
I also ran into this thread which might help you to clean up the code by using this plugin. DataviewJs - Code reuse: common place for scripts
I still don’t know enough to get it to work, but hopefully this will be helpful for you.