Order books in their series number if available.
ClosedPublic

Authored by woltherav on Sep 24 2018, 6:24 PM.

Details

Reviewers
leinir
Summary

This allows books in a series category to be ordered by their series number if available.

Putting this up for review because the code is a bit hacky and I'm not sure if it cannot be done better than this.

I briefly also played with using regexps to get the series number from a file name, but I couldn't find a foolproof way of getting the chapter number instead of any other digit, so now chapters without seriesnumber are set at 0 and thus ordered by title.

Diff Detail

Repository
R157 Peruse
Lint
Lint Skipped
Unit
Unit Tests Skipped
woltherav requested review of this revision.Sep 24 2018, 6:24 PM
woltherav created this revision.
leinir accepted this revision.Sep 25 2018, 8:46 AM

Similarly unsure whether we can reasonably make it appreciably cleaner... let's roll with it :)

Yes, heuristics for getting numbers out of filenames is just... really not a straightforward task... At some point in the future, perhaps we might look at the Amarok query builder for that, but yeah, for now, definitely out of scope :)

src/qtquick/CategoryEntriesModel.h
85

Just because it took me a bit to work out what was going on here, i'm thinking it might be good to have a short description of what numbers and volumes mean here... just something short, like "Books can be separated into multiple series, each of which has a Number, and a book inside that number series has a Volume number" to describe the nature of those... Alternatively, given the Number really isn't necessarily a number, per se (such as PKNA and PKNA2, which while they carry numbers aren't inherently just, you know, numbers), perhaps SeriesNames might make better sense... but, yeah, not entirely sure there. It's primarily semantics, but thought i'd mention it - be hard to change once we've done a release with the code in it :)

This revision is now accepted and ready to land.Sep 25 2018, 8:46 AM
woltherav added inline comments.Sep 25 2018, 10:02 AM
src/qtquick/CategoryEntriesModel.h
85

Semantically you can still call those numbers :p (Primarily though, the numbers would be sequence numbers.) Anyway, I'll add a description.

leinir added inline comments.Sep 25 2018, 10:05 AM
src/qtquick/CategoryEntriesModel.h
85

i know you can use letters in your mathematics, but not entirely sure that makes them numbers... ;) But, at any rate, it's all fine and a description to just sort of, well, describe what it's for will remove possible confusions and whatnot, thanks! :)

woltherav closed this revision.Sep 25 2018, 8:47 PM

ack forgot to close this one O_O