View Single Post
Old 10-13-2022, 05:27 PM   #8
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
I couldn't stop thinking about the two bits of information in the debug output that pertain to stuff I did, which was about the column #catalog_status and the message 'Not all dates have values'.

So I perused the metadata_db_prefs_backup.json file for my library. I don't have the #catalog_status column anymore, I do have one called #cat_status (I guess I decided I wanted to recreate it with a shorter name). But #catalog_status still appears in a couple places; a saved search and a column color rule.

Saved search:

Spoiler:
Code:
"Missing Formats": "formats:false and not #amzn_resource_type:\"sample\" and not #amzn_resource_type:\"borrowed\" and not #origin_type:\"borrowed\" and not #catalog_status:\"wishlist\" and not #catalog_status:\"loan-returned\" and not #catalog_status:\"loan-active\" and not #catalog_status:\"unknown\" and not #catalog_status:\"physical\"",


Column color rule:

Spoiler:
Code:
    [
      "*row",
      "program:\ntest(strcmp(field('#catalog_status'), \"Wishlist\", '', '1', ''), '#929292', '');"
    ],


The phrase 'Not all dates have values' shows up in a template function (which I am pretty sure is also the basis of a custom column).

Template function:

Spoiler:
Code:
    [
      "bookfusion_status",
      "",
      0,
      "program:\n\tepubmod = select(formats_modtimes('dd MMM yyyy hh:mm'),'EPUB');\n\tbfupload = field('#bookfusion_upload');\n\tbfyn = field('#bookfusion_upload_yn');\n\tepubyn = has_epub();\n\tdiff = compare_bf_epub_dates();\n\tnextstep = field('#next_step');\n\tnextstepbf = contains(nextstep,'.*bookfusion.*','yes',contains(nextstep,'.*done.*','yes','no'));\n\n\n\tif nextstepbf=='no' then return 'Not Ready'\n\telif and(diff >= 0,epubyn=='yes',bfyn=='yes') then return 'Up-to-date'\n\telif diff==-0 then return 'What does negative 0 mean'\n\telif and(diff<0,epubyn=='yes',bfyn=='yes',nextstepbf=='yes') then return 'Reupload'\n\telif and(bfyn=='no',nextstepbf=='yes') then return 'First Upload'\n\telif epubyn=='no' then return 'Needs EPUB'\n\telse return 'Unclear'\n\tfi;\n\n#\tif epub then\n#\t\tif ifempty(epub,'') && ifempty(bfupload,'') then\n#\t\t\tstrcat('EPUB Last Mod: ',epub,' (',days_between(today(),epub),' days ago) | Bookfusion Last Upload: ',bfupload,' (',days_between(today(),bfupload),' days ago) | Days Between EPUB Mod and BF Upload: ',days_between(bfupload,epub))\n#\t\telse\n#\t\t\tprint('Not all dates have values')\n#\t\tfi\n#\telse\n#\t\t''\n#\tfi;"
    ],


I'm not quite sure why any of these are triggering a problem now. Unless I only deleted the old #catalog_status column recently. I do recall deleting some columns I wasn't using, I just can't remember if that was one of them.

Can any of this stuff be deleted from the database to fix it? Or is there some other way to fix it?

Thanks.
tamaracks is offline   Reply With Quote