DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
730 stars 70 forks source link

Request: Follow and download books in a given series. #672

Closed txVLN closed 7 years ago

txVLN commented 7 years ago

(Thank you for continuing your awesome work on this project.)

Now that series information is included in the LL database, would it be possible to follow and download only books from designated series, rather than all of an author's books? Some people (cough George RR Martin cough) are involved in a metric ton of projects that result in a lot of for example compilations that may have nothing to do with their primary works.

It would be awesome to set LL to download extensions in a given series when available without having to prune through all of an authors various books.

Thanks!

philborman commented 7 years ago

That's been in the back of my mind for a while. Issue #53 from 2014 references this, but no idea how to implement it neatly. Any suggestions on how to include it in the user interface?

txVLN commented 7 years ago

Separate page for managing all the series current possessed, or marked for following, individually. Book lists on the series pages the same as currently exists for authors.

Menu now: "Authors Books Magazines Manage ..." Possible: "Authors Books Series Magazines Manage ..."

Authors page now: Pause Author / Follow Author / Ignore Author Author Name and artwork Book List

Possible Series page: Pause Series ? Follow Series / Ignore Series Series List

Thoughts?

philborman commented 7 years ago

A few immediate thoughts, but I haven't actually looked at the code yet... There will need to be some series name tidying/checking, we just accept the series and seriesnumber supplied by the downloader in the title (where provided, often it's not), no attempt to check the info yet. For example "Lord of the Rings #3" and "The Lord Of The Rings 2" are the same series.

Maybe need a "validate" routine and a rescan of your existing library on first run.

Where do we get the series info from though, is there a reliable source somewhere we can use? Something easily usable and fairly complete?

How do we handle books that are part of more than one series? eg Terry Pratchett Witches Abroad is Discworld, #12 and also Witches #3 At present we only store one series per book as that's usually all the info we are given in the title, and we only have one "series" column per book.

I guess we would need to create a separate database table of books and the series they are in. Quite a bit of rearranging.

If you need to go through all your books manually adding series info it would be a pain.

neilicious commented 7 years ago

I'm just going to throw my tuppence in because this is a feature that I'd love to see.

For books that are part of more than one series I'd reckon it's probably best on the whole to just ignore the sub-series completely. Granted it's not ideal, but it's only a small percentage of series that are sub-divided in that manner, and I imagine it'll make things considerably easier in terms of parsing and unifying series data.

Goodreads series info seems very good although I've no idea how much of that come's through in the api. Does that just provide the series name or does it also give the series identifier number when doing a basic search? If the latter then I believe another search could be run off of that to get the entire series of books.

philborman commented 7 years ago

Looks like librarything might be a good candidate for the series info, its included in the work page for each book (if librarything knows it) and has a better hit rate than goodreads, plus we already try to grab the work page so we already have a lot of the info without more api hits.

sbelongie commented 7 years ago

that may work

philborman commented 7 years ago

Ok, first attempt is out now, feedback is welcome.

neilicious commented 7 years ago

The changes appear to work really well for the most part so huge kudos due. One thing I did notice that's not quite working is that in a few instances a series of books was attributed to the wrong author. The mis-placed series (there were four or five) came from different authors but were all attributed to one author, who perhaps not coincidentally has his surname come first in alphabetical order of my listed authors.

On a broader note with regard to the series functionality: at present it appears each series is tied entirely to an author. So for example, with my library, going to the wheel of time series shows me only the three books written by brandon sanderson, but none of those written by robert jordan in the same series as I've not added him as an author. What would be great, and I have no idea how feasible it would be, was if we could add a series in the same way that we could add a single book, so that the whole series gets imported without the need for adding the attached author(s).

philborman commented 7 years ago

I think you need to have at least one of the series authors in the database to start with, but it should be possible to pull in the rest of the series and series authors automatically. Needs to be tied into the multiple authors per book issue as it depends on how I get round that. At the moment I'm thinking of creating author groups to do this. Not sure how feasible it is to import books that are part of a series but by an author you don't have, might need to import the author too.

The attributed to wrong author is a bit of a problem. Will need to look into that. Must be a bug somewhere in populating the series or members table

philborman commented 7 years ago

ok, think i've got the multiple author per series bit working. Once you have a book from the series in your database, find the series from the main index (top bar SERIES button) or the individual author SERIES button on the authors page. Mark the series as WANTED and lazylibrarian will pull in any other authors who have books in the series, and mark any missing books as wanted. Or mark the series as ACTIVE (even though it's already active) and lazylibrarian will still pull in the authors and books, but not automatically try to download them.

in your example, go to the wheel of time series, set series as WANTED, robert jordan will be added to your library and the relevant books merged into the wheel of time series. At least it should work :-)

neilicious commented 7 years ago

Gave the new version a try by setting the wheel of time to wanted. Partial success. As expected Robert Jordan appeared in my authors list and the wheel of time books that he wrote were set to wanted. However, there was also some odd behaviour. In addition to Robert Jordan, six other authors were added to my author list. One of these kinda made sense in that he had written a story in a collection of short stories that also featured a wheel of time prequel and so it's possible that's how he got brought in. For the other five I could find no such link.

The only reason I can think that they may have been added is that at present all series in the main series page default to active. So now that LL is looking at any active series and importing authors for it there's scope for some pretty tenuous links to occur. Perhaps if author importing were limited to series set as wanted that could be avoided.

philborman commented 7 years ago

The way it currently works is it asks librarything for a list of books in the series, there is an api command getSeriesMembers(seriesid) that will give a list of author/book/seriesnum for all "members" of the series. We then import any author in that list. Maybe you could try that api command and see if the authors make sense then. If not I might need to look at a different method of getting the series members.

The "active" status just means we haven't said we want the series (wanted) or we don't want the series (skipped) It doesn't affect what's flagged for download.

philborman commented 7 years ago

Made some changes to the way we check series info and tried snatching wheel of time here. Picks up 30 books by Robert Jordan and two by Terry Pratchett but does not pick up any books by Brandon Sanderson. I looked at the Brandon Sanderson website and it seems goodreads attributes the three books he wrote to Robert Jordan, and they were in my list. I guess this is the best we can do unless goodreads updates their series info.

If you upgrade to the latest version of lazylibrarian and run the api command setAllBookSeries it should update the lists correctly. Or you can wait and lazylibrarian will gradually rebuild the lists depending on cache expiry time.