codex 1.5.19__py3-none-any.whl → 1.6.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/exceptions.py +14 -5
- codex/librarian/covers/create.py +2 -1
- codex/librarian/covers/path.py +1 -2
- codex/librarian/importer/const.py +34 -13
- codex/librarian/importer/create_comics.py +0 -1
- codex/librarian/importer/create_fks.py +35 -21
- codex/librarian/importer/failed_imports.py +2 -2
- codex/librarian/importer/moved.py +12 -10
- codex/librarian/importer/query_fks.py +124 -78
- codex/librarian/importer/update_comics.py +0 -1
- codex/librarian/janitor/cleanup.py +35 -14
- codex/migrations/0027_sort_name.py +149 -0
- codex/models/admin.py +1 -0
- codex/models/base.py +3 -0
- codex/models/comic.py +32 -35
- codex/models/const.py +18 -0
- codex/models/functions.py +12 -0
- codex/models/groups.py +40 -8
- codex/models/paths.py +5 -4
- codex/models/query.py +91 -0
- codex/search/backend.py +2 -2
- codex/search/backend_search.py +232 -0
- codex/search/engine.py +1 -9
- codex/search/query.py +44 -0
- codex/serializers/admin.py +3 -1
- codex/serializers/browser/filters.py +3 -8
- codex/serializers/{metadata.py → browser/metadata.py} +1 -1
- codex/serializers/browser/mixins.py +32 -0
- codex/serializers/browser/page.py +6 -18
- codex/serializers/browser/settings.py +1 -0
- codex/serializers/choices.py +22 -12
- codex/serializers/mixins.py +0 -22
- codex/serializers/opds/urls.py +10 -0
- codex/serializers/reader.py +7 -13
- codex/serializers/route.py +36 -0
- codex/settings/settings.py +57 -25
- codex/signals/django_signals.py +6 -0
- codex/static_root/assets/{VCheckbox-D7WF5wMC.c98c1beb207e.js → VCheckbox-Aq_ImMNC.da711f8b6a15.js} +1 -1
- codex/static_root/assets/VCheckbox-Aq_ImMNC.da711f8b6a15.js.br +0 -0
- codex/static_root/assets/VCheckbox-Aq_ImMNC.da711f8b6a15.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-D7WF5wMC.js → VCheckbox-Aq_ImMNC.js} +1 -1
- codex/static_root/assets/VCheckbox-Aq_ImMNC.js.br +0 -0
- codex/static_root/assets/VCheckbox-Aq_ImMNC.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js → VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CzTNt4cV.js → VCheckboxBtn-D3izCBa7.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.js.gz +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js +1 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js.br +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js.gz +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js +1 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js.br +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js.gz +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css +1 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css.br +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css.gz +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css +1 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css.br +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css.gz +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js +1 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js.br +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js.gz +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js +1 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js.br +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-DGplihzh.3f4a5d26a1cb.js → VRadioGroup-DEezv8bL.4a609e74e507.js} +1 -1
- codex/static_root/assets/VRadioGroup-DEezv8bL.4a609e74e507.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DEezv8bL.4a609e74e507.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-DGplihzh.js → VRadioGroup-DEezv8bL.js} +1 -1
- codex/static_root/assets/VRadioGroup-DEezv8bL.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DEezv8bL.js.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.gz +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js +1 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js.br +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js.gz +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.js +1 -0
- codex/static_root/assets/VSelect-BKXcujPy.js.br +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-DvHEDoJy.30ca0aef8bd2.js → VSelectionControl-DJAPiluk.402a7ad84a8e.js} +1 -1
- codex/static_root/assets/VSelectionControl-DJAPiluk.402a7ad84a8e.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DJAPiluk.402a7ad84a8e.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-DvHEDoJy.js → VSelectionControl-DJAPiluk.js} +1 -1
- codex/static_root/assets/VSelectionControl-DJAPiluk.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DJAPiluk.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js +1 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js +1 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css +1 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css +1 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.gz +0 -0
- codex/static_root/assets/{VTable-TEvK4Tmn.c68c176d93db.js → VTable-9vsIQObs.0a135029e924.js} +1 -1
- codex/static_root/assets/VTable-9vsIQObs.0a135029e924.js.br +0 -0
- codex/static_root/assets/VTable-9vsIQObs.0a135029e924.js.gz +0 -0
- codex/static_root/assets/{VTable-TEvK4Tmn.js → VTable-9vsIQObs.js} +1 -1
- codex/static_root/assets/VTable-9vsIQObs.js.br +0 -0
- codex/static_root/assets/VTable-9vsIQObs.js.gz +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js +1 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js.br +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js.gz +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js +1 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js.br +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-CTW-HJl4.css → VTextField-DuIIp-VY.580110ad24dc.css} +1 -1
- codex/static_root/assets/VTextField-DuIIp-VY.580110ad24dc.css.br +0 -0
- codex/static_root/assets/VTextField-DuIIp-VY.580110ad24dc.css.gz +0 -0
- codex/static_root/assets/{VSlideGroup-CTW-HJl4.8b75b66602c9.css → VTextField-DuIIp-VY.css} +1 -1
- codex/static_root/assets/VTextField-DuIIp-VY.css.br +0 -0
- codex/static_root/assets/VTextField-DuIIp-VY.css.gz +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js +1 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js.br +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js.gz +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js +1 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js.br +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js.gz +0 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js +1 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js.br +0 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js.gz +0 -0
- codex/static_root/assets/admin-2BTkfSQA.js +1 -0
- codex/static_root/assets/admin-2BTkfSQA.js.br +0 -0
- codex/static_root/assets/admin-2BTkfSQA.js.gz +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css +1 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css.br +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css.gz +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.css +1 -0
- codex/static_root/assets/admin-BbrOU9Y9.css.br +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css +1 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css +1 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js +30 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js +30 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js.gz +0 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js +1 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js.br +0 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js.gz +0 -0
- codex/static_root/assets/browser-BA-AwUn-.js +1 -0
- codex/static_root/assets/browser-BA-AwUn-.js.br +0 -0
- codex/static_root/assets/browser-BA-AwUn-.js.gz +0 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css +1 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css.br +0 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css.gz +0 -0
- codex/static_root/assets/browser-CZeVqRNy.css +1 -0
- codex/static_root/assets/browser-CZeVqRNy.css.br +0 -0
- codex/static_root/assets/browser-CZeVqRNy.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js +1 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js +1 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js.br +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css +1 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css.br +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css +1 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css.br +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js +1 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js +1 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js.gz +0 -0
- codex/static_root/assets/{datetime-column-C3t430gN.97e5c5364aef.js → datetime-column-DejrPZxl.9fd36bef6fdd.js} +1 -1
- codex/static_root/assets/datetime-column-DejrPZxl.9fd36bef6fdd.js.br +0 -0
- codex/static_root/assets/datetime-column-DejrPZxl.9fd36bef6fdd.js.gz +0 -0
- codex/static_root/assets/{datetime-column-C3t430gN.js → datetime-column-DejrPZxl.js} +1 -1
- codex/static_root/assets/datetime-column-DejrPZxl.js.br +0 -0
- codex/static_root/assets/datetime-column-DejrPZxl.js.gz +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css +1 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css.br +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.css +1 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.css.br +0 -0
- codex/static_root/assets/{filter-BQ_FuhIp.ee8b78c4aa55.js → filter-DHo57nTp.4d79a276d806.js} +1 -1
- codex/static_root/assets/filter-DHo57nTp.4d79a276d806.js.br +0 -0
- codex/static_root/assets/filter-DHo57nTp.4d79a276d806.js.gz +0 -0
- codex/static_root/assets/{filter-BQ_FuhIp.js → filter-DHo57nTp.js} +1 -1
- codex/static_root/assets/filter-DHo57nTp.js.br +0 -0
- codex/static_root/assets/filter-DHo57nTp.js.gz +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css +1 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css.br +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css.gz +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css +1 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css.br +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css.gz +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js +1 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js.br +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js.gz +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js +1 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js.br +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js.gz +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js +1 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js.br +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js.gz +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.js +1 -0
- codex/static_root/assets/group-tab-BTAjhv32.js.br +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.js.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css +1 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css +1 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.gz +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js +1 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js.br +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js.gz +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.js +1 -0
- codex/static_root/assets/http-error-DaHEsKbT.js.br +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.js.gz +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css +1 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css.br +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css.gz +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.css +1 -0
- codex/static_root/assets/http-error-_wlDqEcp.css.br +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.css.gz +0 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css +1 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css.br +2 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css.gz +0 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css +1 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css.br +2 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css.gz +0 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js +1 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js.br +0 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js.gz +0 -0
- codex/static_root/assets/library-tab-Cud4639b.js +1 -0
- codex/static_root/assets/library-tab-Cud4639b.js.br +0 -0
- codex/static_root/assets/library-tab-Cud4639b.js.gz +0 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js +32 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js.br +0 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js.gz +0 -0
- codex/static_root/assets/main-BnzL_Byv.js +32 -0
- codex/static_root/assets/main-BnzL_Byv.js.br +0 -0
- codex/static_root/assets/main-BnzL_Byv.js.gz +0 -0
- codex/static_root/assets/{main-ED57DJUb.b84231dc384d.css → main-sK7HC5h4.6f04ddfc5f1a.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.6f04ddfc5f1a.css.br +0 -0
- codex/static_root/assets/{main-ED57DJUb.b84231dc384d.css.gz → main-sK7HC5h4.6f04ddfc5f1a.css.gz} +0 -0
- codex/static_root/assets/{main-ED57DJUb.css → main-sK7HC5h4.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.css.br +0 -0
- codex/static_root/assets/{main-ED57DJUb.css.gz → main-sK7HC5h4.css.gz} +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css +1 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css +1 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js +1 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js +1 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-x5fJF5N8.67b5456d222e.js → pdf-doc-CD2lnB32.1cef3bf498be.js} +1 -1
- codex/static_root/assets/pdf-doc-CD2lnB32.1cef3bf498be.js.br +0 -0
- codex/static_root/assets/pdf-doc-CD2lnB32.1cef3bf498be.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-x5fJF5N8.js → pdf-doc-CD2lnB32.js} +1 -1
- codex/static_root/assets/pdf-doc-CD2lnB32.js.br +0 -0
- codex/static_root/assets/pdf-doc-CD2lnB32.js.gz +0 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css +1 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css.br +0 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css.gz +0 -0
- codex/static_root/assets/reader-Dspy46e8.css +1 -0
- codex/static_root/assets/reader-Dspy46e8.css.br +0 -0
- codex/static_root/assets/reader-Dspy46e8.css.gz +0 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js +2 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js.br +0 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js.gz +0 -0
- codex/static_root/assets/reader-L85y7IXD.js +2 -0
- codex/static_root/assets/reader-L85y7IXD.js.br +0 -0
- codex/static_root/assets/reader-L85y7IXD.js.gz +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js +1 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js.br +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js.gz +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js +1 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js.br +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js.gz +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css +1 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css.br +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css.gz +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css +1 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css.br +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css.gz +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css +1 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css.br +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css.gz +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css +1 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css.br +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css.gz +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js +2 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js.br +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js +2 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js.br +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js.gz +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js +1 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js.br +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js.gz +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js +1 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js.br +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js.gz +0 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css +1 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css.br +2 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css.gz +0 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css +1 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css.br +2 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css +1 -0
- codex/static_root/assets/{task-tab-DoX9OA37.9bb355f36dbf.css.br → task-tab-1XiWn9xP.06cb8e1b794d.css.br} +1 -1
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.css +1 -0
- codex/static_root/assets/{task-tab-DoX9OA37.css.br → task-tab-1XiWn9xP.css.br} +1 -1
- codex/static_root/assets/task-tab-1XiWn9xP.css.gz +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js +1 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js.br +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js.gz +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js +1 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js.br +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js.gz +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js +1 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js.br +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js.gz +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js +1 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js.br +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js.gz +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css +1 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css.br +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css.gz +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.css +1 -0
- codex/static_root/assets/unauthorized-DWgytUow.css.br +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.css.gz +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js +1 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js.br +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js.gz +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js +1 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js.br +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js.gz +0 -0
- codex/static_root/img/folder.f28936a3701d.svg +1 -0
- codex/static_root/img/folder.f28936a3701d.svg.br +0 -0
- codex/static_root/img/folder.f28936a3701d.svg.gz +0 -0
- codex/static_root/img/folder.svg +1 -0
- codex/static_root/img/folder.svg.br +0 -0
- codex/static_root/img/folder.svg.gz +0 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg +1 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg.br +0 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg.gz +0 -0
- codex/static_root/img/imprint.svg +1 -0
- codex/static_root/img/imprint.svg.br +0 -0
- codex/static_root/img/imprint.svg.gz +0 -0
- codex/static_root/img/logo-32.5688944495bf.webp +0 -0
- codex/static_root/img/logo-32.webp +0 -0
- codex/static_root/img/logo-maskable-180.c58d966aa64e.webp +0 -0
- codex/static_root/img/logo-maskable-180.webp +0 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg +1 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg.br +0 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg.gz +0 -0
- codex/static_root/img/logo-maskable.svg +1 -83
- codex/static_root/img/logo-maskable.svg.br +0 -0
- codex/static_root/img/logo-maskable.svg.gz +0 -0
- codex/static_root/img/logo.0f5344a028ca.svg +1 -0
- codex/static_root/img/logo.0f5344a028ca.svg.br +0 -0
- codex/static_root/img/logo.0f5344a028ca.svg.gz +0 -0
- codex/static_root/img/logo.svg +1 -80
- codex/static_root/img/logo.svg.br +0 -0
- codex/static_root/img/logo.svg.gz +0 -0
- codex/static_root/img/missing-cover-165.0743171f2148.webp +0 -0
- codex/static_root/img/missing-cover-165.webp +0 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg +1 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg.br +0 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg.gz +0 -0
- codex/static_root/img/missing-cover.svg +1 -0
- codex/static_root/img/missing-cover.svg.br +0 -0
- codex/static_root/img/missing-cover.svg.gz +0 -0
- codex/static_root/img/publisher.82d378fcd601.svg +1 -0
- codex/static_root/img/publisher.82d378fcd601.svg.br +0 -0
- codex/static_root/img/publisher.82d378fcd601.svg.gz +0 -0
- codex/static_root/img/publisher.svg +1 -0
- codex/static_root/img/publisher.svg.br +0 -0
- codex/static_root/img/publisher.svg.gz +0 -0
- codex/static_root/img/series.ec8a889b8f95.svg +1 -0
- codex/static_root/img/series.ec8a889b8f95.svg.br +0 -0
- codex/static_root/img/series.ec8a889b8f95.svg.gz +0 -0
- codex/static_root/img/series.svg +1 -0
- codex/static_root/img/series.svg.br +0 -0
- codex/static_root/img/series.svg.gz +0 -0
- codex/static_root/img/story-arc.ca10014355ef.svg +1 -0
- codex/static_root/img/story-arc.ca10014355ef.svg.br +1 -0
- codex/static_root/img/story-arc.ca10014355ef.svg.gz +0 -0
- codex/static_root/img/story-arc.svg +1 -0
- codex/static_root/img/story-arc.svg.br +1 -0
- codex/static_root/img/story-arc.svg.gz +0 -0
- codex/static_root/img/volume.814e4c79461a.svg +1 -0
- codex/static_root/img/volume.814e4c79461a.svg.br +0 -0
- codex/static_root/img/volume.814e4c79461a.svg.gz +0 -0
- codex/static_root/img/volume.svg +1 -0
- codex/static_root/img/volume.svg.br +0 -0
- codex/static_root/img/volume.svg.gz +0 -0
- codex/static_root/js/{choices-admin.bb730e4f26ac.json → choices-admin.248384ece3f6.json} +1 -1
- codex/static_root/js/choices-admin.248384ece3f6.json.br +0 -0
- codex/static_root/js/choices-admin.248384ece3f6.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/js/choices.b60817ba0a93.json +1 -0
- codex/static_root/js/choices.b60817ba0a93.json.br +0 -0
- codex/static_root/js/choices.b60817ba0a93.json.gz +0 -0
- codex/static_root/js/choices.json +1 -1
- codex/static_root/js/choices.json.br +0 -0
- codex/static_root/js/choices.json.gz +0 -0
- codex/static_root/manifest.c5fa10a7dfdc.json +641 -0
- codex/static_root/manifest.c5fa10a7dfdc.json.br +0 -0
- codex/static_root/manifest.c5fa10a7dfdc.json.gz +0 -0
- codex/static_root/manifest.json +354 -320
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/templates/headers-script-globals.html +1 -4
- codex/urls/api/admin.py +5 -7
- codex/urls/api/browser.py +5 -5
- codex/urls/api/reader.py +3 -3
- codex/urls/api/v3.py +2 -0
- codex/urls/app.py +8 -3
- codex/urls/converters.py +39 -0
- codex/urls/opds/root.py +3 -4
- codex/urls/opds/v1.py +1 -1
- codex/urls/opds/v2.py +6 -1
- codex/urls/root.py +2 -1
- codex/views/admin/user.py +0 -5
- codex/views/auth.py +10 -12
- codex/views/bookmark.py +6 -5
- codex/views/browser/base.py +88 -26
- codex/views/browser/browser.py +245 -319
- codex/views/browser/browser_annotations.py +236 -187
- codex/views/browser/browser_breadcrumbs.py +175 -0
- codex/views/browser/browser_order_by.py +44 -89
- codex/views/browser/choices.py +39 -45
- codex/views/browser/filters/annotations.py +34 -0
- codex/views/browser/filters/group.py +8 -7
- codex/views/browser/filters/search.py +157 -24
- codex/views/browser/metadata.py +98 -104
- codex/views/const.py +17 -0
- codex/views/cover.py +22 -4
- codex/views/download.py +3 -12
- codex/views/error.py +2 -2
- codex/views/frontend.py +4 -1
- codex/views/mixins.py +76 -0
- codex/views/opds/urls.py +28 -0
- codex/views/opds/util.py +7 -7
- codex/views/opds/v1/entry/data.py +2 -2
- codex/views/opds/v1/entry/entry.py +5 -5
- codex/views/opds/v1/entry/links.py +69 -44
- codex/views/opds/v1/facets.py +4 -4
- codex/views/opds/v1/feed.py +32 -21
- codex/views/opds/v1/links.py +14 -14
- codex/views/opds/v1/opensearch_v1.py +4 -1
- codex/views/opds/v2/feed.py +52 -35
- codex/views/opds/v2/publications.py +17 -15
- codex/views/opds/v2/top_links.py +2 -2
- codex/views/reader/page.py +4 -0
- codex/views/reader/reader.py +168 -79
- codex/views/session.py +21 -12
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/METADATA +22 -11
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/RECORD +488 -429
- codex/db_functions.py +0 -25
- codex/img/missing-cover.webp +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.c98c1beb207e.js.br +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.c98c1beb207e.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.js.br +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.js.gz +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js +0 -1
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js.br +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js.gz +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.js +0 -1
- codex/static_root/assets/VCombobox-BWrSBDP9.js.br +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js +0 -1
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.js +0 -1
- codex/static_root/assets/VDataTableVirtual-BMondxto.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css +0 -1
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css.br +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css +0 -1
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css.br +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js +0 -1
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js +0 -1
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js.gz +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js +0 -1
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js.br +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js.gz +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.js +0 -1
- codex/static_root/assets/VMain-8vjSGbNt.js.br +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.js.gz +0 -0
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css +0 -1
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css.br +0 -0
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css.gz +0 -0
- codex/static_root/assets/VMain-Byt37V4c.css +0 -1
- codex/static_root/assets/VMain-Byt37V4c.css.br +0 -0
- codex/static_root/assets/VMain-Byt37V4c.css.gz +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.3f4a5d26a1cb.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.3f4a5d26a1cb.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.js.gz +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js +0 -1
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js.br +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js.gz +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.js +0 -1
- codex/static_root/assets/VSelect-DfV5vhqb.js.br +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.js.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.30ca0aef8bd2.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.30ca0aef8bd2.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js +0 -1
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js +0 -1
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.8b75b66602c9.css.br +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.8b75b66602c9.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.css.br +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.css.gz +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.c68c176d93db.js.br +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.c68c176d93db.js.gz +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.js.br +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.js.gz +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.css +0 -1
- codex/static_root/assets/VToolbar-D7BgLWdG.css.br +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.css.gz +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css +0 -1
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css.br +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css.gz +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js +0 -2
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js.br +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js.gz +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.js +0 -2
- codex/static_root/assets/VToolbar-DCXw9xBt.js.br +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js +0 -1
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js.br +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.js +0 -1
- codex/static_root/assets/VWindowItem-CCYriq5i.js.br +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.js.gz +0 -0
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js +0 -1
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js.br +0 -0
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js.gz +0 -0
- codex/static_root/assets/admin-A2T028Mn.js +0 -1
- codex/static_root/assets/admin-A2T028Mn.js.br +0 -0
- codex/static_root/assets/admin-A2T028Mn.js.gz +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css +0 -1
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css.br +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css.gz +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.css +0 -1
- codex/static_root/assets/admin-C8Kk7_Ni.css.br +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js +0 -30
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js +0 -30
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css.gz +0 -0
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js +0 -1
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js.br +0 -0
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js.gz +0 -0
- codex/static_root/assets/browser-CY9BdW6B.js +0 -1
- codex/static_root/assets/browser-CY9BdW6B.js.br +0 -0
- codex/static_root/assets/browser-CY9BdW6B.js.gz +0 -0
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css +0 -1
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.gz +0 -0
- codex/static_root/assets/browser-HtKThxA9.css +0 -1
- codex/static_root/assets/browser-HtKThxA9.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css +0 -1
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css.br +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.css +0 -1
- codex/static_root/assets/change-password-dialog-BRmvkNir.css.br +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js +0 -1
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js +0 -1
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js +0 -1
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js +0 -1
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js.gz +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css +0 -1
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css.br +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css.gz +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.css +0 -1
- codex/static_root/assets/confirm-footer-BPuy6r_H.css.br +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.css.gz +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js +0 -1
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js.br +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js.gz +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.js +0 -1
- codex/static_root/assets/confirm-footer-CIu2tkFD.js.br +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.js.gz +0 -0
- codex/static_root/assets/datetime-column-BWWfvyhn.a4a94ba57c73.css +0 -1
- codex/static_root/assets/datetime-column-BWWfvyhn.a4a94ba57c73.css.br +0 -0
- codex/static_root/assets/datetime-column-BWWfvyhn.css +0 -1
- codex/static_root/assets/datetime-column-BWWfvyhn.css.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.97e5c5364aef.js.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.97e5c5364aef.js.gz +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.js.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.js.gz +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.ee8b78c4aa55.js.br +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.ee8b78c4aa55.js.gz +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.js.br +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.js.gz +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js +0 -1
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js.br +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js.gz +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.js +0 -1
- codex/static_root/assets/flag-tab-D380D1SI.js.br +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.js.gz +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css +0 -1
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css.br +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css.gz +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.css +0 -1
- codex/static_root/assets/flag-tab-D_HjkAta.css.br +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.css.gz +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js +0 -1
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js.br +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js.gz +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.js +0 -1
- codex/static_root/assets/group-tab-CDcOyQyw.js.br +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.js.gz +0 -0
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css +0 -1
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css.br +0 -0
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css.gz +0 -0
- codex/static_root/assets/group-tab-GFacGljN.css +0 -1
- codex/static_root/assets/group-tab-GFacGljN.css.br +0 -0
- codex/static_root/assets/group-tab-GFacGljN.css.gz +0 -0
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css +0 -1
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css.br +0 -0
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css.gz +0 -0
- codex/static_root/assets/http-error-C25WdjWC.css +0 -1
- codex/static_root/assets/http-error-C25WdjWC.css.br +0 -0
- codex/static_root/assets/http-error-C25WdjWC.css.gz +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js +0 -1
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js.br +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js.gz +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.js +0 -1
- codex/static_root/assets/http-error-D4BCbtF2.js.br +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.js.gz +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js +0 -1
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js.br +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js.gz +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.js +0 -1
- codex/static_root/assets/library-tab-BpWTK9vs.js.br +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.js.gz +0 -0
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css +0 -1
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css.br +0 -3
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css.gz +0 -0
- codex/static_root/assets/library-tab-DZKDtQ5v.css +0 -1
- codex/static_root/assets/library-tab-DZKDtQ5v.css.br +0 -3
- codex/static_root/assets/library-tab-DZKDtQ5v.css.gz +0 -0
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js +0 -32
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js.br +0 -0
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js.gz +0 -0
- codex/static_root/assets/main-DB0zDxIA.js +0 -32
- codex/static_root/assets/main-DB0zDxIA.js.br +0 -0
- codex/static_root/assets/main-DB0zDxIA.js.gz +0 -0
- codex/static_root/assets/main-ED57DJUb.b84231dc384d.css.br +0 -0
- codex/static_root/assets/main-ED57DJUb.css.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js +0 -1
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js +0 -1
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css +0 -1
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css.br +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css.gz +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css +0 -1
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css.br +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css.gz +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.67b5456d222e.js.br +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.67b5456d222e.js.gz +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.js.br +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.js.gz +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css +0 -1
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css.br +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css.gz +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.css +0 -1
- codex/static_root/assets/reader-BDo-P8Ww.css.br +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.css.gz +0 -0
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js +0 -2
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js.br +0 -0
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js.gz +0 -0
- codex/static_root/assets/reader-CXmsYhy4.js +0 -2
- codex/static_root/assets/reader-CXmsYhy4.js.br +0 -0
- codex/static_root/assets/reader-CXmsYhy4.js.gz +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css +0 -1
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css.br +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css.gz +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.css +0 -1
- codex/static_root/assets/stats-tab-BTZLMBCU.css.br +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.css.gz +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js +0 -1
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js.br +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js.gz +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.js +0 -1
- codex/static_root/assets/stats-tab-xK8fU37K.js.br +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.js.gz +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js +0 -1
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js.br +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js.gz +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.js +0 -1
- codex/static_root/assets/task-tab-D-j9C5kb.js.br +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.js.gz +0 -0
- codex/static_root/assets/task-tab-DoX9OA37.9bb355f36dbf.css +0 -1
- codex/static_root/assets/task-tab-DoX9OA37.9bb355f36dbf.css.gz +0 -0
- codex/static_root/assets/task-tab-DoX9OA37.css +0 -1
- codex/static_root/assets/task-tab-DoX9OA37.css.gz +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js +0 -1
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js.br +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js.gz +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.js +0 -1
- codex/static_root/assets/user-tab-DMcrO04A.js.br +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.js.gz +0 -0
- codex/static_root/img/logo-32.dbb98f6dfde4.webp +0 -0
- codex/static_root/img/logo-maskable-180.201cbde62d55.webp +0 -0
- codex/static_root/img/logo-maskable.d618c2d7943f.svg +0 -83
- codex/static_root/img/logo-maskable.d618c2d7943f.svg.br +0 -0
- codex/static_root/img/logo-maskable.d618c2d7943f.svg.gz +0 -0
- codex/static_root/img/logo.3fb129bfbd92.svg +0 -80
- codex/static_root/img/logo.3fb129bfbd92.svg.br +0 -0
- codex/static_root/img/logo.3fb129bfbd92.svg.gz +0 -0
- codex/static_root/img/missing-cover.8c8c1d4f6782.webp +0 -0
- codex/static_root/img/missing-cover.webp +0 -0
- codex/static_root/img/missing-page.71bb10f7c72a.svg +0 -13
- codex/static_root/img/missing-page.71bb10f7c72a.svg.br +0 -0
- codex/static_root/img/missing-page.71bb10f7c72a.svg.gz +0 -0
- codex/static_root/img/missing-page.svg +0 -13
- codex/static_root/img/missing-page.svg.br +0 -0
- codex/static_root/img/missing-page.svg.gz +0 -0
- codex/static_root/js/choices-admin.bb730e4f26ac.json.br +0 -0
- codex/static_root/js/choices-admin.bb730e4f26ac.json.gz +0 -0
- codex/static_root/js/choices.fedcbd1ec085.json +0 -1
- codex/static_root/js/choices.fedcbd1ec085.json.br +0 -0
- codex/static_root/js/choices.fedcbd1ec085.json.gz +0 -0
- codex/static_root/manifest.8e6c35516db7.json +0 -607
- codex/static_root/manifest.8e6c35516db7.json.br +0 -0
- codex/static_root/manifest.8e6c35516db7.json.gz +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/LICENSE +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/WHEEL +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -1,108 +1,63 @@
|
|
|
1
1
|
"""Base view for ordering the query."""
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from types import MappingProxyType
|
|
3
|
+
from django.db.models.aggregates import Max, Min
|
|
5
4
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
5
|
+
from codex.models import Comic
|
|
6
|
+
from codex.views.browser.filters.annotations import (
|
|
7
|
+
BrowserAnnotationsFilterView,
|
|
8
|
+
)
|
|
8
9
|
|
|
9
|
-
from codex.models import Comic, Folder, StoryArc
|
|
10
|
-
from codex.views.browser.base import BrowserBaseView
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
class BrowserOrderByView(BrowserBaseView):
|
|
11
|
+
class BrowserOrderByView(BrowserAnnotationsFilterView):
|
|
14
12
|
"""Base class for views that need ordering."""
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"created_at": Min,
|
|
21
|
-
"critical_rating": Avg,
|
|
22
|
-
"date": Min,
|
|
23
|
-
"page_count": Sum,
|
|
24
|
-
"path": Min,
|
|
25
|
-
"size": Sum,
|
|
26
|
-
"updated_at": Min,
|
|
27
|
-
"search_score": Min,
|
|
28
|
-
"story_arc_number": Min,
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
_SEP_VALUE = Value(sep)
|
|
32
|
-
_ANNOTATED_ORDER_FIELDS = frozenset(
|
|
33
|
-
("sort_name", "search_score", "bookmark_updated_at")
|
|
34
|
-
)
|
|
35
|
-
_COMIC_COVER_ORDERING = ("comic__" + field for field in Comic.ORDERING)
|
|
14
|
+
def __init__(self, *args, **kwargs):
|
|
15
|
+
"""Set params for the type checker."""
|
|
16
|
+
super().__init__(*args, **kwargs)
|
|
17
|
+
self.order_key: str = ""
|
|
36
18
|
|
|
37
19
|
def set_order_key(self):
|
|
38
20
|
"""Get the default order key for the view."""
|
|
39
|
-
order_key = self.params.get("order_by")
|
|
21
|
+
order_key: str = self.params.get("order_by", "") # type: ignore
|
|
40
22
|
if not order_key:
|
|
41
23
|
group = self.kwargs.get("group")
|
|
42
|
-
order_key = "
|
|
43
|
-
self.order_key = order_key
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def _get_path_query_func(cls, field):
|
|
47
|
-
"""Use the db to get only the filename."""
|
|
48
|
-
return Right(
|
|
49
|
-
field,
|
|
50
|
-
StrIndex(Reverse(field), cls._SEP_VALUE) - 1, # type: ignore
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
def get_aggregate_func(self, model, field):
|
|
54
|
-
"""Order by aggregate."""
|
|
55
|
-
# get agg_func
|
|
56
|
-
agg_func = self._ORDER_AGGREGATE_FUNCS[field]
|
|
57
|
-
if agg_func == Min and self.params.get("order_reverse"):
|
|
58
|
-
agg_func = Max
|
|
59
|
-
|
|
60
|
-
# get full_field
|
|
61
|
-
self.kwargs.get("group")
|
|
62
|
-
if model == StoryArc and field == "story_arc_number":
|
|
63
|
-
full_field = "storyarcnumber__number"
|
|
64
|
-
else:
|
|
65
|
-
if self.order_key == "story_arc_number":
|
|
66
|
-
field = "story_arc_numbers__number"
|
|
67
|
-
full_field = self.rel_prefix + field
|
|
68
|
-
if field == "path":
|
|
69
|
-
full_field = self._get_path_query_func(full_field)
|
|
70
|
-
|
|
71
|
-
return agg_func(full_field)
|
|
24
|
+
order_key = "filename" if group == self.FOLDER_GROUP else "sort_name"
|
|
25
|
+
self.order_key: str = order_key
|
|
26
|
+
order_reverse = self.params.get("order_reverse")
|
|
27
|
+
self.order_agg_func = Max if order_reverse else Min
|
|
72
28
|
|
|
73
|
-
def
|
|
74
|
-
"""Get a complete function for aggregating an attribute."""
|
|
75
|
-
# Determine order func
|
|
76
|
-
if self.order_key == "path" and model in (Comic, Folder):
|
|
77
|
-
# special path sorting.
|
|
78
|
-
func = self._get_path_query_func(self.order_key)
|
|
79
|
-
elif model == Comic or self.order_key in self._ANNOTATED_ORDER_FIELDS:
|
|
80
|
-
# agg_none uses group fields not comic fields.
|
|
81
|
-
func = F(self.order_key) # type: ignore
|
|
82
|
-
else:
|
|
83
|
-
func = self.get_aggregate_func(model, self.order_key)
|
|
84
|
-
return func
|
|
85
|
-
|
|
86
|
-
def add_order_by(self, queryset, model, cover=False):
|
|
29
|
+
def add_order_by(self, qs, model):
|
|
87
30
|
"""Create the order_by list."""
|
|
88
|
-
|
|
89
|
-
if
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
31
|
+
order_fields_head = None
|
|
32
|
+
if model == Comic:
|
|
33
|
+
if self.order_key == "sort_name":
|
|
34
|
+
order_fields_head = [
|
|
35
|
+
*self.comic_sort_names, # type: ignore
|
|
36
|
+
"issue_number",
|
|
37
|
+
"issue_suffix",
|
|
38
|
+
"sort_name",
|
|
39
|
+
]
|
|
95
40
|
else:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
41
|
+
# Comic orders on indexed fields directly
|
|
42
|
+
# Which is allegedly faster than using tmp b-trees (annotations)
|
|
43
|
+
# And since that's every cover sort, it's worth it.
|
|
44
|
+
order_fields_head = [self.order_key]
|
|
45
|
+
# Comic order micro optimizations
|
|
46
|
+
if self.order_key == "story_arc_number":
|
|
47
|
+
order_fields_head += ["date"]
|
|
48
|
+
elif self.order_key == "bookmark_updated_at":
|
|
49
|
+
order_fields_head += ["updated_at"]
|
|
101
50
|
else:
|
|
102
|
-
|
|
51
|
+
order_fields_head = ["order_value"]
|
|
103
52
|
|
|
53
|
+
order_fields = (*order_fields_head, "pk")
|
|
54
|
+
|
|
55
|
+
prefix = "-" if self.params.get("order_reverse") else ""
|
|
104
56
|
order_by = []
|
|
105
|
-
|
|
106
|
-
|
|
57
|
+
if prefix:
|
|
58
|
+
for field in order_fields:
|
|
59
|
+
order_by.append(prefix + field)
|
|
60
|
+
else:
|
|
61
|
+
order_by = order_fields
|
|
107
62
|
|
|
108
|
-
return
|
|
63
|
+
return qs.order_by(*order_by)
|
codex/views/browser/choices.py
CHANGED
|
@@ -11,7 +11,6 @@ from rest_framework.response import Response
|
|
|
11
11
|
|
|
12
12
|
from codex.logger.logging import get_logger
|
|
13
13
|
from codex.models import (
|
|
14
|
-
BrowserGroupModel,
|
|
15
14
|
Comic,
|
|
16
15
|
ContributorPerson,
|
|
17
16
|
Folder,
|
|
@@ -29,18 +28,23 @@ from codex.serializers.browser.filters import (
|
|
|
29
28
|
)
|
|
30
29
|
from codex.serializers.models.pycountry import PyCountrySerializer
|
|
31
30
|
from codex.views.auth import IsAuthenticatedOrEnabledNonUsers
|
|
32
|
-
from codex.views.browser.
|
|
31
|
+
from codex.views.browser.filters.annotations import (
|
|
32
|
+
BrowserAnnotationsFilterView,
|
|
33
|
+
)
|
|
33
34
|
|
|
34
35
|
LOG = get_logger(__name__)
|
|
35
36
|
|
|
36
37
|
_FIELD_TO_REL_MODEL_MAP = MappingProxyType(
|
|
37
38
|
{
|
|
38
|
-
|
|
39
|
+
BrowserAnnotationsFilterView.CONTRIBUTOR_PERSON_UI_FIELD: (
|
|
39
40
|
"contributors__person",
|
|
40
41
|
ContributorPerson,
|
|
41
42
|
),
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
BrowserAnnotationsFilterView.STORY_ARC_UI_FIELD: (
|
|
44
|
+
"story_arc_numbers__story_arc",
|
|
45
|
+
StoryArc,
|
|
46
|
+
),
|
|
47
|
+
BrowserAnnotationsFilterView.IDENTIFIER_TYPE_UI_FIELD: (
|
|
44
48
|
"identifiers__identifier_type",
|
|
45
49
|
IdentifierType,
|
|
46
50
|
),
|
|
@@ -48,7 +52,7 @@ _FIELD_TO_REL_MODEL_MAP = MappingProxyType(
|
|
|
48
52
|
)
|
|
49
53
|
|
|
50
54
|
|
|
51
|
-
class BrowserChoicesViewBase(
|
|
55
|
+
class BrowserChoicesViewBase(BrowserAnnotationsFilterView):
|
|
52
56
|
"""Get choices for filter dialog."""
|
|
53
57
|
|
|
54
58
|
permission_classes: ClassVar[list] = [IsAuthenticatedOrEnabledNonUsers] # type: ignore
|
|
@@ -76,6 +80,7 @@ class BrowserChoicesViewBase(BrowserBaseView):
|
|
|
76
80
|
IdentifierType: "identifiers__identifier_type",
|
|
77
81
|
}
|
|
78
82
|
)
|
|
83
|
+
_SERIALIZER_MANY = False
|
|
79
84
|
|
|
80
85
|
@staticmethod
|
|
81
86
|
def get_field_choices_query(comic_qs, field_name):
|
|
@@ -123,18 +128,17 @@ class BrowserChoicesViewBase(BrowserBaseView):
|
|
|
123
128
|
|
|
124
129
|
def get_object(self):
|
|
125
130
|
"""Get the comic subquery use for the choices."""
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
object_filter = self.get_query_filters(self.model, search_scores, True)
|
|
130
|
-
return self.model.objects.filter(object_filter) # type: ignore
|
|
131
|
+
object_filter = self.get_query_filters(self.model, choices=True)
|
|
132
|
+
qs = self.model.objects.filter(object_filter) # type: ignore
|
|
133
|
+
return self.filter_by_annotations(qs, self.model, binary=True)
|
|
131
134
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
self.
|
|
135
|
+
@extend_schema(request=BrowserAnnotationsFilterView.input_serializer_class)
|
|
136
|
+
def get(self, *_args, **_kwargs):
|
|
137
|
+
"""Return choices."""
|
|
138
|
+
self.init_request()
|
|
139
|
+
obj = self.get_object()
|
|
140
|
+
serializer = self.get_serializer(obj, many=self._SERIALIZER_MANY)
|
|
141
|
+
return Response(serializer.data)
|
|
138
142
|
|
|
139
143
|
|
|
140
144
|
class BrowserChoicesAvailableView(BrowserChoicesViewBase):
|
|
@@ -145,11 +149,14 @@ class BrowserChoicesAvailableView(BrowserChoicesViewBase):
|
|
|
145
149
|
@classmethod
|
|
146
150
|
def _get_field_choices_count(cls, comic_qs, field_name):
|
|
147
151
|
"""Create a pk:name object for fields without tables."""
|
|
148
|
-
|
|
152
|
+
qs = cls.get_field_choices_query(comic_qs, field_name)
|
|
153
|
+
return qs.count()
|
|
149
154
|
|
|
150
155
|
def _get_m2m_field_choices_count(self, model, comic_qs, rel):
|
|
151
156
|
"""Get choices with nulls where there are nulls."""
|
|
152
|
-
|
|
157
|
+
m2m_qs = self.get_m2m_field_query(model, comic_qs)
|
|
158
|
+
m2m_qs = m2m_qs.values("pk")
|
|
159
|
+
count = m2m_qs.count()
|
|
153
160
|
|
|
154
161
|
# Detect if there are null choices.
|
|
155
162
|
# Regretabbly with another query, but doing a forward query
|
|
@@ -160,14 +167,9 @@ class BrowserChoicesAvailableView(BrowserChoicesViewBase):
|
|
|
160
167
|
|
|
161
168
|
return count
|
|
162
169
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
self.parse_params()
|
|
167
|
-
self._set_model()
|
|
168
|
-
self.set_rel_prefix(self.model)
|
|
169
|
-
comic_qs = self.get_object()
|
|
170
|
-
|
|
170
|
+
def get_object(self):
|
|
171
|
+
"""Get choice counts."""
|
|
172
|
+
qs = super().get_object()
|
|
171
173
|
data = {}
|
|
172
174
|
for field_name in self.serializer_class().get_fields(): # type: ignore
|
|
173
175
|
if field_name == "story_arcs" and self.model == StoryArc:
|
|
@@ -176,9 +178,9 @@ class BrowserChoicesAvailableView(BrowserChoicesViewBase):
|
|
|
176
178
|
rel, m2m_model = self.get_rel_and_model(field_name)
|
|
177
179
|
|
|
178
180
|
if m2m_model:
|
|
179
|
-
count = self._get_m2m_field_choices_count(m2m_model,
|
|
181
|
+
count = self._get_m2m_field_choices_count(m2m_model, qs, rel)
|
|
180
182
|
else:
|
|
181
|
-
count = self._get_field_choices_count(
|
|
183
|
+
count = self._get_field_choices_count(qs, rel)
|
|
182
184
|
|
|
183
185
|
filters = self.params.get("filters", {})
|
|
184
186
|
try:
|
|
@@ -186,15 +188,14 @@ class BrowserChoicesAvailableView(BrowserChoicesViewBase):
|
|
|
186
188
|
except TypeError:
|
|
187
189
|
flag = False
|
|
188
190
|
data[field_name] = flag
|
|
189
|
-
|
|
190
|
-
serializer = self.get_serializer(data)
|
|
191
|
-
return Response(serializer.data)
|
|
191
|
+
return data
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
class BrowserChoicesView(BrowserChoicesViewBase):
|
|
195
195
|
"""Get choices for filter dialog."""
|
|
196
196
|
|
|
197
197
|
# serializer_class = Dynamic class determined in get()
|
|
198
|
+
_SERIALIZER_MANY = True
|
|
198
199
|
|
|
199
200
|
def _get_field_choices(self, comic_qs, field_name):
|
|
200
201
|
"""Create a pk:name object for fields without tables."""
|
|
@@ -238,21 +239,14 @@ class BrowserChoicesView(BrowserChoicesViewBase):
|
|
|
238
239
|
field_name = self._get_field_name()
|
|
239
240
|
return CHOICES_SERIALIZER_CLASS_MAP.get(field_name, CharListField)
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
self.parse_params()
|
|
245
|
-
self._set_model()
|
|
246
|
-
self.set_rel_prefix(self.model)
|
|
247
|
-
|
|
242
|
+
def get_object(self):
|
|
243
|
+
"""Return choices with more than one choice."""
|
|
244
|
+
qs = super().get_object()
|
|
248
245
|
field_name = self._get_field_name()
|
|
249
246
|
rel, m2m_model = self.get_rel_and_model(field_name)
|
|
250
247
|
|
|
251
|
-
comic_qs = self.get_object()
|
|
252
248
|
if m2m_model:
|
|
253
|
-
choices = self._get_m2m_field_choices(m2m_model,
|
|
249
|
+
choices = self._get_m2m_field_choices(m2m_model, qs, rel)
|
|
254
250
|
else:
|
|
255
|
-
choices = self._get_field_choices(
|
|
256
|
-
|
|
257
|
-
serializer = self.get_serializer(choices, many=True)
|
|
258
|
-
return Response(serializer.data)
|
|
251
|
+
choices = self._get_field_choices(qs, rel)
|
|
252
|
+
return choices
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Annotations used by a filter."""
|
|
2
|
+
|
|
3
|
+
from django.db.models.aggregates import Count
|
|
4
|
+
from django.db.models.expressions import Value
|
|
5
|
+
from django.db.models.fields import PositiveSmallIntegerField
|
|
6
|
+
|
|
7
|
+
from codex.models.comic import Comic
|
|
8
|
+
from codex.views.browser.base import BrowserBaseView
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BrowserAnnotationsFilterView(BrowserBaseView):
|
|
12
|
+
"""Annotations that also filter."""
|
|
13
|
+
|
|
14
|
+
ONE_INTEGERFIELD = Value(1, PositiveSmallIntegerField())
|
|
15
|
+
|
|
16
|
+
def _annotate_child_count(self, qs, model):
|
|
17
|
+
"""Annotate Child Count."""
|
|
18
|
+
if model == Comic:
|
|
19
|
+
child_count_sum = self.ONE_INTEGERFIELD
|
|
20
|
+
else:
|
|
21
|
+
child_count_sum = Count(self.rel_prefix + "pk", distinct=True)
|
|
22
|
+
if self.TARGET == "opds2":
|
|
23
|
+
if model != Comic:
|
|
24
|
+
qs = qs.alias(child_count=child_count_sum)
|
|
25
|
+
else:
|
|
26
|
+
qs = qs.annotate(child_count=child_count_sum)
|
|
27
|
+
if model != Comic:
|
|
28
|
+
qs = qs.filter(child_count__gt=0)
|
|
29
|
+
return qs
|
|
30
|
+
|
|
31
|
+
def filter_by_annotations(self, qs, model, binary=False):
|
|
32
|
+
"""Filter queryset by annotations."""
|
|
33
|
+
qs = self._annotate_child_count(qs, model)
|
|
34
|
+
return self.apply_search_filter(qs, model, binary=binary)
|
|
@@ -10,18 +10,19 @@ class GroupFilterMixin(GroupACLMixin):
|
|
|
10
10
|
|
|
11
11
|
def get_group_filter(self, choices):
|
|
12
12
|
"""Get filter for the displayed group."""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if
|
|
13
|
+
group = self.kwargs["group"] # type: ignore
|
|
14
|
+
pks = self.kwargs["pks"] # type: ignore
|
|
15
|
+
if pks: # type: ignore
|
|
16
16
|
group_relation = "comic__" if choices else ""
|
|
17
17
|
if choices and group == self.FOLDER_GROUP:
|
|
18
18
|
group_relation += "folders"
|
|
19
19
|
else:
|
|
20
20
|
group_relation += self.GROUP_RELATION[group]
|
|
21
|
-
|
|
21
|
+
group_relation += "__in"
|
|
22
|
+
group_filter_dict = {group_relation: pks} # type: ignore
|
|
22
23
|
elif group == self.FOLDER_GROUP:
|
|
23
|
-
|
|
24
|
+
group_filter_dict = {"parent_folder": None}
|
|
24
25
|
else:
|
|
25
|
-
|
|
26
|
+
group_filter_dict = {}
|
|
26
27
|
|
|
27
|
-
return
|
|
28
|
+
return Q(**group_filter_dict)
|
|
@@ -1,52 +1,185 @@
|
|
|
1
1
|
"""Search Filters Methods."""
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from time import time
|
|
5
|
+
|
|
6
|
+
from django.db.models import Case, Value, When
|
|
4
7
|
|
|
5
|
-
from codex._vendor.haystack.query import SearchQuerySet
|
|
6
8
|
from codex.logger.logging import get_logger
|
|
7
9
|
from codex.models import Comic
|
|
10
|
+
from codex.search.query import CodexSearchQuerySet
|
|
11
|
+
from codex.settings.settings import DEBUG
|
|
12
|
+
from codex.views.browser.const import MAX_OBJ_PER_PAGE
|
|
8
13
|
|
|
9
14
|
LOG = get_logger(__name__)
|
|
15
|
+
SEARCH_SCORE_MAX = 100.0
|
|
16
|
+
SEARCH_SCORE_MIN = 0.001
|
|
17
|
+
SEARCH_SCORE_EMPTY = 0.0
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class SearchScorePks:
|
|
22
|
+
"""Search Scores for annotation."""
|
|
23
|
+
|
|
24
|
+
scored_pks: tuple[int, ...] = ()
|
|
25
|
+
prev_pks: tuple[int, ...] = ()
|
|
26
|
+
next_pks: tuple[int, ...] = ()
|
|
10
27
|
|
|
11
28
|
|
|
12
29
|
class SearchFilterMixin:
|
|
13
30
|
"""Search Filters Methods."""
|
|
14
31
|
|
|
15
|
-
def
|
|
32
|
+
def _is_search_results_limited(self) -> bool:
|
|
33
|
+
"""Get search result limit from params."""
|
|
34
|
+
# user = self.request.user # type: ignore
|
|
35
|
+
# if user and user.is_authenticated:
|
|
36
|
+
# limited = bool(
|
|
37
|
+
# self.params.get( # type: ignore
|
|
38
|
+
# "search_results_limit",
|
|
39
|
+
# MAX_OBJ_PER_PAGE,
|
|
40
|
+
# )
|
|
41
|
+
# )
|
|
42
|
+
# else:
|
|
43
|
+
# limited = True
|
|
44
|
+
# return limited
|
|
45
|
+
return True
|
|
46
|
+
|
|
47
|
+
def _get_binary_search_scores(self, sqs):
|
|
48
|
+
"""Get search scores for choices and metadata."""
|
|
49
|
+
sqs = sqs.values_list("pk", flat=True)
|
|
50
|
+
if self._is_search_results_limited():
|
|
51
|
+
page = self.kwargs.get("page", 1) # type: ignore
|
|
52
|
+
limit = page * MAX_OBJ_PER_PAGE + 1
|
|
53
|
+
sqs = sqs[:limit]
|
|
54
|
+
return tuple(sqs)
|
|
55
|
+
|
|
56
|
+
def _get_browser_search_scores_params(self, is_search_results_limited):
|
|
57
|
+
page = self.kwargs.get("page", 1) # type: ignore
|
|
58
|
+
if is_search_results_limited:
|
|
59
|
+
offset = 0
|
|
60
|
+
limit = page * MAX_OBJ_PER_PAGE + 1
|
|
61
|
+
else:
|
|
62
|
+
# For unlimited search actually take a slice
|
|
63
|
+
offset = max(0, (page - 1) * MAX_OBJ_PER_PAGE) # type: ignore
|
|
64
|
+
limit = offset + MAX_OBJ_PER_PAGE # type: ignore
|
|
65
|
+
|
|
66
|
+
if DEBUG:
|
|
67
|
+
LOG.debug(
|
|
68
|
+
f"Searching... {page=} {offset=} {limit=} {is_search_results_limited=}"
|
|
69
|
+
)
|
|
70
|
+
return offset, limit
|
|
71
|
+
|
|
72
|
+
def _get_browser_search_scores(self, sqs):
|
|
73
|
+
"""Get search scores for the browser cards."""
|
|
74
|
+
is_search_results_limited = self._is_search_results_limited()
|
|
75
|
+
offset, limit = self._get_browser_search_scores_params(
|
|
76
|
+
is_search_results_limited
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
scores_pairs = []
|
|
80
|
+
prev_pks = []
|
|
81
|
+
next_pks = []
|
|
82
|
+
scored_pks = []
|
|
83
|
+
|
|
84
|
+
if DEBUG:
|
|
85
|
+
start_time = time()
|
|
86
|
+
|
|
87
|
+
order_reverse = self.params.get("order_reverse", False) # type: ignore
|
|
88
|
+
if not order_reverse:
|
|
89
|
+
sqs = sqs.order_reverse()
|
|
90
|
+
|
|
91
|
+
scores_values = sqs.values_list("pk", "score")
|
|
92
|
+
if is_search_results_limited:
|
|
93
|
+
scores_values = scores_values[:limit]
|
|
94
|
+
for index, pair in enumerate(scores_values):
|
|
95
|
+
pk = pair[0]
|
|
96
|
+
if index < offset:
|
|
97
|
+
prev_pks.append(pk)
|
|
98
|
+
elif index > limit:
|
|
99
|
+
next_pks.append(pk)
|
|
100
|
+
else:
|
|
101
|
+
scores_pairs.append(pair)
|
|
102
|
+
scored_pks.append(pk)
|
|
103
|
+
|
|
104
|
+
if not order_reverse:
|
|
105
|
+
tmp = prev_pks
|
|
106
|
+
prev_pks = next_pks
|
|
107
|
+
next_pks = tmp
|
|
108
|
+
|
|
109
|
+
if DEBUG:
|
|
110
|
+
LOG.debug(
|
|
111
|
+
f"search {time() - start_time}s" # type: ignore
|
|
112
|
+
f" {len(scores_pairs)=} {len(prev_pks)=} {len(next_pks)=}"
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
return tuple(scores_pairs), tuple(prev_pks), tuple(next_pks), tuple(scored_pks)
|
|
116
|
+
|
|
117
|
+
def _get_search_scores(self, binary=False):
|
|
16
118
|
"""Perform the search and return the scores as a dict."""
|
|
17
|
-
search_scores = {}
|
|
18
119
|
text = self.params.get("q", "") # type: ignore
|
|
19
120
|
if not text:
|
|
20
|
-
return
|
|
121
|
+
return (), (), (), ()
|
|
21
122
|
|
|
22
|
-
|
|
23
|
-
|
|
123
|
+
score_pairs = ()
|
|
124
|
+
scored_pks = ()
|
|
125
|
+
prev_pks = ()
|
|
126
|
+
next_pks = ()
|
|
24
127
|
try:
|
|
25
|
-
|
|
26
|
-
|
|
128
|
+
sqs = CodexSearchQuerySet()
|
|
129
|
+
sqs = sqs.auto_query(text) # .filter(score__gt=0.0)
|
|
130
|
+
binary = binary or self.params.get("order_by") != "search_score" # type: ignore
|
|
131
|
+
if binary:
|
|
132
|
+
scored_pks = self._get_binary_search_scores(sqs)
|
|
133
|
+
else:
|
|
134
|
+
score_pairs, prev_pks, next_pks, scored_pks = (
|
|
135
|
+
self._get_browser_search_scores(sqs)
|
|
136
|
+
)
|
|
27
137
|
except MemoryError:
|
|
28
138
|
LOG.warning("Search engine needs more memory, results truncated.")
|
|
29
139
|
except Exception:
|
|
30
|
-
LOG.exception("
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
140
|
+
LOG.exception("Getting Search Scores")
|
|
141
|
+
return score_pairs, prev_pks, next_pks, scored_pks
|
|
142
|
+
|
|
143
|
+
def annotate_search_score( # noqa: PLR0913
|
|
144
|
+
self, qs, model, score_pairs, prev_pks=None, next_pks=None
|
|
145
|
+
):
|
|
146
|
+
"""Annotate the search score for ordering by search score.
|
|
34
147
|
|
|
35
|
-
|
|
148
|
+
Choose the maximum matching score for the group.
|
|
149
|
+
"""
|
|
150
|
+
if score_pairs:
|
|
151
|
+
prefix = "" if model == Comic else self.rel_prefix # type: ignore
|
|
152
|
+
whens = []
|
|
153
|
+
for pk, score in score_pairs:
|
|
154
|
+
when = {prefix + "pk": pk, "then": score}
|
|
155
|
+
whens.append(When(**when))
|
|
156
|
+
if prev_pks:
|
|
157
|
+
whens.append(When(pk__in=prev_pks, then=SEARCH_SCORE_MAX))
|
|
158
|
+
if next_pks:
|
|
159
|
+
whens.append(When(pk__in=next_pks, then=SEARCH_SCORE_MIN))
|
|
160
|
+
search_score = self.order_agg_func(Case(*whens, default=SEARCH_SCORE_EMPTY)) # type: ignore
|
|
161
|
+
else:
|
|
162
|
+
search_score = Value(0.0)
|
|
163
|
+
return qs.annotate(search_score=search_score)
|
|
164
|
+
|
|
165
|
+
def _get_search_query_filter(self, model, scored_pks):
|
|
36
166
|
"""Get the search filter and scores."""
|
|
37
167
|
prefix = "" if model == Comic else self.rel_prefix # type: ignore
|
|
38
168
|
rel = prefix + "pk__in"
|
|
39
|
-
|
|
40
|
-
return Q(**query_dict)
|
|
169
|
+
return {rel: scored_pks}
|
|
41
170
|
|
|
42
|
-
def
|
|
171
|
+
def apply_search_filter(self, qs, model, binary=False):
|
|
43
172
|
"""Preparse search, search and return the filter and scores."""
|
|
44
|
-
search_filter = Q()
|
|
45
173
|
try:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
174
|
+
score_pairs, prev_pks, next_pks, scored_pks = self._get_search_scores(
|
|
175
|
+
binary
|
|
176
|
+
)
|
|
177
|
+
qs = self.annotate_search_score(qs, model, score_pairs, prev_pks, next_pks)
|
|
178
|
+
if score_pairs:
|
|
179
|
+
search_filter = self._get_search_query_filter(model, scored_pks)
|
|
180
|
+
qs = qs.filter(**search_filter)
|
|
181
|
+
self.cover_search_score_pairs = score_pairs
|
|
182
|
+
except Exception:
|
|
183
|
+
LOG.exception("Creating the search filter")
|
|
51
184
|
|
|
52
|
-
return
|
|
185
|
+
return qs
|