Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2019, 09:26 AM   #1
DirCat
Enthusiast
DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.
 
Posts: 26
Karma: 84276
Join Date: Aug 2011
Location: Tuscaloosa, AL
Device: Samsung Tablet
Search series and tags

(I use FanFicFare to download fanfiction. However, this is purely a search question, so I posted it here. If it needs to go somewhere else, please let me know.)

I have some books where the series is incomplete, where the first {x} books are done (series:true and tags has "Completed") but there are one or more books where the series is incomplete (series:true and tags has "In-Progress").

In addition, I have some series that just have one book in them for now (series:true, but just one book in the series).

Is there a way to find all books within a series that has at least one books in the particular series with the "In-Progress" tag, as well as find any books with a series marked but just one book in the series?

DirCat is offline   Reply With Quote
Old 09-30-2019, 09:47 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
you want the 'count' operator
Quote:
You can search for the number of items in multiple-valued fields such as tags. These searches begin with the character #, then use the same syntax as numeric fields. For example, to find all books with more than 4 tags use tags:#>4. To find all books with exactly 10 tags use tags:#=10.
theducks is offline   Reply With Quote
Old 09-30-2019, 04:54 PM   #3
DirCat
Enthusiast
DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.
 
Posts: 26
Karma: 84276
Join Date: Aug 2011
Location: Tuscaloosa, AL
Device: Samsung Tablet
Quote:
Originally Posted by theducks View Post
you want the 'count' operator
Thanks! However, this doesn't fit the question.

At first I thought it fit the second part of the question (finding out how if a series just has one book in it). I'm not looking for the number of series in a tag-like column. I am looking for the number of books that a particular series has.

What page had the count operator? Maybe it'll have more of what I am looking for.
DirCat is offline   Reply With Quote
Old 09-30-2019, 05:21 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I think he means the count function in calibre's template language see The calibre template language — Function classification - it's a List function, i.e. it operates on lists.

BR
BetterRed is offline   Reply With Quote
Old 09-30-2019, 06:33 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DirCat View Post
Thanks! However, this doesn't fit the question.

At first I thought it fit the second part of the question (finding out how if a series just has one book in it). I'm not looking for the number of series in a tag-like column. I am looking for the number of books that a particular series has.

What page had the count operator? Maybe it'll have more of what I am looking for.
It only works for fields that can contain more than 1 member (Authors, Tags). series can only have 1 member in the field.
theducks is offline   Reply With Quote
Old 09-30-2019, 07:43 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@DirCat - the Manage Series list has a Book Count column, which you can sort.

BR
BetterRed is offline   Reply With Quote
Old 10-02-2019, 01:58 PM   #7
DirCat
Enthusiast
DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.
 
Posts: 26
Karma: 84276
Join Date: Aug 2011
Location: Tuscaloosa, AL
Device: Samsung Tablet
After doing a little more research, I found a plugin that might help - Multi-Column Search. I'm going to play around with it for a bit and, if I can't figure it out, I'll ask in their forum. Thanks!
DirCat is offline   Reply With Quote
Old 10-02-2019, 04:13 PM   #8
DirCat
Enthusiast
DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.DirCat invented the internet.
 
Posts: 26
Karma: 84276
Join Date: Aug 2011
Location: Tuscaloosa, AL
Device: Samsung Tablet
Talking Figured it out!

Quote:
Originally Posted by DirCat View Post
After doing a little more research, I found a plugin that might help - Multi-Column Search. I'm going to play around with it for a bit and, if I can't figure it out, I'll ask in their forum. Thanks!
And that's exactly what I needed to do. I had to install that plugin, install a SQLite viewer (to get the column names), and create 2 SQL statements (one to mark books that met the first conditions (series incomplete), and one to unmark books that no longer met the conditions (series completed).

Now I can add the marked column to my search to find which books need to be downloaded to my tablet.

In case you're interested, here's the first query:
Spoiler:
Code:
/* Series has missing books or just one book */

SELECT id 
FROM books 
WHERE (id IN 
	(SELECT book 
	 FROM books_series_link 
	 WHERE series IN
		(SELECT	series
		 FROM	books_series_link
		 WHERE	book IN
			(SELECT	book
			 FROM	_mcs_tags_by_book
			 WHERE	tagname = 'In-Progress')
		)
	)
OR id IN
	(SELECT book 
	 FROM 	books_series_link 
	 GROUP BY series
	 HAVING	count(series) = 1)
)
AND id NOT IN
	(SELECT	book
	 FROM	custom_column_16
	 WHERE	value = '1')


And here's the second one:
Spoiler:
Code:
/* Reverse of above, to unmark books when the series is completed */

SELECT id 
FROM books 
WHERE (id NOT IN 
	(SELECT book 
	 FROM books_series_link 
	 WHERE series IN
		(SELECT	series
		 FROM	books_series_link
		 WHERE	book IN
			(SELECT	book
			 FROM	_mcs_tags_by_book
			 WHERE	tagname = 'In-Progress')
		)
	)
AND id NOT IN
	(SELECT book 
	 FROM 	books_series_link 
	 GROUP BY series
	 HAVING	count(series) = 1)
)
AND id IN
	(SELECT	book
	 FROM	custom_column_16
	 WHERE	value = '0')


(NOTE: The table custom_column_16 is my special table to say whether to ignore the series or not. If set to Yes (1), it means that the missing pieces aren't important (a substory or the like) and to ignore them in the first script. If set to No (0), once the conditions fail to match anymore, it will allow the second script to find them.)
DirCat is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to search multiple tags at once? JGB Calibre 1 08-24-2017 09:38 PM
Search ignoring tags HarryT Editor 18 06-03-2016 05:54 PM
Command Line problems: ebook-convert, ebook-meta with tags: --series, --series-index omnivorous Calibre 4 11-07-2010 02:42 PM
Classic Search by Tags primetime34 Barnes & Noble NOOK 8 02-20-2010 08:43 PM
How to search only tags? thibaulthalpern Calibre 1 05-21-2009 04:56 PM


All times are GMT -4. The time now is 11:49 AM.


MobileRead.com is a privately owned, operated and funded community.