View Single Post
Old 06-01-2024, 01:30 PM   #1362
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,052
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
@chaley - here's the saved_searches from the preferences table. I mentioned that the glitch didn't occur on an empty library copying structure (including the searches).

Code:
"{
  ""Books Purchased"": ""#purchasesource:true\nAND NOT #cost:\""=$0.00\"""",
  ""Books Purchased.Freebies"": ""#purchasesource:true\nAND  #cost:\""=$0.00\"""",
  ""Books Purchased.Purchased 2013"": ""#purchasesource:true \nAND date:=2013"",
  ""Books Purchased.Purchased 2014"": ""#purchasesource:true \nAND date:=2014"",
  ""Books Purchased.Purchased 2015"": ""#purchasesource:true \nAND date:=2015"",
  ""Books Purchased.Purchased 2016"": ""#purchasesource:true \nAND date:=2016"",
  ""Books Purchased.Purchased 2017"": ""#purchasesource:true \nAND date:=2017"",
  ""Books Purchased.Purchased 2018"": ""#purchasesource:true \nAND date:=2018"",
  ""Books Purchased.Purchased 2019"": ""#purchasesource:true \nAND date:=2019"",
  ""Books Purchased.Purchased 2020"": ""#purchasesource:true \nAND date:=2020"",
  ""Books Purchased.Purchased 2021"": ""#purchasesource:true \nAND date:=2021"",
  ""Books Purchased.Purchased 2022"": ""#purchasesource:true \nAND date:=2022"",
  ""Books Purchased.Purchased 2023"": ""#purchasesource:true \nAND date:=2023"",
  ""Books Purchased.Purchased 2024"": ""#purchasesource:true \nAND date:=2024"",
  ""Books Read.Read Multiple Times"": ""#timesread:>1"",
  ""Books Read.Read in 2020"": ""#datesread:\""^2020\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Books Read.Read in 2021"": ""#datesread:\""^2021\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Books Read.Read in 2022"": ""#datesread:\""^2022\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Books Read.Read in 2023"": ""#datesread:\""^2023\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Books Read.Read in 2024"": ""#datesread:\""^2024\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Books Read.Reading Goal Multiple Years"": ""template:\""\""\""program: \n\nlist = list_re($#admintags, ',', 'readinggoal:', '');\n\nlist_count(list, ',')#@#:n:>1\""\""\"""",
  ""Books Read.Recently Finished Reading"": ""#readstatus:\""=Read\""\nAND (#lastread:>14daysago)\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""",
  ""Cleanup"": ""tags:\""=[Cleanup]\""\nOR search:\""=Cleanup.Missing Identifiers\"" \nOR search:\""=Cleanup.Missing Metadata\"" \nOR search:\""=Cleanup.Other Issues\"""",
  ""Cleanup.Missing Identifiers"": ""search:\""=Cleanup.Missing Identifiers.Missing amazon: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing ao3: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing ffnet: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing kobo: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing odid: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing standard: identifier\"""",
  ""Cleanup.Missing Identifiers.Missing amazon: identifier"": ""#purchasesource:\""=Amazon\""  \nAND NOT identifiers:\""=amazon:\"""",
  ""Cleanup.Missing Identifiers.Missing ao3: identifier"": ""identifiers:\""=url:\""\nAND NOT #fanficstatus:\""=Anthology\""\nAND publisher:\""=Archive of Our Own\"" \nAND NOT identifiers:\""=ao3:\"""",
  ""Cleanup.Missing Identifiers.Missing ffnet: identifier"": ""identifiers:\""=url:\""\nAND NOT #fanficstatus:\""=Anthology\""\nAND publisher:\""=FanFiction.net\"" \nAND NOT identifiers:\""=ffnet:\"""",
  ""Cleanup.Missing Identifiers.Missing kobo: identifier"": ""#purchasesource:\""=Kobo\""  \nAND NOT (#admintags:\""=removedfromsite:kobo\"" OR identifiers:\""=kobo:\"")"",
  ""Cleanup.Missing Identifiers.Missing odid: identifier"": ""formats:\""=OVERDRIVE\"" \nAND NOT identifiers:\""=odid:\"""",
  ""Cleanup.Missing Identifiers.Missing standard: identifier"": ""publisher:\""=Standard Ebooks\"" \nAND NOT identifiers:\""=standard:\"""",
  ""Cleanup.Missing Metadata"": ""search:\""=Cleanup.Missing Metadata.Missing booktype\""\nOR search:\""=Cleanup.Missing Metadata.Missing counts\""\nOR search:\""=Cleanup.Missing Metadata.Missing languages\""\nOR search:\""=Cleanup.Missing Metadata.Missing purchase cost\""\nOR search:\""=Cleanup.Missing Metadata.Missing fanfic metadata\"""",
  ""Cleanup.Missing Metadata.Missing booktype"": ""#booktype:false"",
  ""Cleanup.Missing Metadata.Missing counts"": ""#pagecount:false\nOR (#chaptercount:false AND NOT formats:paperbook)\nOR (#wordcount:false AND formats:~epub|azw3|mobi)"",
  ""Cleanup.Missing Metadata.Missing fanfic metadata"": ""#booktype:\""=Fanfiction\"" AND \n(#fanficrating:false)"",
  ""Cleanup.Missing Metadata.Missing languages"": ""languages:false"",
  ""Cleanup.Missing Metadata.Missing purchase cost"": ""#purchasesource:true \nAND #purchasecost:false"",
  ""Cleanup.Missing Metadata.No author link"": ""template:\""\""\""program: link =author_links('|',','); if link then 'true' else 'false' fi#@#:t:false\""\""\"""",
  ""Cleanup.Other Issues"": ""search:\""=Cleanup.Other Issues.Missing format\""\nOR search:\""=Cleanup.Other Issues.Dormant Fanfics\""\nOR search:\""=Cleanup.Other Issues.Errored Fanfics\""\nOR search:\""=Cleanup.Other Issues.Unwanted crossovers\""\nOR search:\""=Cleanup.Other Issues.Unwanted identifiers\"""",
  ""Cleanup.Other Issues.Dormant fanfics"": ""#fanficstatus:\""=In-Progress\"" \nAND #fanficupdated:<=365daysago"",
  ""Cleanup.Other Issues.Errored fanfics"": ""(#fanficerror:true \nAND #fanficstatus:~In-Progress|Dormant)\nOR\n(#fanficerror:\""Story does not exist\""\nAND NOT #fanficerror:\""=Story on Reject URLs list.\""\nAND NOT #admintags:\""removedfromsite:\"")"",
  ""Cleanup.Other Issues.Missing format"": ""formats:false"",
  ""Cleanup.Other Issues.Unwanted crossovers"": ""#fanficcat:#=3\nAND\n((#fanficcat:\""=Crossover\"" and #fanficcat:\""=Mass Effect Trilogy\"" and #fanficcat:\""=Mass Effect: Andromeda\"")\nOR (#fanficcat:\""=Crossover\"" and #fanficcat:\""=Half-Life\"" and #fanficcat:\""=Portal\""))"",
  ""Cleanup.Other Issues.Unwanted identifiers"": ""identifiers:\""=mobi-asin:\""\nOR (identifiers:\""=barnesnobke:\"" AND NOT #purchasesource:\""=Barnes & Noble\"" )\nOR (identifiers:\""=kobo:\"" AND NOT #purchasesource:\""=Kobo\"" )\nOR ((#fanficstatus:\""=Completed\"" OR #fanficstatus:\""=Oneshot\"") AND identifiers:\""=url:\"" AND (identifiers:\""=ao3:\"" OR identifiers:\""=ffnet:\""))"",
  ""Cleanup.Other Issues.Wrong ISBN type"": ""identifiers:\""=isbn:\"" AND not identifiers:isbn:~^.{13}$"",
  ""Documentation & Manuals"": ""#booktype:\""=Documentations & Manuals\"""",
  ""Fanfiction"": ""#booktype:\""=Fanfiction\"""",
  ""Fanfiction.Has unread chapters"": ""template:\""program: if fanfic_unreadchaps() >=#1 then 'True' fi#@#:t:True\"" \nAND  NOT #readstatus:\""=Did Not Finish\"""",
  ""Fanfiction.Incomplete Fics"": ""#fanficstatus:\""~(Abandoned|Dormant|In-Progress)\"""",
  ""Fanfiction.Recently Updated"": ""#fanficupdated:>14daysago \nAND NOT #fanficstatus:\""=Oneshot\"""",
  ""Fanfiction.Waiting for update"": ""template:\""program: fanfic_unreadchaps()#@#:n:0\""\nAND  NOT #readstatus:\""=Did Not Finish\"""",
  ""Has annotations"": ""template:\""program: \n\tannotation_count()#@#:n:>=1\"""",
  ""Has eBook"": ""NOT formats:\""~(overdrive|paperbook)\""\nOR NOT formats:#=1"",
  ""Has extra files"": ""template:\""\""\""program: has_extra_files()#@#:b:yes\""\""\"""",
  ""Has physical book"": ""formats:paperbook"",
  ""Has series"": ""series:true"",
  ""Has series notes"": ""template:\""\""\""program: get_note('series', $series, '')#@#:b:yes\""\""\"""",
  ""Is library book"": ""formats:#=1 AND formats:overdrive"",
  ""Is physical book"": ""formats:#=1 AND formats:paperbook"",
  ""On Device"": ""ondevice:true OR #kobostatus:true"",
  ""Partially read series"": ""template:\""\""\""python:\ndef evaluate(book, context):\n\tdb = context.db.new_api\n\tanswer = context.globals.get('answer', None)\n\tif answer is None:\n\t\tanswer = set()\n\t\tall_series = db.all_field_names('series')\n\t\tfor series in all_series:\n\t\t\tseries_id = db.get_item_id('series', series)\n\t\t\tbooks_in_series = db.books_for_field('series', series_id)\n\t\t\tvals = db.all_field_for('#readstatus', books_in_series)\n\t\t\tunique_vals = {v for v in vals.values()}\n\t\t\tif len(unique_vals) > 1:\n\t\t\t\tanswer.add(series)\n\t\tcontext.globals['answer'] = answer\n\treturn 'Yes' if book.series in answer else ''#@#:t:Yes\""\""\"""",
  ""Recently Added"": ""date:>14daysago"",
  ""Recently Modified"": ""#lastmodified:>14daysago"",
  ""Recently Read"": ""#lastread:>14daysago""
}"
fanfic_unreadchaps():

Code:
program:
input = $#kobobookmark;
	if 
		$#booktype == 'Fanfiction'
		&& substr(input, 0, 10) == 'OEBPS/file'
		&& !$#fanficstatus in 'Anthology,Oneshot'
	then
		currentchap = re(input, '.*\/file(\d+).*', '\1') - 1;
		totalchap = $#chaptercount;

		totalchap - currentchap
	fi

Last edited by ownedbycats; 06-01-2024 at 01:38 PM.
ownedbycats is online now   Reply With Quote