codex 1.6.0__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 +18 -22
- codex/integrity.py +3 -66
- codex/librarian/covers/coverd.py +2 -2
- codex/librarian/covers/create.py +29 -50
- codex/librarian/covers/path.py +6 -8
- codex/librarian/covers/purge.py +18 -28
- codex/librarian/covers/tasks.py +2 -3
- codex/librarian/importer/{aggregate.py → aggregate_metadata.py} +88 -58
- codex/librarian/importer/{extract.py → clean_metadata.py} +4 -33
- codex/librarian/importer/const.py +13 -46
- codex/librarian/importer/create_comics.py +17 -101
- codex/librarian/importer/create_fks.py +134 -99
- codex/librarian/importer/deleted.py +28 -103
- codex/librarian/importer/failed_imports.py +64 -42
- codex/librarian/importer/importerd.py +290 -71
- codex/librarian/importer/link_comics.py +26 -26
- codex/librarian/importer/moved.py +81 -128
- codex/librarian/importer/query_fks.py +122 -142
- codex/librarian/importer/status.py +39 -8
- codex/librarian/importer/tasks.py +9 -26
- codex/librarian/importer/update_comics.py +89 -0
- codex/librarian/janitor/cleanup.py +2 -26
- codex/librarian/janitor/failed_imports.py +1 -1
- codex/librarian/janitor/janitor.py +1 -13
- codex/librarian/janitor/janitord.py +1 -1
- codex/librarian/janitor/status.py +0 -1
- codex/librarian/janitor/tasks.py +0 -5
- codex/librarian/librariand.py +5 -9
- codex/librarian/notifier/notifierd.py +1 -1
- codex/librarian/notifier/tasks.py +4 -4
- codex/librarian/search/update.py +1 -1
- codex/librarian/watchdog/db_snapshot.py +6 -9
- codex/librarian/watchdog/emitter.py +0 -3
- codex/librarian/watchdog/event_batcherd.py +3 -19
- codex/librarian/watchdog/events.py +36 -176
- codex/librarian/watchdog/observers.py +3 -13
- codex/middleware.py +2 -1
- codex/migrations/0027_sort_name.py +149 -0
- codex/models/admin.py +2 -0
- codex/models/base.py +0 -3
- codex/models/comic.py +9 -13
- codex/models/{util.py → const.py} +2 -15
- codex/models/groups.py +14 -28
- codex/models/library.py +3 -11
- codex/models/paths.py +14 -61
- codex/permissions.py +1 -1
- codex/search/backend_search.py +8 -5
- codex/search/query.py +2 -25
- codex/search/writing.py +1 -1
- codex/serializers/admin.py +44 -53
- codex/serializers/browser/choices.py +42 -37
- codex/serializers/browser/filters.py +131 -32
- codex/serializers/browser/metadata.py +1 -45
- codex/serializers/browser/mixins.py +4 -37
- codex/serializers/browser/page.py +6 -3
- codex/serializers/browser/settings.py +11 -42
- codex/serializers/choices.py +1 -14
- codex/serializers/models/pycountry.py +51 -11
- codex/serializers/opds/v2.py +16 -10
- codex/serializers/opds/v2_unused.py +3 -5
- codex/serializers/reader.py +7 -21
- codex/serializers/redirect.py +2 -3
- codex/serializers/route.py +7 -16
- codex/settings/settings.py +8 -23
- codex/startup.py +3 -77
- codex/static_root/assets/VCheckbox-Aq_ImMNC.da711f8b6a15.js +1 -0
- 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-Aq_ImMNC.js +1 -0
- 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-DxNOKONG.5ab34c4c47aa.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-DxNOKONG.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-lQ13FnRR.1c801ad756b2.css → VDialog-C5Nxd_zP.css} +1 -1
- 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-lQ13FnRR.css → VDialog-C5Nxd_zP.d327f505ef0e.css} +1 -1
- 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-DEezv8bL.4a609e74e507.js +1 -0
- 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-DEezv8bL.js +1 -0
- 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-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-DJAPiluk.402a7ad84a8e.js +1 -0
- 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-DJAPiluk.js +1 -0
- 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/{VTable-2RHFqfg6.f0f2106b158b.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-2RHFqfg6.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/VTextField-DuIIp-VY.580110ad24dc.css +1 -0
- 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/VTextField-DuIIp-VY.css +1 -0
- 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-B8Bp2Uih.82c98714bcf1.css → admin-BbrOU9Y9.29936748af9e.css} +1 -1
- 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-B8Bp2Uih.css → admin-BbrOU9Y9.css} +1 -1
- 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-DejrPZxl.9fd36bef6fdd.js +1 -0
- 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-DejrPZxl.js +1 -0
- 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-DHo57nTp.4d79a276d806.js +1 -0
- 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-DHo57nTp.js +1 -0
- 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-D5vWrihT.js → group-tab-BTAjhv32.ac196780d0a9.js} +1 -1
- 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-D5vWrihT.1afb2ce453ff.js → group-tab-BTAjhv32.js} +1 -1
- 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/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-DKulXuTl.95e42988d5d5.css.br → 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-DKulXuTl.css.br → http-error-_wlDqEcp.css.br} +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.css.gz +0 -0
- codex/static_root/assets/index-DUjeNg4x.36d50c91b2c1.js +1 -0
- codex/static_root/assets/index-DUjeNg4x.36d50c91b2c1.js.br +0 -0
- codex/static_root/assets/index-DUjeNg4x.36d50c91b2c1.js.gz +0 -0
- codex/static_root/assets/index-DUjeNg4x.js +1 -0
- codex/static_root/assets/index-DUjeNg4x.js.br +0 -0
- codex/static_root/assets/index-DUjeNg4x.js.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-Ztp855PW.d46d718fac45.css → main-sK7HC5h4.6f04ddfc5f1a.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.6f04ddfc5f1a.css.br +0 -0
- codex/static_root/assets/{main-Ztp855PW.d46d718fac45.css.gz → main-sK7HC5h4.6f04ddfc5f1a.css.gz} +0 -0
- codex/static_root/assets/{main-Ztp855PW.css → main-sK7HC5h4.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.css.br +0 -0
- codex/static_root/assets/{main-Ztp855PW.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-CD2lnB32.1cef3bf498be.js +35 -0
- 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-CD2lnB32.js +35 -0
- 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-Bsc-gUxE.98e65384c3c9.css → relation-chips-D6T6FX7G.css} +1 -1
- 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-Bsc-gUxE.css → relation-chips-D6T6FX7G.db095b2497e4.css} +1 -1
- 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-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/to-case-kUm8NPpW.5b3369f511b8.js +1 -0
- codex/static_root/assets/to-case-kUm8NPpW.js +1 -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-CibJYD8o.4c2de98c2b53.css → unauthorized-DWgytUow.ca2f13dbdbf5.css} +1 -1
- 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-CibJYD8o.css → unauthorized-DWgytUow.css} +1 -1
- 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/js/choices-admin.248384ece3f6.json +1 -0
- 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 +298 -279
- 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 +2 -11
- codex/urls/api/auth.py +1 -2
- codex/urls/api/browser.py +4 -13
- codex/urls/api/reader.py +9 -3
- codex/urls/api/v3.py +0 -2
- codex/urls/opds/binary.py +1 -1
- codex/views/admin/api_key.py +8 -7
- codex/views/admin/flag.py +7 -2
- codex/views/admin/group.py +6 -2
- codex/views/admin/library.py +37 -44
- codex/views/admin/stats.py +83 -20
- codex/views/admin/tasks.py +12 -26
- codex/views/admin/user.py +9 -3
- codex/views/auth.py +54 -31
- codex/views/bookmark.py +72 -92
- codex/views/browser/base.py +90 -42
- codex/views/browser/browser.py +371 -92
- codex/views/browser/{annotations.py → browser_annotations.py} +121 -67
- codex/views/browser/browser_breadcrumbs.py +175 -0
- codex/views/browser/browser_order_by.py +63 -0
- codex/views/browser/choices.py +85 -38
- codex/views/browser/const.py +3 -0
- codex/views/browser/filters/annotations.py +19 -87
- codex/views/browser/filters/bookmark.py +12 -24
- codex/views/browser/filters/field.py +6 -8
- codex/views/browser/filters/group.py +14 -35
- codex/views/browser/filters/search.py +20 -31
- codex/views/browser/metadata.py +73 -112
- codex/views/browser/session.py +12 -0
- codex/views/const.py +0 -140
- codex/views/cover.py +77 -0
- codex/views/download.py +8 -5
- codex/views/frontend.py +2 -4
- codex/views/opds/authentication_v1.py +45 -46
- codex/views/opds/binary.py +10 -5
- codex/views/opds/const.py +0 -13
- codex/views/opds/urls.py +4 -6
- codex/views/opds/util.py +12 -4
- codex/views/opds/v1/entry/links.py +33 -18
- codex/views/opds/v1/facets.py +7 -7
- codex/views/opds/v1/feed.py +45 -55
- codex/views/opds/v1/links.py +5 -7
- codex/views/opds/v1/opensearch_v1.py +6 -2
- codex/views/opds/v2/feed.py +26 -25
- codex/views/opds/v2/links.py +2 -4
- codex/views/opds/v2/publications.py +54 -34
- codex/views/opds/v2/top_links.py +2 -2
- codex/views/reader/page.py +8 -15
- codex/views/reader/reader.py +322 -19
- codex/views/reader/{settings.py → session.py} +2 -4
- codex/views/session.py +102 -83
- codex/views/template.py +3 -3
- codex/views/version.py +2 -2
- codex/websockets/consumers.py +10 -14
- {codex-1.6.0.dist-info → codex-1.6.0a0.dist-info}/METADATA +15 -22
- {codex-1.6.0.dist-info → codex-1.6.0a0.dist-info}/RECORD +449 -467
- codex/librarian/importer/cache.py +0 -93
- codex/librarian/importer/create_covers.py +0 -96
- codex/librarian/importer/importer.py +0 -96
- codex/librarian/importer/init.py +0 -265
- codex/librarian/importer/link_covers.py +0 -73
- codex/librarian/importer/query_covers.py +0 -52
- codex/migrations/0027_import_order_and_covers.py +0 -280
- codex/serializers/browser/mtime.py +0 -21
- codex/serializers/fields.py +0 -149
- codex/serializers/settings.py +0 -12
- codex/static_root/assets/VCheckbox-DanrzdHo.8ec5e2094cbf.js +0 -1
- codex/static_root/assets/VCheckbox-DanrzdHo.8ec5e2094cbf.js.br +0 -0
- codex/static_root/assets/VCheckbox-DanrzdHo.8ec5e2094cbf.js.gz +0 -0
- codex/static_root/assets/VCheckbox-DanrzdHo.js +0 -1
- codex/static_root/assets/VCheckbox-DanrzdHo.js.br +0 -0
- codex/static_root/assets/VCheckbox-DanrzdHo.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-DxNOKONG.5ab34c4c47aa.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-DxNOKONG.5ab34c4c47aa.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-DxNOKONG.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-DxNOKONG.js.gz +0 -0
- codex/static_root/assets/VCombobox-DDvdoPTG.11d080e8edd7.js +0 -1
- codex/static_root/assets/VCombobox-DDvdoPTG.11d080e8edd7.js.br +0 -0
- codex/static_root/assets/VCombobox-DDvdoPTG.11d080e8edd7.js.gz +0 -0
- codex/static_root/assets/VCombobox-DDvdoPTG.js +0 -1
- codex/static_root/assets/VCombobox-DDvdoPTG.js.br +0 -0
- codex/static_root/assets/VCombobox-DDvdoPTG.js.gz +0 -0
- codex/static_root/assets/VDialog-Bd5dN_E1.457666d7fce1.js +0 -1
- codex/static_root/assets/VDialog-Bd5dN_E1.457666d7fce1.js.br +0 -0
- codex/static_root/assets/VDialog-Bd5dN_E1.457666d7fce1.js.gz +0 -0
- codex/static_root/assets/VDialog-Bd5dN_E1.js +0 -1
- codex/static_root/assets/VDialog-Bd5dN_E1.js.br +0 -0
- codex/static_root/assets/VDialog-Bd5dN_E1.js.gz +0 -0
- codex/static_root/assets/VDialog-lQ13FnRR.1c801ad756b2.css.br +0 -0
- codex/static_root/assets/VDialog-lQ13FnRR.1c801ad756b2.css.gz +0 -0
- codex/static_root/assets/VDialog-lQ13FnRR.css.br +0 -0
- codex/static_root/assets/VDialog-lQ13FnRR.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.12673cf9f391.js +0 -1
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.12673cf9f391.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.12673cf9f391.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.js +0 -1
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-DqTuYpTR.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DKb8XPr-.3cf6bf5bf3bc.js +0 -1
- codex/static_root/assets/VRadioGroup-DKb8XPr-.3cf6bf5bf3bc.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DKb8XPr-.3cf6bf5bf3bc.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DKb8XPr-.js +0 -1
- codex/static_root/assets/VRadioGroup-DKb8XPr-.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DKb8XPr-.js.gz +0 -0
- codex/static_root/assets/VSelect-C_yPbyCG.08bd6b53a7ce.js +0 -1
- codex/static_root/assets/VSelect-C_yPbyCG.08bd6b53a7ce.js.br +0 -0
- codex/static_root/assets/VSelect-C_yPbyCG.08bd6b53a7ce.js.gz +0 -0
- codex/static_root/assets/VSelect-C_yPbyCG.js +0 -1
- codex/static_root/assets/VSelect-C_yPbyCG.js.br +0 -0
- codex/static_root/assets/VSelect-C_yPbyCG.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CmFPvGMS.802c9b3e6e28.js +0 -1
- codex/static_root/assets/VSelectionControl-CmFPvGMS.802c9b3e6e28.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CmFPvGMS.802c9b3e6e28.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CmFPvGMS.js +0 -1
- codex/static_root/assets/VSelectionControl-CmFPvGMS.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CmFPvGMS.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-D5FZWsM1.a47491fe3e6d.js +0 -1
- codex/static_root/assets/VSlideGroup-D5FZWsM1.a47491fe3e6d.js.br +0 -0
- codex/static_root/assets/VSlideGroup-D5FZWsM1.a47491fe3e6d.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-D5FZWsM1.js +0 -1
- codex/static_root/assets/VSlideGroup-D5FZWsM1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-D5FZWsM1.js.gz +0 -0
- codex/static_root/assets/VTable-2RHFqfg6.f0f2106b158b.js.br +0 -0
- codex/static_root/assets/VTable-2RHFqfg6.f0f2106b158b.js.gz +0 -0
- codex/static_root/assets/VTable-2RHFqfg6.js.br +0 -0
- codex/static_root/assets/VTable-2RHFqfg6.js.gz +0 -0
- codex/static_root/assets/VTextField-BssVoDhB.4cc388b4aa3c.css +0 -1
- codex/static_root/assets/VTextField-BssVoDhB.4cc388b4aa3c.css.br +0 -0
- codex/static_root/assets/VTextField-BssVoDhB.4cc388b4aa3c.css.gz +0 -0
- codex/static_root/assets/VTextField-BssVoDhB.css +0 -1
- codex/static_root/assets/VTextField-BssVoDhB.css.br +0 -0
- codex/static_root/assets/VTextField-BssVoDhB.css.gz +0 -0
- codex/static_root/assets/VTextField-o1N9ylIb.7fffaeff8d40.js +0 -1
- codex/static_root/assets/VTextField-o1N9ylIb.7fffaeff8d40.js.br +0 -0
- codex/static_root/assets/VTextField-o1N9ylIb.7fffaeff8d40.js.gz +0 -0
- codex/static_root/assets/VTextField-o1N9ylIb.js +0 -1
- codex/static_root/assets/VTextField-o1N9ylIb.js.br +0 -0
- codex/static_root/assets/VTextField-o1N9ylIb.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C_zvuz9C.663fa48efea4.js +0 -1
- codex/static_root/assets/VWindowItem-C_zvuz9C.663fa48efea4.js.br +0 -0
- codex/static_root/assets/VWindowItem-C_zvuz9C.663fa48efea4.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C_zvuz9C.js +0 -1
- codex/static_root/assets/VWindowItem-C_zvuz9C.js.br +0 -0
- codex/static_root/assets/VWindowItem-C_zvuz9C.js.gz +0 -0
- codex/static_root/assets/admin-B8Bp2Uih.82c98714bcf1.css.br +0 -0
- codex/static_root/assets/admin-B8Bp2Uih.82c98714bcf1.css.gz +0 -0
- codex/static_root/assets/admin-B8Bp2Uih.css.br +0 -0
- codex/static_root/assets/admin-B8Bp2Uih.css.gz +0 -0
- codex/static_root/assets/admin-DHyHEWZ3.7a8015456c0f.js +0 -1
- codex/static_root/assets/admin-DHyHEWZ3.7a8015456c0f.js.br +0 -0
- codex/static_root/assets/admin-DHyHEWZ3.7a8015456c0f.js.gz +0 -0
- codex/static_root/assets/admin-DHyHEWZ3.js +0 -1
- codex/static_root/assets/admin-DHyHEWZ3.js.br +0 -0
- codex/static_root/assets/admin-DHyHEWZ3.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.19507a95375b.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.19507a95375b.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.19507a95375b.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BXpIDQXM.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.561b3f75fe65.css +0 -1
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.561b3f75fe65.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.561b3f75fe65.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.css +0 -1
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mne3FIj6.css.gz +0 -0
- codex/static_root/assets/browser-D0Vjmmp_.a1bfaf48d65f.js +0 -1
- codex/static_root/assets/browser-D0Vjmmp_.a1bfaf48d65f.js.br +0 -0
- codex/static_root/assets/browser-D0Vjmmp_.a1bfaf48d65f.js.gz +0 -0
- codex/static_root/assets/browser-D0Vjmmp_.js +0 -1
- codex/static_root/assets/browser-D0Vjmmp_.js.br +0 -0
- codex/static_root/assets/browser-D0Vjmmp_.js.gz +0 -0
- codex/static_root/assets/browser-D7QQDneO.155cb612ed0c.css +0 -1
- codex/static_root/assets/browser-D7QQDneO.155cb612ed0c.css.br +0 -0
- codex/static_root/assets/browser-D7QQDneO.155cb612ed0c.css.gz +0 -0
- codex/static_root/assets/browser-D7QQDneO.css +0 -1
- codex/static_root/assets/browser-D7QQDneO.css.br +0 -0
- codex/static_root/assets/browser-D7QQDneO.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-0u6IJA87.5f9a9aa573b7.css +0 -1
- codex/static_root/assets/change-password-dialog-0u6IJA87.5f9a9aa573b7.css.br +0 -0
- codex/static_root/assets/change-password-dialog-0u6IJA87.5f9a9aa573b7.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-0u6IJA87.css +0 -1
- codex/static_root/assets/change-password-dialog-0u6IJA87.css.br +0 -0
- codex/static_root/assets/change-password-dialog-0u6IJA87.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.e642f7e2b96f.js +0 -1
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.e642f7e2b96f.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.e642f7e2b96f.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.js +0 -1
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BBsJLPXZ.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-DCKvg3ai.2a3277b3c147.js +0 -1
- codex/static_root/assets/confirm-dialog-DCKvg3ai.2a3277b3c147.js.br +0 -0
- codex/static_root/assets/confirm-dialog-DCKvg3ai.2a3277b3c147.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-DCKvg3ai.js +0 -1
- codex/static_root/assets/confirm-dialog-DCKvg3ai.js.br +0 -0
- codex/static_root/assets/confirm-dialog-DCKvg3ai.js.gz +0 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.bec27f144aca.js +0 -1
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.bec27f144aca.js.br +0 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.js +0 -1
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.js.br +0 -0
- codex/static_root/assets/datetime-column-DeCthByU.1f3bf499e063.css +0 -1
- codex/static_root/assets/datetime-column-DeCthByU.css +0 -1
- codex/static_root/assets/datetime-column-jHKA_uNm.039c7da2036f.js +0 -1
- codex/static_root/assets/datetime-column-jHKA_uNm.039c7da2036f.js.br +0 -0
- codex/static_root/assets/datetime-column-jHKA_uNm.039c7da2036f.js.gz +0 -0
- codex/static_root/assets/datetime-column-jHKA_uNm.js +0 -1
- codex/static_root/assets/datetime-column-jHKA_uNm.js.br +0 -0
- codex/static_root/assets/datetime-column-jHKA_uNm.js.gz +0 -0
- codex/static_root/assets/filter-DgPg2ts9.af0fcf0888c6.js +0 -1
- codex/static_root/assets/filter-DgPg2ts9.af0fcf0888c6.js.br +0 -0
- codex/static_root/assets/filter-DgPg2ts9.af0fcf0888c6.js.gz +0 -0
- codex/static_root/assets/filter-DgPg2ts9.js +0 -1
- codex/static_root/assets/filter-DgPg2ts9.js.br +0 -0
- codex/static_root/assets/filter-DgPg2ts9.js.gz +0 -0
- codex/static_root/assets/flag-tab-9qxOALxP.f89bc9891671.js +0 -1
- codex/static_root/assets/flag-tab-9qxOALxP.f89bc9891671.js.br +0 -0
- codex/static_root/assets/flag-tab-9qxOALxP.f89bc9891671.js.gz +0 -0
- codex/static_root/assets/flag-tab-9qxOALxP.js +0 -1
- codex/static_root/assets/flag-tab-9qxOALxP.js.br +0 -0
- codex/static_root/assets/flag-tab-9qxOALxP.js.gz +0 -0
- codex/static_root/assets/flag-tab-BNwbLfrN.b755a99fff7e.css +0 -1
- codex/static_root/assets/flag-tab-BNwbLfrN.b755a99fff7e.css.br +0 -0
- codex/static_root/assets/flag-tab-BNwbLfrN.b755a99fff7e.css.gz +0 -0
- codex/static_root/assets/flag-tab-BNwbLfrN.css +0 -1
- codex/static_root/assets/flag-tab-BNwbLfrN.css.br +0 -0
- codex/static_root/assets/flag-tab-BNwbLfrN.css.gz +0 -0
- codex/static_root/assets/group-tab-D5vWrihT.1afb2ce453ff.js.br +0 -0
- codex/static_root/assets/group-tab-D5vWrihT.1afb2ce453ff.js.gz +0 -0
- codex/static_root/assets/group-tab-D5vWrihT.js.br +0 -0
- codex/static_root/assets/group-tab-D5vWrihT.js.gz +0 -0
- codex/static_root/assets/http-error-B4FHoKfs.141fdae409bc.js +0 -1
- codex/static_root/assets/http-error-B4FHoKfs.141fdae409bc.js.br +0 -0
- codex/static_root/assets/http-error-B4FHoKfs.141fdae409bc.js.gz +0 -0
- codex/static_root/assets/http-error-B4FHoKfs.js +0 -1
- codex/static_root/assets/http-error-B4FHoKfs.js.br +0 -0
- codex/static_root/assets/http-error-B4FHoKfs.js.gz +0 -0
- codex/static_root/assets/http-error-DKulXuTl.95e42988d5d5.css +0 -1
- codex/static_root/assets/http-error-DKulXuTl.95e42988d5d5.css.gz +0 -0
- codex/static_root/assets/http-error-DKulXuTl.css +0 -1
- codex/static_root/assets/http-error-DKulXuTl.css.gz +0 -0
- codex/static_root/assets/library-tab-BN0SfPcH.913e236f625e.css +0 -1
- codex/static_root/assets/library-tab-BN0SfPcH.913e236f625e.css.br +0 -0
- codex/static_root/assets/library-tab-BN0SfPcH.913e236f625e.css.gz +0 -0
- codex/static_root/assets/library-tab-BN0SfPcH.css +0 -1
- codex/static_root/assets/library-tab-BN0SfPcH.css.br +0 -0
- codex/static_root/assets/library-tab-BN0SfPcH.css.gz +0 -0
- codex/static_root/assets/library-tab-BWo0cmzk.0e3d67d0c41a.js +0 -1
- codex/static_root/assets/library-tab-BWo0cmzk.0e3d67d0c41a.js.br +0 -0
- codex/static_root/assets/library-tab-BWo0cmzk.0e3d67d0c41a.js.gz +0 -0
- codex/static_root/assets/library-tab-BWo0cmzk.js +0 -1
- codex/static_root/assets/library-tab-BWo0cmzk.js.br +0 -0
- codex/static_root/assets/library-tab-BWo0cmzk.js.gz +0 -0
- codex/static_root/assets/main-Ztp855PW.css.br +0 -0
- codex/static_root/assets/main-Ztp855PW.d46d718fac45.css.br +0 -0
- codex/static_root/assets/main-ipmlipkF.5e60e6e8e447.js +0 -32
- codex/static_root/assets/main-ipmlipkF.5e60e6e8e447.js.br +0 -0
- codex/static_root/assets/main-ipmlipkF.5e60e6e8e447.js.gz +0 -0
- codex/static_root/assets/main-ipmlipkF.js +0 -32
- codex/static_root/assets/main-ipmlipkF.js.br +0 -0
- codex/static_root/assets/main-ipmlipkF.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BA9ifTed.b4865334ee08.css +0 -1
- codex/static_root/assets/pagination-toolbar-BA9ifTed.b4865334ee08.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BA9ifTed.b4865334ee08.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BA9ifTed.css +0 -1
- codex/static_root/assets/pagination-toolbar-BA9ifTed.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BA9ifTed.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.b3341b8028df.js +0 -1
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.b3341b8028df.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.b3341b8028df.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.js +0 -1
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-kZ-Xdv8c.js.gz +0 -0
- codex/static_root/assets/pdf-doc-C2StaYUz.cb848834dbe1.js +0 -305
- codex/static_root/assets/pdf-doc-C2StaYUz.cb848834dbe1.js.br +0 -0
- codex/static_root/assets/pdf-doc-C2StaYUz.cb848834dbe1.js.gz +0 -0
- codex/static_root/assets/pdf-doc-C2StaYUz.js +0 -305
- codex/static_root/assets/pdf-doc-C2StaYUz.js.br +0 -0
- codex/static_root/assets/pdf-doc-C2StaYUz.js.gz +0 -0
- codex/static_root/assets/reader-CCnq3j1-.b6b38ed5521e.js +0 -2
- codex/static_root/assets/reader-CCnq3j1-.b6b38ed5521e.js.br +0 -0
- codex/static_root/assets/reader-CCnq3j1-.b6b38ed5521e.js.gz +0 -0
- codex/static_root/assets/reader-CCnq3j1-.js +0 -2
- codex/static_root/assets/reader-CCnq3j1-.js.br +0 -0
- codex/static_root/assets/reader-CCnq3j1-.js.gz +0 -0
- codex/static_root/assets/reader-CqXFa_gE.78267e9de0c2.css +0 -1
- codex/static_root/assets/reader-CqXFa_gE.78267e9de0c2.css.br +0 -0
- codex/static_root/assets/reader-CqXFa_gE.78267e9de0c2.css.gz +0 -0
- codex/static_root/assets/reader-CqXFa_gE.css +0 -1
- codex/static_root/assets/reader-CqXFa_gE.css.br +0 -0
- codex/static_root/assets/reader-CqXFa_gE.css.gz +0 -0
- codex/static_root/assets/relation-chips-Bsc-gUxE.98e65384c3c9.css.br +0 -0
- codex/static_root/assets/relation-chips-Bsc-gUxE.98e65384c3c9.css.gz +0 -0
- codex/static_root/assets/relation-chips-Bsc-gUxE.css.br +0 -0
- codex/static_root/assets/relation-chips-Bsc-gUxE.css.gz +0 -0
- codex/static_root/assets/relation-chips-C9ysW0tU.670f1d1f273f.js +0 -1
- codex/static_root/assets/relation-chips-C9ysW0tU.670f1d1f273f.js.br +0 -0
- codex/static_root/assets/relation-chips-C9ysW0tU.670f1d1f273f.js.gz +0 -0
- codex/static_root/assets/relation-chips-C9ysW0tU.js +0 -1
- codex/static_root/assets/relation-chips-C9ysW0tU.js.br +0 -0
- codex/static_root/assets/relation-chips-C9ysW0tU.js.gz +0 -0
- codex/static_root/assets/settings-drawer-C0ofzAhW.c0def8f383cb.js +0 -2
- codex/static_root/assets/settings-drawer-C0ofzAhW.c0def8f383cb.js.br +0 -0
- codex/static_root/assets/settings-drawer-C0ofzAhW.c0def8f383cb.js.gz +0 -0
- codex/static_root/assets/settings-drawer-C0ofzAhW.js +0 -2
- codex/static_root/assets/settings-drawer-C0ofzAhW.js.br +0 -0
- codex/static_root/assets/settings-drawer-C0ofzAhW.js.gz +0 -0
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.01744e131806.css +0 -1
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.01744e131806.css.br +0 -0
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.01744e131806.css.gz +0 -0
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.css +0 -1
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.css.br +0 -0
- codex/static_root/assets/settings-drawer-nZ9HvKSZ.css.gz +0 -0
- codex/static_root/assets/stats-tab-B4yKuY0c.a5728396494b.css +0 -1
- codex/static_root/assets/stats-tab-B4yKuY0c.a5728396494b.css.br +0 -0
- codex/static_root/assets/stats-tab-B4yKuY0c.a5728396494b.css.gz +0 -0
- codex/static_root/assets/stats-tab-B4yKuY0c.css +0 -1
- codex/static_root/assets/stats-tab-B4yKuY0c.css.br +0 -0
- codex/static_root/assets/stats-tab-B4yKuY0c.css.gz +0 -0
- codex/static_root/assets/stats-tab-BqJj7j1w.38a3459d61ea.js +0 -1
- codex/static_root/assets/stats-tab-BqJj7j1w.38a3459d61ea.js.br +0 -0
- codex/static_root/assets/stats-tab-BqJj7j1w.38a3459d61ea.js.gz +0 -0
- codex/static_root/assets/stats-tab-BqJj7j1w.js +0 -1
- codex/static_root/assets/stats-tab-BqJj7j1w.js.br +0 -0
- codex/static_root/assets/stats-tab-BqJj7j1w.js.gz +0 -0
- codex/static_root/assets/task-tab-BsPzNk8S.e00630a60b43.js +0 -1
- codex/static_root/assets/task-tab-BsPzNk8S.e00630a60b43.js.br +0 -0
- codex/static_root/assets/task-tab-BsPzNk8S.e00630a60b43.js.gz +0 -0
- codex/static_root/assets/task-tab-BsPzNk8S.js +0 -1
- codex/static_root/assets/task-tab-BsPzNk8S.js.br +0 -0
- codex/static_root/assets/task-tab-BsPzNk8S.js.gz +0 -0
- codex/static_root/assets/to-case-KvqtSug2.9c02da2e47c7.js +0 -1
- codex/static_root/assets/to-case-KvqtSug2.9c02da2e47c7.js.br +0 -0
- codex/static_root/assets/to-case-KvqtSug2.js +0 -1
- codex/static_root/assets/to-case-KvqtSug2.js.br +0 -0
- codex/static_root/assets/unauthorized-CibJYD8o.4c2de98c2b53.css.br +0 -0
- codex/static_root/assets/unauthorized-CibJYD8o.4c2de98c2b53.css.gz +0 -0
- codex/static_root/assets/unauthorized-CibJYD8o.css.br +0 -0
- codex/static_root/assets/unauthorized-CibJYD8o.css.gz +0 -0
- codex/static_root/assets/unauthorized-DwSdNzX2.f418e69f3afe.js +0 -1
- codex/static_root/assets/unauthorized-DwSdNzX2.f418e69f3afe.js.br +0 -0
- codex/static_root/assets/unauthorized-DwSdNzX2.f418e69f3afe.js.gz +0 -0
- codex/static_root/assets/unauthorized-DwSdNzX2.js +0 -1
- codex/static_root/assets/unauthorized-DwSdNzX2.js.br +0 -0
- codex/static_root/assets/unauthorized-DwSdNzX2.js.gz +0 -0
- codex/static_root/assets/user-tab-DrJOb9Ys.083d993726d8.js +0 -1
- codex/static_root/assets/user-tab-DrJOb9Ys.083d993726d8.js.br +0 -0
- codex/static_root/assets/user-tab-DrJOb9Ys.083d993726d8.js.gz +0 -0
- codex/static_root/assets/user-tab-DrJOb9Ys.js +0 -1
- codex/static_root/assets/user-tab-DrJOb9Ys.js.br +0 -0
- codex/static_root/assets/user-tab-DrJOb9Ys.js.gz +0 -0
- codex/static_root/js/choices-admin.3521e2a863df.json +0 -1
- codex/static_root/js/choices-admin.3521e2a863df.json.br +0 -0
- codex/static_root/js/choices-admin.3521e2a863df.json.gz +0 -0
- codex/static_root/js/choices.2f6b0359e1ef.json +0 -1
- codex/static_root/js/choices.2f6b0359e1ef.json.br +0 -0
- codex/static_root/js/choices.2f6b0359e1ef.json.gz +0 -0
- codex/static_root/manifest.1c84116d9a0a.json +0 -622
- codex/static_root/manifest.1c84116d9a0a.json.br +0 -0
- codex/static_root/manifest.1c84116d9a0a.json.gz +0 -0
- codex/util.py +0 -12
- codex/views/admin/auth.py +0 -28
- codex/views/browser/breadcrumbs.py +0 -202
- codex/views/browser/cover.py +0 -165
- codex/views/browser/mtime.py +0 -61
- codex/views/browser/order_by.py +0 -65
- codex/views/browser/paginate.py +0 -106
- codex/views/browser/settings.py +0 -66
- codex/views/browser/title.py +0 -48
- codex/views/browser/validate.py +0 -161
- codex/views/opds/auth.py +0 -17
- codex/views/public.py +0 -36
- codex/views/reader/arcs.py +0 -92
- codex/views/reader/books.py +0 -181
- codex/views/reader/init.py +0 -125
- codex/views/settings.py +0 -47
- codex/views/util.py +0 -77
- {codex-1.6.0.dist-info → codex-1.6.0a0.dist-info}/LICENSE +0 -0
- {codex-1.6.0.dist-info → codex-1.6.0a0.dist-info}/WHEEL +0 -0
- {codex-1.6.0.dist-info → codex-1.6.0a0.dist-info}/entry_points.txt +0 -0
codex/views/browser/title.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"""Browser title."""
|
|
2
|
-
|
|
3
|
-
from codex.models import BrowserGroupModel, Comic, Volume
|
|
4
|
-
from codex.views.browser.breadcrumbs import BrowserBreadcrumbsView
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class BrowserTitleView(BrowserBreadcrumbsView):
|
|
8
|
-
"""Browser title methods."""
|
|
9
|
-
|
|
10
|
-
def __init__(self, *args, **kwargs):
|
|
11
|
-
"""Set params for the type checker."""
|
|
12
|
-
super().__init__(*args, **kwargs)
|
|
13
|
-
self.group_instance: BrowserGroupModel | None = None
|
|
14
|
-
|
|
15
|
-
def _get_root_group_name(self):
|
|
16
|
-
if not self.model:
|
|
17
|
-
reason = "No model set in browser"
|
|
18
|
-
raise ValueError(reason)
|
|
19
|
-
plural = self.model._meta.verbose_name_plural
|
|
20
|
-
if not plural:
|
|
21
|
-
reason = f"No plural name for {self.model}"
|
|
22
|
-
raise ValueError(reason)
|
|
23
|
-
return plural.capitalize(), 0
|
|
24
|
-
|
|
25
|
-
def _get_group_name(self):
|
|
26
|
-
group_count = 0
|
|
27
|
-
if gi := self.group_instance:
|
|
28
|
-
if isinstance(gi, Volume):
|
|
29
|
-
group_count = gi.series.volume_count
|
|
30
|
-
elif isinstance(gi, Comic):
|
|
31
|
-
group_count = gi.volume.issue_count
|
|
32
|
-
group_name = gi.name
|
|
33
|
-
else:
|
|
34
|
-
group_name = ""
|
|
35
|
-
return group_name, group_count
|
|
36
|
-
|
|
37
|
-
def get_browser_page_title(self):
|
|
38
|
-
"""Get the proper title for this browse level."""
|
|
39
|
-
pks = self.kwargs.get("pks")
|
|
40
|
-
if not pks:
|
|
41
|
-
group_name, group_count = self._get_root_group_name()
|
|
42
|
-
else:
|
|
43
|
-
group_name, group_count = self._get_group_name()
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
"group_name": group_name,
|
|
47
|
-
"group_count": group_count,
|
|
48
|
-
}
|
codex/views/browser/validate.py
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"""Browser Settings and URL Validation."""
|
|
2
|
-
|
|
3
|
-
from copy import deepcopy
|
|
4
|
-
from types import MappingProxyType
|
|
5
|
-
|
|
6
|
-
from codex.exceptions import SeeOtherRedirectError
|
|
7
|
-
from codex.logger.logging import get_logger
|
|
8
|
-
from codex.serializers.choices import DEFAULTS
|
|
9
|
-
from codex.views.browser.base import BrowserBaseView
|
|
10
|
-
from codex.views.const import (
|
|
11
|
-
COMIC_GROUP,
|
|
12
|
-
FOLDER_GROUP,
|
|
13
|
-
ROOT_GROUP,
|
|
14
|
-
STORY_ARC_GROUP,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
LOG = get_logger(__name__)
|
|
18
|
-
_NO_TOP_GROUP_VALIDATE = frozenset({"metadata"})
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class BrowserValidateView(BrowserBaseView):
|
|
22
|
-
"""Browser Settings and URL Validation."""
|
|
23
|
-
|
|
24
|
-
DEFAULT_ROUTE = MappingProxyType(
|
|
25
|
-
{
|
|
26
|
-
"name": "browser",
|
|
27
|
-
"params": deepcopy(DEFAULTS["breadcrumbs"][0]),
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
def raise_redirect(self, reason, route_mask=None, settings_mask=None):
|
|
32
|
-
"""Redirect the client to a valid group url."""
|
|
33
|
-
route = deepcopy(dict(self.DEFAULT_ROUTE))
|
|
34
|
-
if route_mask:
|
|
35
|
-
route["params"].update(route_mask) # type: ignore
|
|
36
|
-
settings = deepcopy(dict(self.params))
|
|
37
|
-
if settings_mask:
|
|
38
|
-
settings.update(settings_mask)
|
|
39
|
-
detail = {"route": route, "settings": settings, "reason": reason}
|
|
40
|
-
raise SeeOtherRedirectError(detail=detail)
|
|
41
|
-
|
|
42
|
-
def _get_valid_browse_top_groups(self):
|
|
43
|
-
"""Get valid top groups for the current settings.
|
|
44
|
-
|
|
45
|
-
Valid top groups are determined by the Browser Settings.
|
|
46
|
-
"""
|
|
47
|
-
valid_top_groups = []
|
|
48
|
-
|
|
49
|
-
show = self.params["show"]
|
|
50
|
-
for nav_group, allowed in show.items():
|
|
51
|
-
if allowed:
|
|
52
|
-
valid_top_groups.append(nav_group)
|
|
53
|
-
# Issues is always a valid top group
|
|
54
|
-
valid_top_groups += [COMIC_GROUP]
|
|
55
|
-
|
|
56
|
-
return valid_top_groups
|
|
57
|
-
|
|
58
|
-
def _validate_top_group(self, valid_top_groups):
|
|
59
|
-
# if self.TARGET in _NO_TOP_GROUP_VALIDATE:
|
|
60
|
-
# return
|
|
61
|
-
nav_group = self.kwargs.get("group")
|
|
62
|
-
top_group = self.params.get("top_group")
|
|
63
|
-
if top_group not in valid_top_groups:
|
|
64
|
-
reason = f"top_group {top_group} not in valid nav groups, changed to "
|
|
65
|
-
if nav_group in valid_top_groups:
|
|
66
|
-
valid_top_group = nav_group
|
|
67
|
-
reason += "nav group: "
|
|
68
|
-
else:
|
|
69
|
-
valid_top_group = valid_top_groups[0]
|
|
70
|
-
reason += "first valid top group "
|
|
71
|
-
reason += valid_top_group
|
|
72
|
-
pks = self.kwargs.get("pks", ())
|
|
73
|
-
page = self.kwargs["page"]
|
|
74
|
-
route = {"group": nav_group, "pks": pks, "page": page}
|
|
75
|
-
settings_mask = {"top_group": valid_top_group}
|
|
76
|
-
self.raise_redirect(reason, route, settings_mask)
|
|
77
|
-
|
|
78
|
-
def set_valid_browse_nav_groups(self, valid_top_groups):
|
|
79
|
-
"""Get valid nav groups for the current settings.
|
|
80
|
-
|
|
81
|
-
Valid nav groups are the top group and below that are also
|
|
82
|
-
enabled in browser settings.
|
|
83
|
-
|
|
84
|
-
May always navigate to root 'r' nav group.
|
|
85
|
-
"""
|
|
86
|
-
top_group = self.params["top_group"]
|
|
87
|
-
nav_group = self.kwargs["group"]
|
|
88
|
-
valid_nav_groups = [ROOT_GROUP]
|
|
89
|
-
|
|
90
|
-
for possible_index, possible_nav_group in enumerate(valid_top_groups):
|
|
91
|
-
if top_group == possible_nav_group:
|
|
92
|
-
# all the nav groups past this point,
|
|
93
|
-
# 'c' is obscured by the web reader url, but valid for opds
|
|
94
|
-
tail_top_groups = valid_top_groups[possible_index:]
|
|
95
|
-
valid_nav_groups += tail_top_groups
|
|
96
|
-
|
|
97
|
-
if nav_group not in valid_nav_groups:
|
|
98
|
-
reason = (
|
|
99
|
-
f"Nav group {nav_group} unavailable, "
|
|
100
|
-
f"redirect to {ROOT_GROUP}"
|
|
101
|
-
)
|
|
102
|
-
self.raise_redirect(reason)
|
|
103
|
-
break
|
|
104
|
-
self.valid_nav_groups = tuple(valid_nav_groups)
|
|
105
|
-
|
|
106
|
-
def _validate_folder_settings(self):
|
|
107
|
-
"""Check that all the view variables for folder mode are set right."""
|
|
108
|
-
# Check folder view admin flag
|
|
109
|
-
if not self.admin_flags["folder_view"]:
|
|
110
|
-
reason = "folder view disabled"
|
|
111
|
-
valid_top_groups = self._get_valid_browse_top_groups()
|
|
112
|
-
settings_mask = {"top_group": valid_top_groups[0]}
|
|
113
|
-
self.raise_redirect(reason, settings_mask=settings_mask)
|
|
114
|
-
|
|
115
|
-
valid_top_groups = (FOLDER_GROUP,)
|
|
116
|
-
self._validate_top_group(valid_top_groups)
|
|
117
|
-
self.valid_nav_groups = valid_top_groups
|
|
118
|
-
|
|
119
|
-
def _validate_browser_group_settings(self):
|
|
120
|
-
"""Check that all the view variables for browser mode are set right."""
|
|
121
|
-
# Validate Browser top_group
|
|
122
|
-
# Change top_group if its not in the valid top groups
|
|
123
|
-
valid_top_groups = self._get_valid_browse_top_groups()
|
|
124
|
-
self._validate_top_group(valid_top_groups)
|
|
125
|
-
|
|
126
|
-
# Validate pks
|
|
127
|
-
nav_group = self.kwargs["group"]
|
|
128
|
-
pks = self.kwargs["pks"]
|
|
129
|
-
if nav_group == ROOT_GROUP and (pks and 0 not in pks):
|
|
130
|
-
# r never has pks
|
|
131
|
-
reason = f"Redirect r with {pks=} to pks 0"
|
|
132
|
-
self.raise_redirect(reason)
|
|
133
|
-
|
|
134
|
-
# Validate Browser nav_group
|
|
135
|
-
# Redirect if nav group is wrong
|
|
136
|
-
self.set_valid_browse_nav_groups(valid_top_groups)
|
|
137
|
-
|
|
138
|
-
def _validate_story_arc_settings(self):
|
|
139
|
-
"""Validate story arc settings."""
|
|
140
|
-
valid_top_groups = (STORY_ARC_GROUP,)
|
|
141
|
-
self._validate_top_group(valid_top_groups)
|
|
142
|
-
self.valid_nav_groups = valid_top_groups
|
|
143
|
-
|
|
144
|
-
def validate_settings(self):
|
|
145
|
-
"""Validate group and top group settings."""
|
|
146
|
-
group = self.kwargs["group"]
|
|
147
|
-
if group == FOLDER_GROUP:
|
|
148
|
-
self._validate_folder_settings()
|
|
149
|
-
elif group == STORY_ARC_GROUP:
|
|
150
|
-
self._validate_story_arc_settings()
|
|
151
|
-
else:
|
|
152
|
-
self._validate_browser_group_settings()
|
|
153
|
-
|
|
154
|
-
# Validate order
|
|
155
|
-
if self.order_key == "filename" and not self.admin_flags["folder_view"]:
|
|
156
|
-
pks = self.kwargs["pks"]
|
|
157
|
-
page = self.kwargs["page"]
|
|
158
|
-
route_changes = {"group": group, "pks": pks, "page": page}
|
|
159
|
-
reason = "order by filename not allowed by admin flag."
|
|
160
|
-
settings_mask = {"order_by": "sort_name"}
|
|
161
|
-
self.raise_redirect(reason, route_changes, settings_mask)
|
codex/views/opds/auth.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"""OPDS Authentican mixin."""
|
|
2
|
-
|
|
3
|
-
from rest_framework.authentication import BasicAuthentication, SessionAuthentication
|
|
4
|
-
|
|
5
|
-
from codex.views.auth import IsAuthenticatedOrEnabledNonUsers
|
|
6
|
-
from codex.views.template import CodexXMLTemplateView
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class OPDSAuthMixin:
|
|
10
|
-
"""Add Basic Auth."""
|
|
11
|
-
|
|
12
|
-
authentication_classes = (SessionAuthentication, BasicAuthentication)
|
|
13
|
-
permission_classes = (IsAuthenticatedOrEnabledNonUsers,)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class OPDSTemplateView(OPDSAuthMixin, CodexXMLTemplateView):
|
|
17
|
-
"""XML Template view with OPDSAuth."""
|
codex/views/public.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"""Public non-authenticated views."""
|
|
2
|
-
|
|
3
|
-
from rest_framework.generics import GenericAPIView
|
|
4
|
-
from rest_framework.mixins import RetrieveModelMixin
|
|
5
|
-
|
|
6
|
-
from codex.logger.logging import get_logger
|
|
7
|
-
from codex.models import AdminFlag
|
|
8
|
-
from codex.serializers.auth import AuthAdminFlagsSerializer
|
|
9
|
-
from codex.serializers.choices import CHOICES
|
|
10
|
-
|
|
11
|
-
LOG = get_logger(__name__)
|
|
12
|
-
_ADMIN_FLAG_KEYS = frozenset(
|
|
13
|
-
{
|
|
14
|
-
AdminFlag.FlagChoices.NON_USERS.value,
|
|
15
|
-
AdminFlag.FlagChoices.REGISTRATION.value,
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class AdminFlagsView(GenericAPIView, RetrieveModelMixin):
|
|
21
|
-
"""Get admin flags relevant to auth."""
|
|
22
|
-
|
|
23
|
-
serializer_class = AuthAdminFlagsSerializer
|
|
24
|
-
queryset = AdminFlag.objects.filter(key__in=_ADMIN_FLAG_KEYS).only("key", "on")
|
|
25
|
-
|
|
26
|
-
def get_object(self):
|
|
27
|
-
"""Get admin flags."""
|
|
28
|
-
flags = {}
|
|
29
|
-
for obj in self.get_queryset(): # type: ignore
|
|
30
|
-
name = CHOICES["admin"]["adminFlags"][obj.key].lower().replace(" ", "_")
|
|
31
|
-
flags[name] = obj.on
|
|
32
|
-
return flags
|
|
33
|
-
|
|
34
|
-
def get(self, request, *args, **kwargs):
|
|
35
|
-
"""Get admin flags relevant to auth."""
|
|
36
|
-
return self.retrieve(request, *args, **kwargs)
|
codex/views/reader/arcs.py
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"""Reader get Arcs methods."""
|
|
2
|
-
|
|
3
|
-
from types import MappingProxyType
|
|
4
|
-
|
|
5
|
-
from codex.models import AdminFlag
|
|
6
|
-
from codex.util import max_none
|
|
7
|
-
from codex.views.const import FOLDER_GROUP, STORY_ARC_GROUP
|
|
8
|
-
from codex.views.reader.books import ReaderBooksView
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ReaderArcsView(ReaderBooksView):
|
|
12
|
-
"""Reader get Arcs methods."""
|
|
13
|
-
|
|
14
|
-
def __init__(self, *args, **kwargs):
|
|
15
|
-
"""Initialize instance vars."""
|
|
16
|
-
super().__init__(*args, **kwargs)
|
|
17
|
-
self.params: MappingProxyType = MappingProxyType({})
|
|
18
|
-
|
|
19
|
-
def _get_group_arc(self, book, attr):
|
|
20
|
-
"""Create the volume arc."""
|
|
21
|
-
group = getattr(book, attr, None)
|
|
22
|
-
if not group:
|
|
23
|
-
return None
|
|
24
|
-
|
|
25
|
-
_, arc_pks = self.get_group_pks_from_breadcrumbs([group])
|
|
26
|
-
if group.pk not in arc_pks:
|
|
27
|
-
arc_pks = (group.pk,)
|
|
28
|
-
return {
|
|
29
|
-
"group": attr[0],
|
|
30
|
-
"pks": arc_pks,
|
|
31
|
-
"name": group.name,
|
|
32
|
-
"mtime": group.updated_at,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
def _get_folder_arc(self, book):
|
|
36
|
-
"""Create the folder arc."""
|
|
37
|
-
efv_flag = (
|
|
38
|
-
AdminFlag.objects.only("on")
|
|
39
|
-
.get(key=AdminFlag.FlagChoices.FOLDER_VIEW.value)
|
|
40
|
-
.on
|
|
41
|
-
)
|
|
42
|
-
if not efv_flag:
|
|
43
|
-
return None
|
|
44
|
-
|
|
45
|
-
folder = book.parent_folder
|
|
46
|
-
return {
|
|
47
|
-
"group": FOLDER_GROUP,
|
|
48
|
-
"pks": (folder.pk,),
|
|
49
|
-
"name": folder.name,
|
|
50
|
-
"mtime": folder.updated_at,
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
def _get_story_arcs(self, book):
|
|
54
|
-
"""Create story arcs."""
|
|
55
|
-
sas = []
|
|
56
|
-
for san in book.story_arc_numbers.all():
|
|
57
|
-
sa = san.story_arc
|
|
58
|
-
arc = {
|
|
59
|
-
"group": "a",
|
|
60
|
-
"pks": (sa.pk,),
|
|
61
|
-
"name": sa.name,
|
|
62
|
-
"mtime": sa.updated_at,
|
|
63
|
-
}
|
|
64
|
-
sas.append(arc)
|
|
65
|
-
return sorted(sas, key=lambda x: x["name"])
|
|
66
|
-
|
|
67
|
-
def get_arcs(self, book):
|
|
68
|
-
"""Get all series/folder/story arcs."""
|
|
69
|
-
# create top arcs
|
|
70
|
-
arcs = []
|
|
71
|
-
top_group = self.params.get("top_group")
|
|
72
|
-
arc = None
|
|
73
|
-
if series_arc := self._get_group_arc(book, "series"):
|
|
74
|
-
arcs.append(series_arc)
|
|
75
|
-
arc = series_arc
|
|
76
|
-
if volume_arc := self._get_group_arc(book, "volume"):
|
|
77
|
-
arcs.append(volume_arc)
|
|
78
|
-
if not arc:
|
|
79
|
-
arc = volume_arc
|
|
80
|
-
if folder_arc := self._get_folder_arc(book):
|
|
81
|
-
arcs.append(folder_arc)
|
|
82
|
-
if top_group == FOLDER_GROUP:
|
|
83
|
-
arc = folder_arc
|
|
84
|
-
if story_arcs := self._get_story_arcs(book):
|
|
85
|
-
arcs = [*arcs, *story_arcs]
|
|
86
|
-
if top_group == STORY_ARC_GROUP:
|
|
87
|
-
arc = story_arcs[0]
|
|
88
|
-
|
|
89
|
-
max_mtime = None
|
|
90
|
-
for arc in arcs:
|
|
91
|
-
max_mtime = max_none(max_mtime, arc["mtime"])
|
|
92
|
-
return arcs, max_mtime
|
codex/views/reader/books.py
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"""Get Books methods."""
|
|
2
|
-
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
4
|
-
|
|
5
|
-
from django.db.models import F
|
|
6
|
-
|
|
7
|
-
from codex.models import Bookmark, Comic
|
|
8
|
-
from codex.views.bookmark import BookmarkBaseView
|
|
9
|
-
from codex.views.const import FOLDER_GROUP, NONE_INTEGERFIELD
|
|
10
|
-
from codex.views.mixins import SharedAnnotationsMixin
|
|
11
|
-
from codex.views.reader.init import ReaderInitView
|
|
12
|
-
|
|
13
|
-
if TYPE_CHECKING:
|
|
14
|
-
from collections.abc import Mapping
|
|
15
|
-
|
|
16
|
-
_SETTINGS_ATTRS = ("fit_to", "two_pages", "reading_direction")
|
|
17
|
-
_COMIC_FIELDS = (
|
|
18
|
-
"file_type",
|
|
19
|
-
"issue_number",
|
|
20
|
-
"issue_suffix",
|
|
21
|
-
"page_count",
|
|
22
|
-
"series",
|
|
23
|
-
"volume",
|
|
24
|
-
"reading_direction",
|
|
25
|
-
"updated_at",
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class ReaderBooksView(BookmarkBaseView, ReaderInitView, SharedAnnotationsMixin):
|
|
30
|
-
"""Get Books methods."""
|
|
31
|
-
|
|
32
|
-
def _get_reader_arc_pks( # noqa: PLR0913
|
|
33
|
-
self, arc, arc_pk_select_related, prefetch_related, arc_pk_rel, arc_group
|
|
34
|
-
):
|
|
35
|
-
"""Get the nav filter."""
|
|
36
|
-
if arc_pks := arc.get("pks", ()):
|
|
37
|
-
return arc_pks
|
|
38
|
-
|
|
39
|
-
comic_pk = self.kwargs["pk"]
|
|
40
|
-
try:
|
|
41
|
-
arc_pk_qs = Comic.objects.filter(pk=comic_pk)
|
|
42
|
-
arc_pk_qs = arc_pk_qs.select_related(*arc_pk_select_related)
|
|
43
|
-
arc_pk_qs = arc_pk_qs.prefetch_related(*prefetch_related)
|
|
44
|
-
arc_pk_qs = arc_pk_qs.values_list(arc_pk_rel, flat=True)
|
|
45
|
-
arc_pk = arc_pk_qs.first()
|
|
46
|
-
except IndexError:
|
|
47
|
-
arc_pk = 0
|
|
48
|
-
|
|
49
|
-
_, multi_arc_pks = self.get_group_pks_from_breadcrumbs([arc_group])
|
|
50
|
-
if not arc_pk or arc_pk in multi_arc_pks:
|
|
51
|
-
arc_pks = multi_arc_pks
|
|
52
|
-
|
|
53
|
-
if not arc_pks:
|
|
54
|
-
arc_pks = (arc_pk,)
|
|
55
|
-
|
|
56
|
-
return arc_pks
|
|
57
|
-
|
|
58
|
-
def _get_comics_list(self):
|
|
59
|
-
"""Get the reader naviation group filter."""
|
|
60
|
-
select_related = ("series", "volume")
|
|
61
|
-
prefetch_related = ()
|
|
62
|
-
|
|
63
|
-
arc: Mapping = self.params.get("arc", {}) # type: ignore
|
|
64
|
-
|
|
65
|
-
arc_group = arc.get("group", "s")
|
|
66
|
-
if arc_group == "a":
|
|
67
|
-
# for story arcs
|
|
68
|
-
rel = "story_arc_numbers__story_arc"
|
|
69
|
-
fields = _COMIC_FIELDS
|
|
70
|
-
arc_pk_rel = "story_arc_numbers__story_arc__pk"
|
|
71
|
-
prefetch_related = (*prefetch_related, "story_arc_numbers__story_arc")
|
|
72
|
-
arc_index = F("story_arc_numbers__number")
|
|
73
|
-
ordering = ("arc_index", "date", "pk")
|
|
74
|
-
arc_pk_select_related = ()
|
|
75
|
-
elif arc_group == FOLDER_GROUP:
|
|
76
|
-
# folder mode
|
|
77
|
-
rel = "parent_folder"
|
|
78
|
-
fields = (*_COMIC_FIELDS, "parent_folder")
|
|
79
|
-
arc_pk_rel = "parent_folder__pk"
|
|
80
|
-
arc_index = NONE_INTEGERFIELD
|
|
81
|
-
ordering = ("path", "pk")
|
|
82
|
-
arc_pk_select_related = ("parent_folder",)
|
|
83
|
-
elif arc_group == "v":
|
|
84
|
-
# volume
|
|
85
|
-
rel = "volume"
|
|
86
|
-
fields = _COMIC_FIELDS
|
|
87
|
-
arc_pk_rel = "volume__pk"
|
|
88
|
-
arc_index = NONE_INTEGERFIELD
|
|
89
|
-
ordering = ()
|
|
90
|
-
arc_pk_select_related = ("volume",)
|
|
91
|
-
else:
|
|
92
|
-
# series
|
|
93
|
-
rel = "series"
|
|
94
|
-
fields = _COMIC_FIELDS
|
|
95
|
-
arc_pk_rel = "series__pk"
|
|
96
|
-
arc_index = NONE_INTEGERFIELD
|
|
97
|
-
ordering = ()
|
|
98
|
-
arc_pk_select_related = ("series",)
|
|
99
|
-
|
|
100
|
-
arc_pks = self._get_reader_arc_pks(
|
|
101
|
-
arc, arc_pk_select_related, prefetch_related, arc_pk_rel, arc_group
|
|
102
|
-
)
|
|
103
|
-
nav_filter = {f"{rel}__in": arc_pks}
|
|
104
|
-
group_acl_filter = self.get_group_acl_filter(Comic)
|
|
105
|
-
|
|
106
|
-
qs = (
|
|
107
|
-
Comic.objects.filter(group_acl_filter)
|
|
108
|
-
.filter(**nav_filter)
|
|
109
|
-
.select_related(*select_related)
|
|
110
|
-
.prefetch_related(*prefetch_related)
|
|
111
|
-
.only(*fields)
|
|
112
|
-
.annotate(
|
|
113
|
-
issue_count=F("volume__issue_count"),
|
|
114
|
-
)
|
|
115
|
-
.annotate(
|
|
116
|
-
arc_pk=F(arc_pk_rel),
|
|
117
|
-
arc_index=arc_index,
|
|
118
|
-
)
|
|
119
|
-
.annotate(mtime=F("updated_at"))
|
|
120
|
-
)
|
|
121
|
-
qs = self.annotate_group_names(qs, Comic)
|
|
122
|
-
if arc_group in ("v", "s"):
|
|
123
|
-
show = self.params["show"]
|
|
124
|
-
model_group = "i" if arc_group == "s" else "s"
|
|
125
|
-
qs, comic_sort_names = self.alias_sort_names(
|
|
126
|
-
qs, Comic, pks=arc_pks, model_group=model_group, show=show
|
|
127
|
-
)
|
|
128
|
-
ordering = (
|
|
129
|
-
*comic_sort_names,
|
|
130
|
-
"issue_number",
|
|
131
|
-
"issue_suffix",
|
|
132
|
-
"sort_name",
|
|
133
|
-
)
|
|
134
|
-
qs = qs.order_by(*ordering)
|
|
135
|
-
return qs, arc_group
|
|
136
|
-
|
|
137
|
-
def _append_with_settings(self, book, bookmark_filter):
|
|
138
|
-
"""Append bookmark to book list."""
|
|
139
|
-
book.settings = (
|
|
140
|
-
Bookmark.objects.filter(**bookmark_filter, comic=book)
|
|
141
|
-
.only(*_SETTINGS_ATTRS)
|
|
142
|
-
.first()
|
|
143
|
-
)
|
|
144
|
-
return book
|
|
145
|
-
|
|
146
|
-
def get_book_collection(self):
|
|
147
|
-
"""Get the -1, +1 window around the current issue.
|
|
148
|
-
|
|
149
|
-
Uses iteration in python. There are some complicated ways of
|
|
150
|
-
doing this with __gt[0] & __lt[0] in the db, but I think they
|
|
151
|
-
might be even more expensive.
|
|
152
|
-
|
|
153
|
-
Yields 1 to 3 books
|
|
154
|
-
"""
|
|
155
|
-
comics, arc_group = self._get_comics_list()
|
|
156
|
-
bookmark_filter = self.get_bookmark_search_kwargs()
|
|
157
|
-
books = {}
|
|
158
|
-
prev_book = None
|
|
159
|
-
pk = self.kwargs.get("pk")
|
|
160
|
-
for index, book in enumerate(comics):
|
|
161
|
-
if books:
|
|
162
|
-
# after match set next comic and break
|
|
163
|
-
books["next"] = self._append_with_settings(book, bookmark_filter)
|
|
164
|
-
break
|
|
165
|
-
if book.pk == pk:
|
|
166
|
-
# first match. set previous and current comic
|
|
167
|
-
if prev_book:
|
|
168
|
-
books["prev"] = self._append_with_settings(
|
|
169
|
-
prev_book, bookmark_filter
|
|
170
|
-
)
|
|
171
|
-
# create extra current book attrs:
|
|
172
|
-
if book.arc_index is None:
|
|
173
|
-
book.arc_index = index + 1
|
|
174
|
-
book.filename = book.get_filename()
|
|
175
|
-
book.arc_group = arc_group
|
|
176
|
-
book.arc_count = comics.count()
|
|
177
|
-
books["current"] = self._append_with_settings(book, bookmark_filter)
|
|
178
|
-
else:
|
|
179
|
-
# Haven't matched yet, so set the previous comic
|
|
180
|
-
prev_book = book
|
|
181
|
-
return books
|
codex/views/reader/init.py
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"""Views for reading comic books."""
|
|
2
|
-
|
|
3
|
-
from copy import deepcopy
|
|
4
|
-
from types import MappingProxyType
|
|
5
|
-
|
|
6
|
-
from codex.logger.logging import get_logger
|
|
7
|
-
from codex.models import Comic
|
|
8
|
-
from codex.serializers.reader import (
|
|
9
|
-
ReaderViewInputSerializer,
|
|
10
|
-
)
|
|
11
|
-
from codex.views.const import FOLDER_GROUP, GROUP_RELATION, STORY_ARC_GROUP
|
|
12
|
-
from codex.views.session import SessionView
|
|
13
|
-
from codex.views.util import reparse_json_query_params
|
|
14
|
-
|
|
15
|
-
LOG = get_logger(__name__)
|
|
16
|
-
VALID_ARC_GROUPS = frozenset({"s", "v", "f", "a"})
|
|
17
|
-
_JSON_KEYS = frozenset({"arc", "breadcrumbs", "show"})
|
|
18
|
-
_BROWSER_SESSION_DEFAULTS = SessionView.SESSION_DEFAULTS[
|
|
19
|
-
SessionView.BROWSER_SESSION_KEY
|
|
20
|
-
]
|
|
21
|
-
_DEFAULT_PARAMS = {
|
|
22
|
-
"breadcrumbs": _BROWSER_SESSION_DEFAULTS["breadcrumbs"],
|
|
23
|
-
"show": _BROWSER_SESSION_DEFAULTS["show"],
|
|
24
|
-
"top_group": _BROWSER_SESSION_DEFAULTS["top_group"],
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class ReaderInitView(SessionView):
|
|
29
|
-
"""Reader initialization."""
|
|
30
|
-
|
|
31
|
-
input_serializer_class = ReaderViewInputSerializer
|
|
32
|
-
|
|
33
|
-
def __init__(self, *args, **kwargs):
|
|
34
|
-
"""Initialize instance vars."""
|
|
35
|
-
super().__init__(*args, **kwargs)
|
|
36
|
-
self.group_pks: dict[str, tuple[int, ...]] = {}
|
|
37
|
-
|
|
38
|
-
def _set_group_pks_from_breadcrumbs(self, groups, breadcrumbs):
|
|
39
|
-
"""Set Multi-Group pks from breadcrumbs to the cache."""
|
|
40
|
-
index = len(breadcrumbs) - 1
|
|
41
|
-
min_index = max(index - 1, 0) if FOLDER_GROUP in groups else 0
|
|
42
|
-
while index > min_index:
|
|
43
|
-
crumb = breadcrumbs[index]
|
|
44
|
-
crumb_group = crumb.get("group")
|
|
45
|
-
if crumb_group in groups:
|
|
46
|
-
pks = crumb.get("pks", ())
|
|
47
|
-
self.group_pks[crumb_group] = pks
|
|
48
|
-
break
|
|
49
|
-
index -= 1
|
|
50
|
-
else:
|
|
51
|
-
crumb_group = ""
|
|
52
|
-
pks = ()
|
|
53
|
-
for group in groups:
|
|
54
|
-
self.group_pks[group] = pks
|
|
55
|
-
return crumb_group, pks
|
|
56
|
-
|
|
57
|
-
def get_group_pks_from_breadcrumbs(self, groups):
|
|
58
|
-
"""Get Multi-Group pks from the breadcrumbs."""
|
|
59
|
-
# Return cached values
|
|
60
|
-
for group in groups:
|
|
61
|
-
if pks := self.group_pks.get(group):
|
|
62
|
-
return group, pks
|
|
63
|
-
|
|
64
|
-
# Validate input
|
|
65
|
-
breadcrumbs: tuple = self.params.get("breadcrumbs") # type: ignore
|
|
66
|
-
if not breadcrumbs:
|
|
67
|
-
return "", ()
|
|
68
|
-
|
|
69
|
-
return self._set_group_pks_from_breadcrumbs(groups, breadcrumbs)
|
|
70
|
-
|
|
71
|
-
def _ensure_arc_contains_comic(self, params):
|
|
72
|
-
"""Arc sanity check."""
|
|
73
|
-
arc = params.get("arc")
|
|
74
|
-
if not arc:
|
|
75
|
-
return
|
|
76
|
-
pk = self.kwargs["pk"]
|
|
77
|
-
arc_group = arc.get("group")
|
|
78
|
-
arc_pks = arc.get("pks")
|
|
79
|
-
valid = False
|
|
80
|
-
if rel := GROUP_RELATION.get(arc_group):
|
|
81
|
-
arc_filter = {rel: arc_pks}
|
|
82
|
-
valid = Comic.objects.filter(pk=pk, **arc_filter).exists()
|
|
83
|
-
if not valid:
|
|
84
|
-
LOG.warning(f"Invalid arc {arc} submitted to reader for comic {pk}.")
|
|
85
|
-
params.pop("arc", None)
|
|
86
|
-
|
|
87
|
-
def _ensure_arc(self, params):
|
|
88
|
-
"""arc.group validation."""
|
|
89
|
-
# Can't be in the serializer
|
|
90
|
-
arc = params.get("arc", {})
|
|
91
|
-
|
|
92
|
-
if arc.get("group") not in VALID_ARC_GROUPS:
|
|
93
|
-
top_group = params["top_group"]
|
|
94
|
-
if top_group in (FOLDER_GROUP, STORY_ARC_GROUP):
|
|
95
|
-
search_groups = (top_group,)
|
|
96
|
-
else:
|
|
97
|
-
search_groups = ("v", "s")
|
|
98
|
-
|
|
99
|
-
group, pks = self.get_group_pks_from_breadcrumbs(search_groups)
|
|
100
|
-
if not group:
|
|
101
|
-
group = "s"
|
|
102
|
-
|
|
103
|
-
arc["group"] = group
|
|
104
|
-
if pks:
|
|
105
|
-
arc["pks"] = pks
|
|
106
|
-
|
|
107
|
-
params["arc"] = arc
|
|
108
|
-
|
|
109
|
-
def _parse_params(self):
|
|
110
|
-
try:
|
|
111
|
-
data = self.request.GET
|
|
112
|
-
data = reparse_json_query_params(self.request.GET, _JSON_KEYS)
|
|
113
|
-
serializer = self.input_serializer_class(data=data)
|
|
114
|
-
serializer.is_valid(raise_exception=True)
|
|
115
|
-
|
|
116
|
-
params = deepcopy(_DEFAULT_PARAMS)
|
|
117
|
-
if serializer.validated_data:
|
|
118
|
-
params.update(serializer.validated_data) # type: ignore
|
|
119
|
-
self._ensure_arc_contains_comic(params)
|
|
120
|
-
self._ensure_arc(params)
|
|
121
|
-
|
|
122
|
-
self.params = MappingProxyType(params)
|
|
123
|
-
except Exception:
|
|
124
|
-
LOG.exception("validate")
|
|
125
|
-
raise
|