codex 1.6.19__py3-none-any.whl → 1.7.0a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/db.py +119 -0
- codex/librarian/covers/purge.py +1 -1
- codex/librarian/importer/const.py +7 -1
- codex/librarian/importer/create_fks.py +5 -2
- codex/librarian/importer/importerd.py +17 -12
- codex/librarian/importer/moved.py +44 -13
- codex/librarian/importer/tasks.py +2 -0
- codex/librarian/janitor/cleanup.py +21 -8
- codex/librarian/janitor/integrity.py +369 -0
- codex/librarian/janitor/janitor.py +50 -15
- codex/librarian/janitor/latest_version.py +2 -1
- codex/librarian/janitor/status.py +5 -0
- codex/librarian/janitor/tasks.py +37 -0
- codex/librarian/janitor/update.py +1 -1
- codex/librarian/librariand.py +32 -24
- codex/librarian/search/optimize.py +43 -0
- codex/librarian/search/remove.py +18 -46
- codex/librarian/search/searchd.py +14 -17
- codex/librarian/search/status.py +2 -1
- codex/librarian/search/tasks.py +4 -9
- codex/librarian/search/update.py +223 -301
- codex/librarian/watchdog/observers.py +2 -1
- codex/migrations/0029_comicfts.py +58 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +198 -0
- codex/models/admin.py +15 -6
- codex/models/base.py +9 -0
- codex/models/bookmark.py +3 -3
- codex/models/comic.py +68 -16
- codex/models/functions.py +59 -2
- codex/models/groups.py +6 -1
- codex/models/library.py +1 -3
- codex/models/paths.py +9 -3
- codex/serializers/browser/page.py +2 -0
- codex/settings/settings.py +16 -17
- codex/signals/django_signals.py +4 -10
- codex/startup.py +1 -35
- codex/static_root/assets/{VCheckbox-Cko1sQK-.170726b3b8a1.js → VCheckbox-CWiqcZ7a.3feebd47daab.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-Cko1sQK-.js → VCheckbox-CWiqcZ7a.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js → VCheckboxBtn-Dk3iB62X.bc66d5351baa.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.js → VCheckboxBtn-Dk3iB62X.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.js → VCombobox-D1_KU27A.b1d30587a973.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.caf59fba486e.js → VCombobox-D1_KU27A.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.6eea3ca762a5.js → VDialog-GbxvFMMN.594fb3a39ced.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.js → VDialog-GbxvFMMN.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js → VExpansionPanels-Cywv_bEj.a762e63858e5.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.js → VExpansionPanels-Cywv_bEj.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.a4f25edb86d3.js → VRadioGroup-C0etmxpZ.0eb3009a6300.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.js → VRadioGroup-C0etmxpZ.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.e98745d858eb.js → VSelect-txrnRiNJ.a5625760018c.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.js → VSelect-txrnRiNJ.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.1e1fda62ceba.js → VSelectionControl-CY6RmcvW.7e8824224f6c.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.js → VSelectionControl-CY6RmcvW.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.360bdefcd215.js → VSlideGroup-DtEQMwY1.6c72325635ed.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.js → VSlideGroup-DtEQMwY1.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.1149f56ad566.js → VTable-2af995xo.6c5bf36631b2.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.js → VTable-2af995xo.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.26d8761e0155.js → VTextField-G6CMj7yO.657a130dd302.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.js → VTextField-G6CMj7yO.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.afbc08414765.js → VWindowItem-CzoGd6Ul.721e5da11ad4.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.js → VWindowItem-CzoGd6Ul.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.d031ea42d8d0.js → admin-CsPAIQeG.5175467148a3.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.js → admin-CsPAIQeG.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.b1a44b05f482.js → admin-drawer-panel-BAT7GA64.73a064628c19.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.js → admin-drawer-panel-BAT7GA64.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js +1 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.js +1 -0
- codex/static_root/assets/browser-C18l93yc.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.js.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.9dde66036c72.js → confirm-dialog-CbW3hlOp.9dd39b443c31.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.js → confirm-dialog-CbW3hlOp.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.3dc314b3295d.js → datetime-column-uSqKZU37.b157b0743db5.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.js → datetime-column-uSqKZU37.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.d0c3b602e62d.js → filter-CBl5KEsB.845a81573c2e.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.js → filter-CBl5KEsB.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.a81fdd258117.js → group-tab-BOW9kigw.7e5007596367.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.js → group-tab-BOW9kigw.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.52ced6f28420.js → http-error-C6yuLApo.45cf99eb7a70.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.js → http-error-C6yuLApo.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.ece2d642a9dc.js → library-tab-D3WOtpE0.9af34e6e7235.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.js → library-tab-D3WOtpE0.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.4722195bb60b.css → pagination-toolbar-DGrxp2OD.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.css → pagination-toolbar-DGrxp2OD.f960a624f04f.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-CkIzuyx1.00c354a82e6e.js → pagination-toolbar-JH3Kbffr.451171f7ac33.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-CkIzuyx1.js → pagination-toolbar-JH3Kbffr.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.0f056fa321b6.js → pdf-doc-BcRNpoaW.882f6e967869.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.js → pdf-doc-BcRNpoaW.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.css.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.js → relation-chips-3tTlR5QH.71f18bc92adc.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.a58031ff8141.js → relation-chips-3tTlR5QH.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.js → settings-drawer-BdyFhA_r.151f4c3061ed.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.1d07ce084fc9.js → settings-drawer-BdyFhA_r.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.9b7a71e7fe28.css → stats-tab-DpfGsVX3.1cb66f2649a9.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.css → stats-tab-DpfGsVX3.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.css.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.97e07e366ddd.js → task-tab-C8D0qRP_.d4ab174c69a3.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.js → task-tab-C8D0qRP_.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.css → unauthorized-BjhIc97q.728511c92cd0.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.2166ec8b3a32.css → unauthorized-BjhIc97q.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.css.gz +0 -0
- codex/static_root/assets/{user-tab-CHbyN1EW.e7206db08680.js → user-tab-BU31Z92y.35613c713faf.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.gz +0 -0
- codex/static_root/assets/{user-tab-CHbyN1EW.js → user-tab-BU31Z92y.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.js.gz +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json +1 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.br +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.gz +0 -0
- codex/static_root/js/choices-admin.json +1 -1
- codex/static_root/js/choices-admin.json.br +0 -0
- codex/static_root/js/choices-admin.json.gz +0 -0
- codex/static_root/manifest.45cb46e19686.json +635 -0
- codex/static_root/manifest.45cb46e19686.json.br +0 -0
- codex/static_root/manifest.45cb46e19686.json.gz +0 -0
- codex/static_root/manifest.json +248 -248
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/status_controller.py +10 -4
- codex/views/admin/tasks.py +46 -40
- codex/views/auth.py +15 -4
- codex/views/browser/annotations.py +94 -51
- codex/views/browser/base.py +1 -2
- codex/views/browser/browser.py +52 -21
- codex/views/browser/cover.py +8 -4
- codex/views/browser/filters/annotations.py +28 -6
- codex/views/browser/filters/search/__init__.py +1 -0
- codex/views/browser/filters/search/aliases.py +81 -0
- codex/views/browser/filters/search/field/__init__.py +1 -0
- codex/views/browser/filters/search/field/column.py +53 -0
- codex/views/browser/filters/search/field/expression.py +177 -0
- codex/views/browser/filters/search/field/filter.py +70 -0
- codex/views/browser/filters/search/field/optimize.py +71 -0
- codex/views/browser/filters/search/field/parse.py +187 -0
- codex/views/browser/filters/search/fts.py +38 -0
- codex/views/browser/filters/search/parse.py +220 -0
- codex/views/browser/order_by.py +8 -2
- codex/views/browser/page_in_bounds.py +88 -0
- codex/views/browser/paginate.py +28 -113
- codex/views/const.py +0 -1
- codex/views/opds/v1/feed.py +2 -1
- codex/views/opds/v2/feed.py +2 -1
- codex/views/opds/v2/links.py +1 -1
- codex/views/reader/books.py +1 -1
- codex/views/reader/page.py +3 -3
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/METADATA +18 -10
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/RECORD +321 -372
- codex/_vendor/__init__.py +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/AUTHORS +0 -127
- codex/_vendor/django_haystack-3.2.1.dist-info/INSTALLER +0 -1
- codex/_vendor/django_haystack-3.2.1.dist-info/LICENSE +0 -31
- codex/_vendor/django_haystack-3.2.1.dist-info/METADATA +0 -98
- codex/_vendor/django_haystack-3.2.1.dist-info/RECORD +0 -97
- codex/_vendor/django_haystack-3.2.1.dist-info/REQUESTED +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/WHEEL +0 -5
- codex/_vendor/django_haystack-3.2.1.dist-info/top_level.txt +0 -1
- codex/_vendor/haystack/__init__.py +0 -80
- codex/_vendor/haystack/admin.py +0 -163
- codex/_vendor/haystack/apps.py +0 -31
- codex/_vendor/haystack/backends/__init__.py +0 -1109
- codex/_vendor/haystack/backends/elasticsearch2_backend.py +0 -390
- codex/_vendor/haystack/backends/elasticsearch5_backend.py +0 -483
- codex/_vendor/haystack/backends/elasticsearch7_backend.py +0 -586
- codex/_vendor/haystack/backends/elasticsearch_backend.py +0 -1141
- codex/_vendor/haystack/backends/simple_backend.py +0 -132
- codex/_vendor/haystack/backends/solr_backend.py +0 -991
- codex/_vendor/haystack/backends/whoosh_backend.py +0 -1104
- codex/_vendor/haystack/constants.py +0 -57
- codex/_vendor/haystack/exceptions.py +0 -57
- codex/_vendor/haystack/fields.py +0 -562
- codex/_vendor/haystack/forms.py +0 -135
- codex/_vendor/haystack/generic_views.py +0 -141
- codex/_vendor/haystack/indexes.py +0 -548
- codex/_vendor/haystack/inputs.py +0 -169
- codex/_vendor/haystack/management/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/build_solr_schema.py +0 -187
- codex/_vendor/haystack/management/commands/clear_index.py +0 -67
- codex/_vendor/haystack/management/commands/haystack_info.py +0 -22
- codex/_vendor/haystack/management/commands/rebuild_index.py +0 -65
- codex/_vendor/haystack/management/commands/update_index.py +0 -438
- codex/_vendor/haystack/manager.py +0 -105
- codex/_vendor/haystack/models.py +0 -257
- codex/_vendor/haystack/panels.py +0 -89
- codex/_vendor/haystack/query.py +0 -771
- codex/_vendor/haystack/routers.py +0 -14
- codex/_vendor/haystack/signals.py +0 -88
- codex/_vendor/haystack/templates/panels/haystack.html +0 -33
- codex/_vendor/haystack/templates/search_configuration/schema.xml +0 -1056
- codex/_vendor/haystack/templates/search_configuration/solrconfig.xml +0 -1446
- codex/_vendor/haystack/templatetags/__init__.py +0 -0
- codex/_vendor/haystack/templatetags/highlight.py +0 -131
- codex/_vendor/haystack/templatetags/more_like_this.py +0 -119
- codex/_vendor/haystack/urls.py +0 -5
- codex/_vendor/haystack/utils/__init__.py +0 -84
- codex/_vendor/haystack/utils/app_loading.py +0 -34
- codex/_vendor/haystack/utils/geo.py +0 -71
- codex/_vendor/haystack/utils/highlighting.py +0 -165
- codex/_vendor/haystack/utils/loading.py +0 -374
- codex/_vendor/haystack/utils/log.py +0 -21
- codex/_vendor/haystack/version.py +0 -16
- codex/_vendor/haystack/views.py +0 -253
- codex/integrity.py +0 -492
- codex/librarian/search/merge.py +0 -86
- codex/librarian/search/version.py +0 -63
- codex/search/__init__.py +0 -1
- codex/search/backend.py +0 -524
- codex/search/backend_search.py +0 -229
- codex/search/engine.py +0 -33
- codex/search/indexes.py +0 -79
- codex/search/query.py +0 -67
- codex/search/writing.py +0 -180
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.gz +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.css.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.gz +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json +0 -1
- codex/static_root/js/choices-admin.1a20a5648f20.json.br +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json.gz +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json +0 -635
- codex/static_root/manifest.0fe31a6cb99f.json.br +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json.gz +0 -0
- codex/templates/search/indexes/codex/comic_text.txt +0 -47
- codex/views/browser/filters/search.py +0 -196
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/LICENSE +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/WHEEL +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/entry_points.txt +0 -0
codex/librarian/search/update.py
CHANGED
|
@@ -1,321 +1,258 @@
|
|
|
1
1
|
"""Search Index update."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from math import ceil
|
|
5
|
-
from multiprocessing import Pool, cpu_count
|
|
6
4
|
from time import time
|
|
7
|
-
from typing import TYPE_CHECKING
|
|
8
5
|
from zoneinfo import ZoneInfo
|
|
9
6
|
|
|
10
|
-
from django.
|
|
11
|
-
from django.db import
|
|
7
|
+
from django.db.models.aggregates import Max
|
|
8
|
+
from django.db.models.expressions import F
|
|
9
|
+
from django.db.models.functions.datetime import Now
|
|
12
10
|
from humanize import naturaldelta
|
|
13
11
|
|
|
14
|
-
from codex._vendor.haystack.exceptions import SearchFieldError
|
|
15
12
|
from codex.librarian.search.remove import RemoveMixin
|
|
16
13
|
from codex.librarian.search.status import SearchIndexStatusTypes
|
|
17
|
-
from codex.librarian.search.tasks import SearchIndexRemoveStaleTask
|
|
18
|
-
from codex.memory import get_mem_limit
|
|
19
14
|
from codex.models import Comic, Library
|
|
20
|
-
from codex.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
MMAP_RATIO,
|
|
25
|
-
WRITER_MEMORY_PERCENT,
|
|
26
|
-
)
|
|
15
|
+
from codex.models.comic import ComicFTS
|
|
16
|
+
from codex.models.functions import GroupConcat
|
|
17
|
+
from codex.serializers.fields import CountryField, LanguageField, PyCountryField
|
|
18
|
+
from codex.settings.settings import SEARCH_INDEX_BATCH_SIZE
|
|
27
19
|
from codex.status import Status
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
_COMICFTS_UPDATE_FIELDS = (
|
|
22
|
+
# ForeignKeys
|
|
23
|
+
"publisher",
|
|
24
|
+
"imprint",
|
|
25
|
+
"series",
|
|
26
|
+
"volume",
|
|
27
|
+
# Attributes
|
|
28
|
+
"age_rating",
|
|
29
|
+
"file_type",
|
|
30
|
+
"country",
|
|
31
|
+
"issue",
|
|
32
|
+
"language",
|
|
33
|
+
"name",
|
|
34
|
+
"notes",
|
|
35
|
+
"original_format",
|
|
36
|
+
"reading_direction",
|
|
37
|
+
"review",
|
|
38
|
+
"scan_info",
|
|
39
|
+
"summary",
|
|
40
|
+
"tagger",
|
|
41
|
+
# ManyToMany
|
|
42
|
+
"characters",
|
|
43
|
+
"contributors",
|
|
44
|
+
"genres",
|
|
45
|
+
"locations",
|
|
46
|
+
"series_groups",
|
|
47
|
+
"stories",
|
|
48
|
+
"story_arcs",
|
|
49
|
+
"tags",
|
|
50
|
+
"teams",
|
|
51
|
+
# Base
|
|
52
|
+
"updated_at",
|
|
53
|
+
)
|
|
54
|
+
_MIN_UTC_DATE = datetime.min.replace(tzinfo=ZoneInfo("UTC"))
|
|
31
55
|
|
|
32
56
|
|
|
33
|
-
class
|
|
57
|
+
class FTSUpdateMixin(RemoveMixin):
|
|
34
58
|
"""Search Index update methods."""
|
|
35
59
|
|
|
36
60
|
_STATUS_FINISH_TYPES = (
|
|
37
61
|
SearchIndexStatusTypes.SEARCH_INDEX_CLEAR,
|
|
62
|
+
SearchIndexStatusTypes.SEARCH_INDEX_CREATE,
|
|
38
63
|
SearchIndexStatusTypes.SEARCH_INDEX_UPDATE,
|
|
39
64
|
)
|
|
40
|
-
_MIN_UTC_DATE = datetime.min.replace(tzinfo=ZoneInfo("UTC"))
|
|
41
|
-
_MIN_BATCH_SIZE = 1
|
|
42
|
-
# A larger batch size might be slightly faster for very large
|
|
43
|
-
# indexes and require less optimization later, but steady progress
|
|
44
|
-
# updates are better UX.
|
|
45
|
-
_MAX_BATCH_SIZE = 640
|
|
46
|
-
_EXPECTED_EXCEPTIONS = (
|
|
47
|
-
DatabaseError,
|
|
48
|
-
IndexError,
|
|
49
|
-
ObjectDoesNotExist,
|
|
50
|
-
SearchFieldError,
|
|
51
|
-
)
|
|
52
|
-
_MAX_RETRIES = 8
|
|
53
|
-
_CPU_MULTIPLIER = CPU_MULTIPLIER
|
|
54
|
-
_UPDATE_SORT_BY = ("-updated_at",)
|
|
55
65
|
|
|
56
66
|
def _init_statuses(self, rebuild):
|
|
57
67
|
"""Initialize all statuses order before starting."""
|
|
58
68
|
statii = []
|
|
59
69
|
if rebuild:
|
|
60
70
|
statii += [Status(SearchIndexStatusTypes.SEARCH_INDEX_CLEAR)]
|
|
61
|
-
|
|
62
|
-
if not rebuild:
|
|
71
|
+
else:
|
|
63
72
|
statii += [Status(SearchIndexStatusTypes.SEARCH_INDEX_REMOVE)]
|
|
73
|
+
statii += [
|
|
74
|
+
Status(SearchIndexStatusTypes.SEARCH_INDEX_UPDATE),
|
|
75
|
+
Status(SearchIndexStatusTypes.SEARCH_INDEX_CREATE),
|
|
76
|
+
]
|
|
64
77
|
self.status_controller.start_many(statii)
|
|
65
78
|
|
|
66
|
-
def
|
|
67
|
-
"""
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return qs
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# max procs
|
|
98
|
-
# throttle multiprocessing in lomem environments.
|
|
99
|
-
# each process running has significant memory overhead.
|
|
100
|
-
cpu_max = ceil(mem_limit_gb * self._CPU_MULTIPLIER)
|
|
101
|
-
max_procs = min(cpu_count(), cpu_max)
|
|
102
|
-
|
|
103
|
-
batch_size = int(
|
|
104
|
-
max(
|
|
105
|
-
self._MIN_BATCH_SIZE,
|
|
106
|
-
min(num_comics / max_procs, self._MAX_BATCH_SIZE),
|
|
107
|
-
)
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
num_procs = int(min(max(1, num_comics / batch_size), max_procs))
|
|
111
|
-
|
|
112
|
-
opts = {
|
|
113
|
-
"comics": num_comics,
|
|
114
|
-
"memgb": mem_limit_gb,
|
|
115
|
-
"procs": num_procs,
|
|
116
|
-
"batch_size": batch_size,
|
|
117
|
-
}
|
|
118
|
-
self.log.debug(
|
|
119
|
-
f"{MMAP_RATIO=}, {WRITER_MEMORY_PERCENT=}, {CPU_MULTIPLIER=},"
|
|
120
|
-
f" {CHUNK_PER_GB=}, {MAX_CHUNK_SIZE=}"
|
|
121
|
-
)
|
|
122
|
-
self.log.debug(f"Search Index update opts: {opts}")
|
|
123
|
-
return num_procs, batch_size
|
|
124
|
-
|
|
125
|
-
def _halve_batches(self, batches):
|
|
126
|
-
"""Half the size of retried batches.
|
|
127
|
-
|
|
128
|
-
Helps if it was a memory issue.
|
|
129
|
-
If it's a data issue then it binary searches down to the real problem.
|
|
130
|
-
"""
|
|
131
|
-
old_num_batches = len(batches)
|
|
132
|
-
half_batches = {}
|
|
133
|
-
for batch_num, batch_pks in batches.items():
|
|
134
|
-
if not batch_pks:
|
|
135
|
-
continue
|
|
136
|
-
batch_num_a = batch_num * 2
|
|
137
|
-
if len(batch_pks) == 1:
|
|
138
|
-
half_batches[batch_num_a] = batch_pks
|
|
139
|
-
continue
|
|
140
|
-
halfway = int(len(batch_pks) / 2)
|
|
141
|
-
half_batches[batch_num_a] = batch_pks[:halfway]
|
|
142
|
-
batch_num_b = batch_num_a + 1
|
|
143
|
-
half_batches[batch_num_b] = batch_pks[halfway:]
|
|
144
|
-
batches = half_batches
|
|
145
|
-
self.log.debug(f"Split {old_num_batches} batches into {len(batches)}.")
|
|
146
|
-
return batches
|
|
147
|
-
|
|
148
|
-
def _apply_batches(self, pool, batches, backend):
|
|
149
|
-
"""Apply the batches to the process pool."""
|
|
150
|
-
results = {}
|
|
151
|
-
for batch_num, batch_pks in batches.items():
|
|
152
|
-
args = (None, batch_pks)
|
|
153
|
-
kwd = {"batch_num": batch_num, "abort_event": self.abort_event}
|
|
154
|
-
result = pool.apply_async(backend.update, args, kwd)
|
|
155
|
-
results[batch_num] = (result, batch_pks)
|
|
156
|
-
pool.close()
|
|
157
|
-
self.log.debug(f"Search index update queued {len(results)} batches...")
|
|
158
|
-
return results
|
|
159
|
-
|
|
160
|
-
def _collect_results(self, results, complete, status):
|
|
161
|
-
"""Collect results from the process pool."""
|
|
162
|
-
retry_batches = {}
|
|
163
|
-
retry_batch_num = 0
|
|
164
|
-
if self.abort_event.is_set():
|
|
165
|
-
return retry_batches, retry_batch_num
|
|
166
|
-
|
|
167
|
-
num_results = len(results)
|
|
168
|
-
for batch_num, (result, batch_pks) in results.items():
|
|
169
|
-
try:
|
|
170
|
-
complete += result.get()
|
|
171
|
-
self.log.debug(
|
|
172
|
-
f"Search index batch {batch_num}/{num_results} complete: "
|
|
173
|
-
f"{status.complete}/{status.total} comics"
|
|
174
|
-
)
|
|
175
|
-
status.complete = complete
|
|
176
|
-
self.status_controller.update(status)
|
|
177
|
-
except self._EXPECTED_EXCEPTIONS:
|
|
178
|
-
pass
|
|
179
|
-
except Exception:
|
|
180
|
-
reason = f"Search Index Update collect result batch {batch_num}"
|
|
181
|
-
self.log.exception(reason)
|
|
182
|
-
else:
|
|
183
|
-
# success
|
|
184
|
-
continue
|
|
185
|
-
|
|
186
|
-
# failure
|
|
187
|
-
self.log.debug(f"Search index update will retry batch {batch_num}")
|
|
188
|
-
retry_batches[retry_batch_num] = batch_pks
|
|
189
|
-
retry_batch_num += 1
|
|
190
|
-
|
|
191
|
-
return retry_batches, complete
|
|
192
|
-
|
|
193
|
-
def _try_update_batch(self, backend, batch_info, status):
|
|
194
|
-
"""Attempt to update batches, with reursive retry."""
|
|
195
|
-
(
|
|
196
|
-
batches,
|
|
197
|
-
num_procs,
|
|
198
|
-
num_comics,
|
|
199
|
-
batch_size,
|
|
200
|
-
complete,
|
|
201
|
-
attempt,
|
|
202
|
-
) = batch_info
|
|
203
|
-
if self.abort_event.is_set():
|
|
204
|
-
return complete
|
|
205
|
-
|
|
206
|
-
if attempt > 1:
|
|
207
|
-
batches = self._halve_batches(batches)
|
|
208
|
-
|
|
209
|
-
num_batches = len(batches)
|
|
210
|
-
if not num_batches:
|
|
211
|
-
self.log.debug("Search index nothing to update.")
|
|
212
|
-
return complete
|
|
213
|
-
self.log.debug(
|
|
214
|
-
f"Search index updating {num_batches} batches, attempt {attempt}"
|
|
79
|
+
def _update_search_index_clean(self, rebuild):
|
|
80
|
+
"""Clear or clean the search index."""
|
|
81
|
+
if rebuild:
|
|
82
|
+
self.log.info("Rebuilding search index...")
|
|
83
|
+
self.clear_search_index()
|
|
84
|
+
else:
|
|
85
|
+
self.remove_stale_records()
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def _annotate_fts_query(cls, qs):
|
|
89
|
+
return qs.annotate(
|
|
90
|
+
fts_publisher=F("publisher__name"),
|
|
91
|
+
fts_imprint=F("imprint__name"),
|
|
92
|
+
fts_series=F("series__name"),
|
|
93
|
+
fts_volume=F("volume__name"),
|
|
94
|
+
fts_country=F("country__name"),
|
|
95
|
+
fts_language=F("language__name"),
|
|
96
|
+
fts_scan_info=F("scan_info__name"),
|
|
97
|
+
fts_tagger=F("tagger__name"),
|
|
98
|
+
fts_characters=GroupConcat("characters__name", distinct=True),
|
|
99
|
+
fts_contributors=GroupConcat("contributors__person__name", distinct=True),
|
|
100
|
+
fts_genres=GroupConcat("genres__name", distinct=True),
|
|
101
|
+
fts_locations=GroupConcat("locations__name", distinct=True),
|
|
102
|
+
fts_series_groups=GroupConcat("series_groups__name", distinct=True),
|
|
103
|
+
fts_stories=GroupConcat("stories__name", distinct=True),
|
|
104
|
+
fts_story_arcs=GroupConcat(
|
|
105
|
+
"story_arc_numbers__story_arc__name", distinct=True
|
|
106
|
+
),
|
|
107
|
+
fts_tags=GroupConcat("tags__name", distinct=True),
|
|
108
|
+
fts_teams=GroupConcat("teams__name", distinct=True),
|
|
215
109
|
)
|
|
216
|
-
procs = min(num_procs, num_batches)
|
|
217
|
-
pool = Pool(procs, maxtasksperchild=1)
|
|
218
|
-
results = self._apply_batches(pool, batches, backend)
|
|
219
|
-
retry_batches, complete = self._collect_results(results, complete, status)
|
|
220
|
-
pool.join()
|
|
221
110
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
111
|
+
@staticmethod
|
|
112
|
+
def _get_pycountry_fts_field(field_instance: PyCountryField, iso_code):
|
|
113
|
+
if not iso_code:
|
|
114
|
+
return ""
|
|
115
|
+
return ",".join((iso_code, field_instance.to_representation(iso_code)))
|
|
116
|
+
|
|
117
|
+
def _get_comicts_fts_list(
|
|
118
|
+
self, comics, country_field, language_field, obj_list, create
|
|
119
|
+
):
|
|
120
|
+
"""Prepare a batch of search entries."""
|
|
121
|
+
for comic in comics:
|
|
122
|
+
country = self._get_pycountry_fts_field(country_field, comic.fts_country)
|
|
123
|
+
language = self._get_pycountry_fts_field(language_field, comic.fts_language)
|
|
124
|
+
|
|
125
|
+
now = Now()
|
|
126
|
+
comicfts = ComicFTS(
|
|
127
|
+
comic_id=comic.pk,
|
|
128
|
+
updated_at=now,
|
|
129
|
+
publisher=comic.fts_publisher,
|
|
130
|
+
imprint=comic.fts_imprint,
|
|
131
|
+
series=comic.fts_series,
|
|
132
|
+
volume=comic.fts_volume,
|
|
133
|
+
issue=comic.issue,
|
|
134
|
+
name=comic.name,
|
|
135
|
+
age_rating=comic.age_rating,
|
|
136
|
+
country=country,
|
|
137
|
+
file_type=comic.file_type,
|
|
138
|
+
language=language,
|
|
139
|
+
notes=comic.notes,
|
|
140
|
+
original_format=comic.original_format,
|
|
141
|
+
reading_direction=comic.reading_direction,
|
|
142
|
+
review=comic.review,
|
|
143
|
+
scan_info=comic.fts_scan_info,
|
|
144
|
+
summary=comic.summary,
|
|
145
|
+
tagger=comic.fts_tagger,
|
|
146
|
+
# ManyToMany
|
|
147
|
+
characters=comic.fts_characters,
|
|
148
|
+
contributors=comic.fts_contributors,
|
|
149
|
+
genres=comic.fts_genres,
|
|
150
|
+
locations=comic.fts_locations,
|
|
151
|
+
series_groups=comic.fts_series_groups,
|
|
152
|
+
stories=comic.fts_stories,
|
|
153
|
+
story_arcs=comic.fts_story_arcs,
|
|
154
|
+
tags=comic.fts_tags,
|
|
155
|
+
teams=comic.fts_teams,
|
|
156
|
+
)
|
|
157
|
+
if create:
|
|
158
|
+
comicfts.created_at = now
|
|
159
|
+
obj_list.append(comicfts)
|
|
160
|
+
|
|
161
|
+
def _get_comicfts_list(self, comics, create=False):
|
|
162
|
+
"""Create a ComicFTS object for bulk_create or bulk_update."""
|
|
163
|
+
country_field = CountryField()
|
|
164
|
+
language_field = LanguageField()
|
|
165
|
+
obj_list = []
|
|
166
|
+
comics = self._annotate_fts_query(comics)
|
|
167
|
+
self._get_comicts_fts_list(
|
|
168
|
+
comics, country_field, language_field, obj_list, create
|
|
227
169
|
)
|
|
228
|
-
|
|
229
|
-
return complete
|
|
170
|
+
return obj_list
|
|
230
171
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
num_comics,
|
|
236
|
-
batch_size,
|
|
237
|
-
complete,
|
|
238
|
-
attempt + 1,
|
|
239
|
-
)
|
|
240
|
-
complete = self._try_update_batch(backend, batch_info, status)
|
|
172
|
+
def _update_search_index_finish(self, count, verb, status):
|
|
173
|
+
verb = verb.capitalize() + "d"
|
|
174
|
+
if count:
|
|
175
|
+
self.log.info(f"{verb} {count} search entries.")
|
|
241
176
|
else:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
f"Search Indexer failed to update {total} comics"
|
|
245
|
-
f"in {len(retry_batches)} batches."
|
|
246
|
-
)
|
|
247
|
-
return complete
|
|
177
|
+
self.log.debug(f"{verb} no search entries.")
|
|
178
|
+
self.status_controller.finish(status)
|
|
248
179
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
end = start + int(batch_size * (batch_num / procs))
|
|
255
|
-
else:
|
|
256
|
-
end = start + batch_size
|
|
257
|
-
return end
|
|
180
|
+
def _update_search_index_operate(self, comics_qs, create=False):
|
|
181
|
+
count = comics_qs.count()
|
|
182
|
+
verb = "create" if create else "update"
|
|
183
|
+
if not count:
|
|
184
|
+
self.log.info(f"No search entries to {verb}.")
|
|
258
185
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
186
|
+
if count > SEARCH_INDEX_BATCH_SIZE:
|
|
187
|
+
self.log.debug(
|
|
188
|
+
f"Batching this search engine {verb} operation in to chunks of {SEARCH_INDEX_BATCH_SIZE}."
|
|
189
|
+
f" Search engine {verb}s run much faster as one large batch but then there's no progress updates."
|
|
190
|
+
" You may adjust the batch size with the environment variable CODEX_SEARCH_INDEX_BATCH_SIZE."
|
|
191
|
+
)
|
|
265
192
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
193
|
+
status_type = (
|
|
194
|
+
SearchIndexStatusTypes.SEARCH_INDEX_CREATE
|
|
195
|
+
if create
|
|
196
|
+
else SearchIndexStatusTypes.SEARCH_INDEX_UPDATE
|
|
197
|
+
)
|
|
198
|
+
complete = None if count <= SEARCH_INDEX_BATCH_SIZE else 0
|
|
199
|
+
operate_status = Status(status_type, complete, count)
|
|
200
|
+
self.status_controller.start(operate_status)
|
|
273
201
|
|
|
274
|
-
|
|
275
|
-
# Init
|
|
276
|
-
start_time = time()
|
|
277
|
-
num_comics = qs.count()
|
|
278
|
-
if not num_comics or self.abort_event.is_set():
|
|
279
|
-
return
|
|
280
|
-
status = Status(SearchIndexStatusTypes.SEARCH_INDEX_UPDATE, 0, num_comics)
|
|
202
|
+
batch_from = 0
|
|
281
203
|
try:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
204
|
+
while batch_from < count:
|
|
205
|
+
batch_start = time()
|
|
206
|
+
batch_to = batch_from + SEARCH_INDEX_BATCH_SIZE
|
|
207
|
+
comics_batch = comics_qs[batch_from:batch_to]
|
|
208
|
+
|
|
209
|
+
if self.abort_event.is_set():
|
|
210
|
+
break
|
|
211
|
+
operate_comicfts = self._get_comicfts_list(comics_batch, create)
|
|
212
|
+
operate_comicfts_count = len(operate_comicfts)
|
|
213
|
+
if self.abort_event.is_set():
|
|
214
|
+
break
|
|
215
|
+
if create:
|
|
216
|
+
ComicFTS.objects.bulk_create(operate_comicfts)
|
|
217
|
+
else:
|
|
218
|
+
ComicFTS.objects.bulk_update(
|
|
219
|
+
operate_comicfts, _COMICFTS_UPDATE_FIELDS
|
|
220
|
+
)
|
|
221
|
+
operate_status.add_complete(operate_comicfts_count)
|
|
222
|
+
self.status_controller.update(operate_status)
|
|
223
|
+
batch_time = time() - batch_start
|
|
224
|
+
eps = round(count / batch_time)
|
|
225
|
+
self.log.debug(
|
|
226
|
+
f"{verb} {count}/{operate_comicfts_count} search entries in {batch_time}, {eps} per second."
|
|
227
|
+
)
|
|
228
|
+
batch_from = batch_to
|
|
303
229
|
finally:
|
|
304
|
-
|
|
305
|
-
|
|
230
|
+
self._update_search_index_finish(count, verb, operate_status)
|
|
231
|
+
|
|
232
|
+
def _update_search_index_update(self, all_indexed_comic_ids):
|
|
233
|
+
"""Update out of date search entries."""
|
|
234
|
+
fts_watermark = ComicFTS.objects.aggregate(max=Max("updated_at"))["max"]
|
|
235
|
+
if not fts_watermark:
|
|
236
|
+
fts_watermark = _MIN_UTC_DATE
|
|
237
|
+
since = "the fracturing of the multiverse"
|
|
238
|
+
else:
|
|
239
|
+
since = fts_watermark
|
|
240
|
+
self.log.info(f"Looking for search entries to update since {since}...")
|
|
241
|
+
out_of_date_comics = Comic.objects.filter(
|
|
242
|
+
pk__in=all_indexed_comic_ids, updated_at__gt=fts_watermark
|
|
243
|
+
)
|
|
244
|
+
self._update_search_index_operate(out_of_date_comics, create=False)
|
|
306
245
|
|
|
307
|
-
def
|
|
308
|
-
"""
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
self.
|
|
314
|
-
self.log.info("Old search index cleared.")
|
|
246
|
+
def _update_search_index_create(self, all_indexed_comic_ids):
|
|
247
|
+
"""Create missing search entries."""
|
|
248
|
+
self.log.info("Looking for missing search entries to create...")
|
|
249
|
+
missing_comics = Comic.objects.all()
|
|
250
|
+
if len(all_indexed_comic_ids):
|
|
251
|
+
missing_comics = missing_comics.exclude(pk__in=all_indexed_comic_ids)
|
|
252
|
+
self._update_search_index_operate(missing_comics, create=True)
|
|
315
253
|
|
|
316
254
|
def _update_search_index(self, start_time, rebuild):
|
|
317
255
|
"""Update or Rebuild the search index."""
|
|
318
|
-
remove_stale = False
|
|
319
256
|
any_update_in_progress = Library.objects.filter(
|
|
320
257
|
covers_only=False, update_in_progress=True
|
|
321
258
|
).exists()
|
|
@@ -323,49 +260,34 @@ class UpdateMixin(RemoveMixin):
|
|
|
323
260
|
self.log.debug(
|
|
324
261
|
"Database update in progress, not updating search index yet."
|
|
325
262
|
)
|
|
326
|
-
return
|
|
327
|
-
|
|
328
|
-
if not rebuild and not self.is_search_index_uuid_match():
|
|
329
|
-
rebuild = True
|
|
263
|
+
return
|
|
330
264
|
|
|
331
265
|
self._init_statuses(rebuild)
|
|
332
266
|
|
|
333
|
-
# Clear
|
|
334
|
-
if rebuild:
|
|
335
|
-
self.log.info("Rebuilding search index...")
|
|
336
|
-
self.clear_search_index()
|
|
337
|
-
|
|
338
|
-
# Update
|
|
339
|
-
backend: CodexSearchBackend = self.engine.get_backend() # type: ignore
|
|
340
|
-
backend.setup(False)
|
|
341
267
|
if self.abort_event.is_set():
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
268
|
+
return
|
|
269
|
+
self._update_search_index_clean(rebuild)
|
|
270
|
+
if self.abort_event.is_set():
|
|
271
|
+
return
|
|
272
|
+
all_indexed_comic_ids = ComicFTS.objects.values_list("comic_id", flat=True)
|
|
273
|
+
if self.abort_event.is_set():
|
|
274
|
+
return
|
|
275
|
+
self._update_search_index_update(all_indexed_comic_ids)
|
|
276
|
+
if self.abort_event.is_set():
|
|
277
|
+
return
|
|
278
|
+
self._update_search_index_create(all_indexed_comic_ids)
|
|
352
279
|
|
|
353
280
|
elapsed_time = time() - start_time
|
|
354
281
|
elapsed = naturaldelta(elapsed_time)
|
|
355
282
|
self.log.info(f"Search index updated in {elapsed}.")
|
|
356
|
-
return remove_stale
|
|
357
283
|
|
|
358
284
|
def update_search_index(self, rebuild=False):
|
|
359
285
|
"""Update or Rebuild the search index."""
|
|
360
286
|
start_time = time()
|
|
361
287
|
self.abort_event.clear()
|
|
362
|
-
remove_stale = False
|
|
363
288
|
try:
|
|
364
|
-
|
|
289
|
+
self._update_search_index(start_time, rebuild)
|
|
365
290
|
except Exception:
|
|
366
291
|
self.log.exception("Update search index")
|
|
367
292
|
finally:
|
|
368
293
|
self.status_controller.finish_many(self._STATUS_FINISH_TYPES)
|
|
369
|
-
if remove_stale:
|
|
370
|
-
task = SearchIndexRemoveStaleTask()
|
|
371
|
-
self.librarian_queue.put(task)
|
|
@@ -165,8 +165,9 @@ class LibraryPollingObserver(UatuMixin):
|
|
|
165
165
|
paths = frozenset(qs.values_list("path", flat=True))
|
|
166
166
|
|
|
167
167
|
for emitter in self.emitters:
|
|
168
|
+
polling_emitter: DatabasePollingEmitter = emitter # type: ignore
|
|
168
169
|
if emitter.watch.path in paths:
|
|
169
|
-
|
|
170
|
+
polling_emitter.poll(force)
|
|
170
171
|
except Exception:
|
|
171
172
|
self.log.exception(
|
|
172
173
|
f"{self.__class__.__name__}.poll({library_pks}, {force})"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Generated by Django 5.0.8 on 2024-08-07 22:07."""
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
"""Run migrations."""
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
("codex", "0028_telemeter"),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.SeparateDatabaseAndState(
|
|
16
|
+
state_operations=[
|
|
17
|
+
migrations.CreateModel(
|
|
18
|
+
name="ComicFTS",
|
|
19
|
+
fields=[
|
|
20
|
+
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
21
|
+
("updated_at", models.DateTimeField(auto_now=True)),
|
|
22
|
+
(
|
|
23
|
+
"comic",
|
|
24
|
+
models.OneToOneField(
|
|
25
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
26
|
+
primary_key=True,
|
|
27
|
+
serialize=False,
|
|
28
|
+
to="codex.comic",
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
("body", models.TextField()),
|
|
32
|
+
],
|
|
33
|
+
options={
|
|
34
|
+
"get_latest_by": "updated_at",
|
|
35
|
+
"managed": False,
|
|
36
|
+
},
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
database_operations=[
|
|
40
|
+
migrations.RunSQL(
|
|
41
|
+
sql=(
|
|
42
|
+
"CREATE VIRTUAL TABLE codex_comicfts USING fts5("
|
|
43
|
+
"comic_id UNINDEXED, created_at UNINDEXED, "
|
|
44
|
+
"updated_at UNINDEXED, "
|
|
45
|
+
"publisher, imprint, series, volume, issue, name, age_rating, "
|
|
46
|
+
"country, language, "
|
|
47
|
+
"notes, original_format, review, scan_info, summary, "
|
|
48
|
+
"tagger, "
|
|
49
|
+
"characters, contributors, genres,"
|
|
50
|
+
"locations, roles, series_groups, stories, "
|
|
51
|
+
"story_arcs, tags, teams, "
|
|
52
|
+
"reading_direction, file_type)"
|
|
53
|
+
),
|
|
54
|
+
reverse_sql="DROP TABLE IF EXISTS codex_comicfts",
|
|
55
|
+
),
|
|
56
|
+
],
|
|
57
|
+
)
|
|
58
|
+
]
|