Extend the categories model with some extra items.
ClosedPublic

Authored by woltherav on Sep 23 2018, 4:43 PM.

Details

Summary

This patch does three things:

First it enables multiple authors and series support. Series still has a bit of a downside that now the series carousel shows all books in the same series as the current book, but we'll just need to think about how to access other series.

Second, it enables reading/writing to and from the KFileMetaData ratings, tags and user comments. These have been integrated into the BookTile, and you can edit them from there. I didn't add these to the database, as it didn't seem sensible to cache these.

Finally, it adds 'description' from the default annotation.

I had to hide the comment/tags from the booktile in book.qml because the widget was too small.

Anyway, as I was modifying the category entries anyway, I figured doing the KFileMetaData stuff as well.

Diff Detail

Repository
R157 Peruse
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
woltherav requested review of this revision.Sep 23 2018, 4:43 PM
woltherav created this revision.

Great stuff, push away! :)

No showstopper or anything, just for a bit of background: The reason behind caching everything is that file system access is super expensive, so causing file system access for cached entries seems perhaps less than good. To test whether this is sufficiently fast for you, turn off your file indexer (balooctl stop should do that nicely). If it is, indeed, fast enough, then go for it, otherwise caching will want to happen for those parts as well... We need some way to update the cache when the filesystem has changed, but i'm as yet unsure of how to properly deal with that... However, that doesn't have to stop the patch going in, just something to check :)

leinir accepted this revision.Mon, Sep 24, 9:58 AM
This revision is now accepted and ready to land.Mon, Sep 24, 9:58 AM

Great stuff, push away! :)

No showstopper or anything, just for a bit of background: The reason behind caching everything is that file system access is super expensive, so causing file system access for cached entries seems perhaps less than good. To test whether this is sufficiently fast for you, turn off your file indexer (balooctl stop should do that nicely). If it is, indeed, fast enough, then go for it, otherwise caching will want to happen for those parts as well... We need some way to update the cache when the filesystem has changed, but i'm as yet unsure of how to properly deal with that... However, that doesn't have to stop the patch going in, just something to check :)

Weirdly enough, on my system, if a file has not been indexed by baloo, Peruse just doesn't see it.

Anyway, I decided to rewire some stuff to get rating and such indexed. Now, when the booktile is accessed it'll get the rating/tags/comments from the file system. There's still no way to update the data base... because there's no way to update the data base :)

Anyway, I double checked the database is working and updating user data is working, but we really need to figure out how to get the data base to update if there's been a change. BookListModel::setBookData becomes a little useless like this :) Will push in a bit.

Great stuff, push away! :)

No showstopper or anything, just for a bit of background: The reason behind caching everything is that file system access is super expensive, so causing file system access for cached entries seems perhaps less than good. To test whether this is sufficiently fast for you, turn off your file indexer (balooctl stop should do that nicely). If it is, indeed, fast enough, then go for it, otherwise caching will want to happen for those parts as well... We need some way to update the cache when the filesystem has changed, but i'm as yet unsure of how to properly deal with that... However, that doesn't have to stop the patch going in, just something to check :)

Weirdly enough, on my system, if a file has not been indexed by baloo, Peruse just doesn't see it.

If baloo is enabled, that's the expected behaviour - Peruse doesn't touch the filesystem unless baloo is turned off :) It would perhaps be a useful thing to be able to do both... check with baloo if a folder is supposed to be indexed, and if it isn't, feed it to the filesystem scraper... the technical reason for the weirdness you see is straightforward enough, but it /does/ just look broken if you don't know that :)

Anyway, I decided to rewire some stuff to get rating and such indexed. Now, when the booktile is accessed it'll get the rating/tags/comments from the file system. There's still no way to update the data base... because there's no way to update the data base :)

Yup, that's definitely something that'll need doing - but also not exactly trivial, so not to worry :)

Anyway, I double checked the database is working and updating user data is working, but we really need to figure out how to get the data base to update if there's been a change. BookListModel::setBookData becomes a little useless like this :) Will push in a bit.

Yeah... booklistmodel does know about the cache, so being able to do a quick update, rather than just fill and load, would certainly be handy :) Perhaps also do it when someone loads the book... hmm...
This revision was automatically updated to reflect the committed changes.