Decision: Format preferences
If the book selected by the user does not have a file of the desired type, we return the first available e-book file.
Alternatives considered:
-
Raise an error and list the available formats.
This way, the user does not get a file in an unexpected format. But they have to run the program twice and repeat their query.
-
Allow the user to specify multiple formats in order of preference.
This way, they have more control over what file type they get, since they’ve explicitly chosen a fallback. But it makes the CLI options more complicated to explain and requires more upfront work from the user. And to little benefit, since most books in the library should be in one or two of the most common formats (PDF, EPUB, maybe CBZ, AZW). In my personal use of
ebk-findover the last couple of years, I’ve never listed more than one format when using the-fflag. -
Only display books in the right format for selection.
This way, the user will never select a book only to then get an error or a different format than they requested. But they also won’t be reminded of relevant books in their library that just happen to be in a different format. And their preference for a book matching their query is presumably stronger than their preference for a particular file type. They can always just close the opened book if the format is that much of a deal-breaker for that particular book.