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
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"""Update Groups timestamp for cover cache busting."""
|
|
2
|
-
|
|
3
|
-
from django.db.models.aggregates import Count
|
|
4
|
-
from django.db.models.functions.datetime import Now
|
|
5
|
-
from django.db.models.query import Q
|
|
6
|
-
|
|
7
|
-
from codex.librarian.importer.init import InitImporter
|
|
8
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
9
|
-
from codex.models import StoryArc, Volume
|
|
10
|
-
from codex.status import Status
|
|
11
|
-
from codex.views.const import GROUP_MODELS
|
|
12
|
-
|
|
13
|
-
_UPDATE_FIELDS = ("updated_at",)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class CacheUpdateImporter(InitImporter):
|
|
17
|
-
"""Update Groups timestamp for cover cache busting."""
|
|
18
|
-
|
|
19
|
-
@staticmethod
|
|
20
|
-
def _get_update_filter(model, start_time, force_update_group_map):
|
|
21
|
-
# Get groups with comics updated during this import
|
|
22
|
-
rel = "storyarcnumber__" if model == StoryArc else ""
|
|
23
|
-
updated_at_rel = rel + "comic__updated_at__gt"
|
|
24
|
-
updated_filter = {updated_at_rel: start_time}
|
|
25
|
-
update_filter = Q(**updated_filter)
|
|
26
|
-
|
|
27
|
-
# Get groups with custom covers updated during this import
|
|
28
|
-
if model != Volume:
|
|
29
|
-
update_filter |= Q(custom_cover__updated_at__gt=start_time)
|
|
30
|
-
|
|
31
|
-
# Get groups to be force updated (usually those with deleted children)
|
|
32
|
-
if pks := force_update_group_map.get(model):
|
|
33
|
-
update_filter |= Q(pk__in=pks)
|
|
34
|
-
|
|
35
|
-
return update_filter
|
|
36
|
-
|
|
37
|
-
@staticmethod
|
|
38
|
-
def _add_child_count_filter(qs, model):
|
|
39
|
-
"""Filter out groups with no comics."""
|
|
40
|
-
rel_prefix = "storyarcnumber__" if model == StoryArc else ""
|
|
41
|
-
rel_prefix += "comic"
|
|
42
|
-
qs = qs.alias(child_count=Count(f"{rel_prefix}__pk", distinct=True))
|
|
43
|
-
return qs.filter(child_count__gt=0)
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def _update_group_model(cls, force_update_group_map, model, start_time, log_list):
|
|
47
|
-
"""Update a single group model."""
|
|
48
|
-
update_filter = cls._get_update_filter(
|
|
49
|
-
model, start_time, force_update_group_map
|
|
50
|
-
)
|
|
51
|
-
qs = model.objects.filter(update_filter)
|
|
52
|
-
qs = cls._add_child_count_filter(qs, model)
|
|
53
|
-
|
|
54
|
-
qs = qs.distinct()
|
|
55
|
-
qs = qs.only(*_UPDATE_FIELDS)
|
|
56
|
-
|
|
57
|
-
updated = []
|
|
58
|
-
for obj in qs:
|
|
59
|
-
obj.updated_at = Now()
|
|
60
|
-
updated.append(obj)
|
|
61
|
-
|
|
62
|
-
count = len(updated)
|
|
63
|
-
if count:
|
|
64
|
-
model.objects.bulk_update(updated, _UPDATE_FIELDS)
|
|
65
|
-
log_list.append(f"{count} {model.__name__}s")
|
|
66
|
-
return count
|
|
67
|
-
|
|
68
|
-
def update_all_groups(self, force_update_group_map, start_time):
|
|
69
|
-
"""Update timestamps for each group for cover cache busting."""
|
|
70
|
-
total_count = 0
|
|
71
|
-
status = Status(ImportStatusTypes.GROUP_UPDATE)
|
|
72
|
-
self.status_controller.start(status)
|
|
73
|
-
try:
|
|
74
|
-
log_list = []
|
|
75
|
-
for model in GROUP_MODELS:
|
|
76
|
-
# self.log.debug(f"Updating timestamps for {model.__name__}s...")
|
|
77
|
-
count = self._update_group_model(
|
|
78
|
-
force_update_group_map, model, start_time, log_list
|
|
79
|
-
)
|
|
80
|
-
if count:
|
|
81
|
-
self.log.debug(f"Updated {count} {model.__name__}s timestamps.")
|
|
82
|
-
status.add_complete(count)
|
|
83
|
-
self.status_controller.update(status, notify=False)
|
|
84
|
-
total_count += count
|
|
85
|
-
|
|
86
|
-
if total_count:
|
|
87
|
-
groups_log = ", ".join(log_list)
|
|
88
|
-
self.log.info( # type: ignore
|
|
89
|
-
f"Updated timestamps for {groups_log}."
|
|
90
|
-
)
|
|
91
|
-
self.changed += total_count
|
|
92
|
-
finally:
|
|
93
|
-
self.status_controller.finish(status)
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"""Create Custom Covers."""
|
|
2
|
-
|
|
3
|
-
from django.db.models.functions.datetime import Now
|
|
4
|
-
|
|
5
|
-
from codex.librarian.importer.const import (
|
|
6
|
-
COVERS_CREATE,
|
|
7
|
-
COVERS_UPDATE,
|
|
8
|
-
CUSTOM_COVER_UPDATE_FIELDS,
|
|
9
|
-
LINK_COVER_PKS,
|
|
10
|
-
)
|
|
11
|
-
from codex.librarian.importer.create_comics import CreateComicsImporter
|
|
12
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
13
|
-
from codex.models import (
|
|
14
|
-
CustomCover,
|
|
15
|
-
)
|
|
16
|
-
from codex.status import Status
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class CreateCoversImporter(CreateComicsImporter):
|
|
20
|
-
"""Create Custom Covers."""
|
|
21
|
-
|
|
22
|
-
def update_custom_covers(self, status=None):
|
|
23
|
-
"""Update Custom Covers."""
|
|
24
|
-
update_covers_qs = self.metadata.pop(COVERS_UPDATE, None)
|
|
25
|
-
if not update_covers_qs:
|
|
26
|
-
return
|
|
27
|
-
update_covers_count = update_covers_qs.count()
|
|
28
|
-
if not update_covers_count:
|
|
29
|
-
return
|
|
30
|
-
status = Status(ImportStatusTypes.COVERS_MODIFIED, 0, update_covers_count)
|
|
31
|
-
self.status_controller.start(status)
|
|
32
|
-
|
|
33
|
-
update_covers = []
|
|
34
|
-
for cover in update_covers_qs.only(*CUSTOM_COVER_UPDATE_FIELDS):
|
|
35
|
-
cover.updated_at = Now()
|
|
36
|
-
cover.presave()
|
|
37
|
-
update_covers.append(cover)
|
|
38
|
-
|
|
39
|
-
count = 0
|
|
40
|
-
if update_covers:
|
|
41
|
-
CustomCover.objects.bulk_update(update_covers, CUSTOM_COVER_UPDATE_FIELDS)
|
|
42
|
-
update_cover_pks = update_covers_qs.values_list("pk", flat=True)
|
|
43
|
-
if LINK_COVER_PKS not in self.metadata:
|
|
44
|
-
self.metadata[LINK_COVER_PKS] = set()
|
|
45
|
-
self.metadata[LINK_COVER_PKS].update(update_cover_pks)
|
|
46
|
-
self._remove_covers(update_cover_pks, custom=True) # type: ignore
|
|
47
|
-
count = len(update_covers)
|
|
48
|
-
if status:
|
|
49
|
-
status.add_complete(count)
|
|
50
|
-
|
|
51
|
-
link_covers_status = Status(
|
|
52
|
-
ImportStatusTypes.COVERS_LINK, 0, len(self.metadata[LINK_COVER_PKS])
|
|
53
|
-
)
|
|
54
|
-
self.status_controller.update(link_covers_status, notify=False)
|
|
55
|
-
|
|
56
|
-
self.changed += count
|
|
57
|
-
self.status_controller.finish(status)
|
|
58
|
-
|
|
59
|
-
def create_custom_covers(self, status=None):
|
|
60
|
-
"""Create Custom Covers."""
|
|
61
|
-
create_cover_paths = self.metadata.pop(COVERS_CREATE, ())
|
|
62
|
-
num_create_cover_paths = len(create_cover_paths)
|
|
63
|
-
if not num_create_cover_paths:
|
|
64
|
-
return
|
|
65
|
-
status = Status(ImportStatusTypes.COVERS_MODIFIED, 0, num_create_cover_paths)
|
|
66
|
-
self.status_controller.start(status)
|
|
67
|
-
|
|
68
|
-
create_covers = []
|
|
69
|
-
for path in create_cover_paths:
|
|
70
|
-
cover = CustomCover(library=self.library, path=path)
|
|
71
|
-
cover.presave()
|
|
72
|
-
create_covers.append(cover)
|
|
73
|
-
|
|
74
|
-
count = 0
|
|
75
|
-
if create_covers:
|
|
76
|
-
objs = CustomCover.objects.bulk_create(
|
|
77
|
-
create_covers,
|
|
78
|
-
update_conflicts=True,
|
|
79
|
-
update_fields=("path", "stat"),
|
|
80
|
-
unique_fields=CustomCover._meta.unique_together[0],
|
|
81
|
-
)
|
|
82
|
-
created_pks = frozenset(obj.pk for obj in objs)
|
|
83
|
-
if LINK_COVER_PKS not in self.metadata:
|
|
84
|
-
self.metadata[LINK_COVER_PKS] = set()
|
|
85
|
-
self.metadata[LINK_COVER_PKS].update(created_pks)
|
|
86
|
-
count = len(created_pks)
|
|
87
|
-
if status:
|
|
88
|
-
status.add_complete(count)
|
|
89
|
-
|
|
90
|
-
link_covers_status = Status(
|
|
91
|
-
ImportStatusTypes.COVERS_LINK, 0, len(self.metadata[LINK_COVER_PKS])
|
|
92
|
-
)
|
|
93
|
-
self.status_controller.update(link_covers_status, notify=False)
|
|
94
|
-
|
|
95
|
-
self.changed += count
|
|
96
|
-
self.status_controller.finish(status)
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"""The main importer class."""
|
|
2
|
-
|
|
3
|
-
from time import time
|
|
4
|
-
|
|
5
|
-
from django.core.cache import cache
|
|
6
|
-
from humanize import naturaldelta
|
|
7
|
-
|
|
8
|
-
from codex.librarian.importer.moved import MovedImporter
|
|
9
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
10
|
-
from codex.librarian.notifier.tasks import FAILED_IMPORTS_TASK, LIBRARY_CHANGED_TASK
|
|
11
|
-
from codex.librarian.search.tasks import SearchIndexUpdateTask
|
|
12
|
-
from codex.librarian.tasks import DelayedTasks
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ComicImporter(MovedImporter):
|
|
16
|
-
"""Initialize, run and finish a bulk import."""
|
|
17
|
-
|
|
18
|
-
##########
|
|
19
|
-
# FINISH #
|
|
20
|
-
##########
|
|
21
|
-
def _finish_apply_status(self):
|
|
22
|
-
"""Finish all librarian statuses."""
|
|
23
|
-
self.library.update_in_progress = False
|
|
24
|
-
self.library.save()
|
|
25
|
-
self.status_controller.finish_many(ImportStatusTypes.values)
|
|
26
|
-
|
|
27
|
-
def _finish_apply(self, new_failed_imports, imported_count):
|
|
28
|
-
"""Perform final tasks when the apply is done."""
|
|
29
|
-
if self.changed:
|
|
30
|
-
cache.clear()
|
|
31
|
-
elapsed_time = time() - self.start_time.timestamp()
|
|
32
|
-
elapsed = naturaldelta(elapsed_time)
|
|
33
|
-
log_txt = f"Updated library {self.library.path} in {elapsed}."
|
|
34
|
-
if imported_count:
|
|
35
|
-
cps = round(imported_count / elapsed_time, 1)
|
|
36
|
-
log_txt += (
|
|
37
|
-
f" Imported {imported_count} comics at {cps} comics per second."
|
|
38
|
-
)
|
|
39
|
-
else:
|
|
40
|
-
log_txt += " No comics to import."
|
|
41
|
-
self.log.info(log_txt)
|
|
42
|
-
self.librarian_queue.put(LIBRARY_CHANGED_TASK)
|
|
43
|
-
|
|
44
|
-
# Wait to start the search index update in case more updates are incoming.
|
|
45
|
-
until = time() + 3
|
|
46
|
-
delayed_search_task = DelayedTasks(until, (SearchIndexUpdateTask(False),))
|
|
47
|
-
self.librarian_queue.put(delayed_search_task)
|
|
48
|
-
else:
|
|
49
|
-
self.log.info("No updates neccissary.")
|
|
50
|
-
if new_failed_imports:
|
|
51
|
-
self.librarian_queue.put(FAILED_IMPORTS_TASK)
|
|
52
|
-
|
|
53
|
-
def apply(self):
|
|
54
|
-
"""Bulk import comics."""
|
|
55
|
-
try:
|
|
56
|
-
self.init_apply()
|
|
57
|
-
self.move_and_modify_dirs()
|
|
58
|
-
|
|
59
|
-
#############
|
|
60
|
-
# AGGREGATE #
|
|
61
|
-
#############
|
|
62
|
-
self.get_aggregate_metadata()
|
|
63
|
-
|
|
64
|
-
#########
|
|
65
|
-
# QUERY #
|
|
66
|
-
#########
|
|
67
|
-
self.query_all_missing_fks()
|
|
68
|
-
self.query_missing_custom_covers()
|
|
69
|
-
|
|
70
|
-
#####################
|
|
71
|
-
# UPDATE AND CREATE #
|
|
72
|
-
#####################
|
|
73
|
-
self.create_all_fks()
|
|
74
|
-
self.update_custom_covers()
|
|
75
|
-
self.create_custom_covers()
|
|
76
|
-
|
|
77
|
-
imported_count = self.bulk_update_comics()
|
|
78
|
-
imported_count += self.bulk_create_comics()
|
|
79
|
-
|
|
80
|
-
########
|
|
81
|
-
# LINK #
|
|
82
|
-
########
|
|
83
|
-
self.bulk_query_and_link_comic_m2m_fields()
|
|
84
|
-
self.link_custom_covers()
|
|
85
|
-
self.changed += imported_count
|
|
86
|
-
|
|
87
|
-
new_failed_imports = self.fail_imports()
|
|
88
|
-
|
|
89
|
-
deleted_comic_groups = self.delete()
|
|
90
|
-
|
|
91
|
-
self.update_all_groups(deleted_comic_groups, self.start_time)
|
|
92
|
-
|
|
93
|
-
finally:
|
|
94
|
-
self._finish_apply_status()
|
|
95
|
-
|
|
96
|
-
self._finish_apply(new_failed_imports, imported_count)
|
codex/librarian/importer/init.py
DELETED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
"""Initiale Importer."""
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from time import sleep, time
|
|
6
|
-
from typing import Any
|
|
7
|
-
|
|
8
|
-
from django.utils.timezone import now
|
|
9
|
-
|
|
10
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
11
|
-
from codex.librarian.importer.tasks import ImportDBDiffTask
|
|
12
|
-
from codex.librarian.search.status import SearchIndexStatusTypes
|
|
13
|
-
from codex.librarian.search.tasks import SearchIndexAbortTask
|
|
14
|
-
from codex.models import Library
|
|
15
|
-
from codex.status import Status
|
|
16
|
-
from codex.worker_base import WorkerBaseMixin
|
|
17
|
-
|
|
18
|
-
_WRITE_WAIT_EXPIRY = 60
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class InitImporter(WorkerBaseMixin):
|
|
22
|
-
"""Initiale Importer."""
|
|
23
|
-
|
|
24
|
-
def __init__(self, task: ImportDBDiffTask, log_queue, librarian_queue):
|
|
25
|
-
"""Initialize the import."""
|
|
26
|
-
self.init_worker(log_queue, librarian_queue)
|
|
27
|
-
self.task: ImportDBDiffTask = task
|
|
28
|
-
self.metadata: dict[str, Any] = {}
|
|
29
|
-
self.changed: int = 0
|
|
30
|
-
self.library = Library.objects.only("path", "update_in_progress").get(
|
|
31
|
-
pk=self.task.library_id
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
def _wait_for_filesystem_ops_to_finish(self) -> bool:
|
|
35
|
-
"""Watchdog sends events before filesystem events finish, so wait for them."""
|
|
36
|
-
started_checking = time()
|
|
37
|
-
|
|
38
|
-
# Don't wait for deletes to complete.
|
|
39
|
-
# Do wait for move, modified, create files before import.
|
|
40
|
-
all_modified_paths = (
|
|
41
|
-
frozenset(self.task.dirs_moved.values())
|
|
42
|
-
| frozenset(self.task.files_moved.values())
|
|
43
|
-
| self.task.dirs_modified
|
|
44
|
-
| self.task.files_modified
|
|
45
|
-
| self.task.files_created
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
old_total_size = -1
|
|
49
|
-
total_size = 0
|
|
50
|
-
wait_time = 2
|
|
51
|
-
while old_total_size != total_size:
|
|
52
|
-
if old_total_size > 0:
|
|
53
|
-
# second time around or more
|
|
54
|
-
sleep(wait_time)
|
|
55
|
-
wait_time = wait_time**2
|
|
56
|
-
self.log.debug(
|
|
57
|
-
f"Waiting for files to copy before import: "
|
|
58
|
-
f"{old_total_size} != {total_size}"
|
|
59
|
-
)
|
|
60
|
-
if time() - started_checking > _WRITE_WAIT_EXPIRY:
|
|
61
|
-
return True
|
|
62
|
-
|
|
63
|
-
old_total_size = total_size
|
|
64
|
-
total_size = 0
|
|
65
|
-
for path_str in all_modified_paths:
|
|
66
|
-
path = Path(path_str)
|
|
67
|
-
if path.exists():
|
|
68
|
-
total_size += Path(path).stat().st_size
|
|
69
|
-
return False
|
|
70
|
-
|
|
71
|
-
#######
|
|
72
|
-
# LOG #
|
|
73
|
-
#######
|
|
74
|
-
def _log_task_construct_dirs_log(self):
|
|
75
|
-
"""Construct dirs log line."""
|
|
76
|
-
dirs_log = []
|
|
77
|
-
if self.task.dirs_moved:
|
|
78
|
-
dirs_log += [f"{len(self.task.dirs_moved)} moved"]
|
|
79
|
-
if self.task.dirs_modified:
|
|
80
|
-
dirs_log += [f"{len(self.task.dirs_modified)} modified"]
|
|
81
|
-
if self.task.dirs_deleted:
|
|
82
|
-
dirs_log += [f"{len(self.task.dirs_deleted)} deleted"]
|
|
83
|
-
return dirs_log
|
|
84
|
-
|
|
85
|
-
def _log_task_construct_comics_log(self):
|
|
86
|
-
"""Construct comcis log line."""
|
|
87
|
-
comics_log = []
|
|
88
|
-
if self.task.files_moved:
|
|
89
|
-
comics_log += [f"{len(self.task.files_moved)} moved"]
|
|
90
|
-
if self.task.files_modified:
|
|
91
|
-
comics_log += [f"{len(self.task.files_modified)} modified"]
|
|
92
|
-
if self.task.files_created:
|
|
93
|
-
comics_log += [f"{len(self.task.files_created)} created"]
|
|
94
|
-
if self.task.files_deleted:
|
|
95
|
-
comics_log += [f"{len(self.task.files_deleted)} deleted"]
|
|
96
|
-
return comics_log
|
|
97
|
-
|
|
98
|
-
def _log_task(self):
|
|
99
|
-
"""Log the watchdog event self.task."""
|
|
100
|
-
if self.log.getEffectiveLevel() < logging.DEBUG:
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
self.log.debug(f"Updating library {self.library.path}...")
|
|
104
|
-
comics_log = self._log_task_construct_comics_log()
|
|
105
|
-
if comics_log:
|
|
106
|
-
log = "Comics: "
|
|
107
|
-
log += ", ".join(comics_log)
|
|
108
|
-
self.log.debug(" " + log)
|
|
109
|
-
|
|
110
|
-
dirs_log = self._log_task_construct_dirs_log()
|
|
111
|
-
if dirs_log:
|
|
112
|
-
log = "Folders: "
|
|
113
|
-
log += ", ".join(dirs_log)
|
|
114
|
-
self.log.debug(" " + log)
|
|
115
|
-
|
|
116
|
-
########
|
|
117
|
-
# INIT #
|
|
118
|
-
########
|
|
119
|
-
def _init_librarian_status_moved(self, status_list):
|
|
120
|
-
"""Initialize moved statuses."""
|
|
121
|
-
search_index_updates = 0
|
|
122
|
-
if self.task.dirs_moved:
|
|
123
|
-
status_list += [
|
|
124
|
-
Status(ImportStatusTypes.DIRS_MOVED, None, len(self.task.dirs_moved))
|
|
125
|
-
]
|
|
126
|
-
if self.task.files_moved:
|
|
127
|
-
status_list += [
|
|
128
|
-
Status(ImportStatusTypes.FILES_MOVED, None, len(self.task.files_moved))
|
|
129
|
-
]
|
|
130
|
-
search_index_updates += len(self.task.files_moved)
|
|
131
|
-
if self.task.covers_moved:
|
|
132
|
-
status_list += [
|
|
133
|
-
Status(
|
|
134
|
-
ImportStatusTypes.COVERS_MOVED, None, len(self.task.covers_moved)
|
|
135
|
-
)
|
|
136
|
-
]
|
|
137
|
-
if self.task.dirs_modified:
|
|
138
|
-
status_list += [
|
|
139
|
-
Status(
|
|
140
|
-
ImportStatusTypes.DIRS_MODIFIED, None, len(self.task.dirs_modified)
|
|
141
|
-
)
|
|
142
|
-
]
|
|
143
|
-
return search_index_updates
|
|
144
|
-
|
|
145
|
-
def _init_if_modified_or_created(self, path, status_list):
|
|
146
|
-
"""Initialize librarian statuses for modified or created ops."""
|
|
147
|
-
total_paths = len(self.task.files_modified) + len(self.task.files_created)
|
|
148
|
-
status_list += [
|
|
149
|
-
Status(ImportStatusTypes.AGGREGATE_TAGS, 0, total_paths, subtitle=path),
|
|
150
|
-
Status(ImportStatusTypes.QUERY_MISSING_FKS),
|
|
151
|
-
Status(ImportStatusTypes.QUERY_MISSING_COVERS),
|
|
152
|
-
Status(ImportStatusTypes.CREATE_FKS),
|
|
153
|
-
]
|
|
154
|
-
if self.task.files_modified:
|
|
155
|
-
status_list += [
|
|
156
|
-
Status(
|
|
157
|
-
ImportStatusTypes.FILES_MODIFIED,
|
|
158
|
-
None,
|
|
159
|
-
len(self.task.files_modified),
|
|
160
|
-
)
|
|
161
|
-
]
|
|
162
|
-
if self.task.covers_modified:
|
|
163
|
-
status_list += [
|
|
164
|
-
Status(
|
|
165
|
-
ImportStatusTypes.COVERS_MODIFIED,
|
|
166
|
-
None,
|
|
167
|
-
len(self.task.covers_modified),
|
|
168
|
-
)
|
|
169
|
-
]
|
|
170
|
-
|
|
171
|
-
if self.task.files_created or self.task.covers_created:
|
|
172
|
-
status_list += [
|
|
173
|
-
Status(
|
|
174
|
-
ImportStatusTypes.FILES_CREATED, None, len(self.task.files_created)
|
|
175
|
-
)
|
|
176
|
-
]
|
|
177
|
-
if self.task.covers_created:
|
|
178
|
-
status_list += [
|
|
179
|
-
Status(
|
|
180
|
-
ImportStatusTypes.COVERS_CREATED,
|
|
181
|
-
None,
|
|
182
|
-
len(self.task.covers_created),
|
|
183
|
-
)
|
|
184
|
-
]
|
|
185
|
-
|
|
186
|
-
if self.task.files_modified or self.task.files_created:
|
|
187
|
-
status_list += [Status(ImportStatusTypes.LINK_M2M_FIELDS)]
|
|
188
|
-
|
|
189
|
-
num_covers_linked = (
|
|
190
|
-
len(self.task.covers_moved)
|
|
191
|
-
+ len(self.task.covers_modified)
|
|
192
|
-
+ len(self.task.covers_created)
|
|
193
|
-
)
|
|
194
|
-
if num_covers_linked:
|
|
195
|
-
status_list += [
|
|
196
|
-
Status(ImportStatusTypes.COVERS_LINK, None, num_covers_linked)
|
|
197
|
-
]
|
|
198
|
-
|
|
199
|
-
return total_paths
|
|
200
|
-
|
|
201
|
-
def _init_librarian_status_deleted(self, status_list):
|
|
202
|
-
"""Init deleted statuses."""
|
|
203
|
-
search_index_updates = 0
|
|
204
|
-
if self.task.files_deleted:
|
|
205
|
-
status_list += [
|
|
206
|
-
Status(
|
|
207
|
-
ImportStatusTypes.FILES_DELETED, None, len(self.task.files_deleted)
|
|
208
|
-
)
|
|
209
|
-
]
|
|
210
|
-
search_index_updates += len(self.task.files_deleted)
|
|
211
|
-
if self.task.covers_deleted:
|
|
212
|
-
status_list += [
|
|
213
|
-
Status(
|
|
214
|
-
ImportStatusTypes.COVERS_DELETED,
|
|
215
|
-
None,
|
|
216
|
-
len(self.task.covers_deleted),
|
|
217
|
-
)
|
|
218
|
-
]
|
|
219
|
-
return search_index_updates
|
|
220
|
-
|
|
221
|
-
@staticmethod
|
|
222
|
-
def _init_librarian_status_search_index(search_index_updates, status_list):
|
|
223
|
-
"""Init search index statuses."""
|
|
224
|
-
status_list += [
|
|
225
|
-
Status(
|
|
226
|
-
SearchIndexStatusTypes.SEARCH_INDEX_UPDATE,
|
|
227
|
-
0,
|
|
228
|
-
search_index_updates,
|
|
229
|
-
),
|
|
230
|
-
Status(SearchIndexStatusTypes.SEARCH_INDEX_REMOVE),
|
|
231
|
-
]
|
|
232
|
-
|
|
233
|
-
def _init_librarian_status(self, path):
|
|
234
|
-
"""Update the librarian status self.tasks."""
|
|
235
|
-
status_list = []
|
|
236
|
-
search_index_updates = 0
|
|
237
|
-
search_index_updates += self._init_librarian_status_moved(status_list)
|
|
238
|
-
if (
|
|
239
|
-
self.task.files_modified
|
|
240
|
-
or self.task.files_created
|
|
241
|
-
or self.task.covers_modified
|
|
242
|
-
or self.task.covers_created
|
|
243
|
-
):
|
|
244
|
-
search_index_updates += self._init_if_modified_or_created(path, status_list)
|
|
245
|
-
search_index_updates += self._init_librarian_status_deleted(status_list)
|
|
246
|
-
status_list += [Status(ImportStatusTypes.GROUP_UPDATE)]
|
|
247
|
-
self._init_librarian_status_search_index(search_index_updates, status_list)
|
|
248
|
-
self.status_controller.start_many(status_list)
|
|
249
|
-
|
|
250
|
-
def init_apply(self):
|
|
251
|
-
"""Initialize the library and status flags."""
|
|
252
|
-
self.start_time = now()
|
|
253
|
-
self.librarian_queue.put(SearchIndexAbortTask())
|
|
254
|
-
self.library.update_in_progress = True
|
|
255
|
-
self.library.save()
|
|
256
|
-
too_long = self._wait_for_filesystem_ops_to_finish()
|
|
257
|
-
if too_long:
|
|
258
|
-
self.log.warning(
|
|
259
|
-
"Import apply waited for the filesystem to stop changing too long. "
|
|
260
|
-
"Try polling again once files have finished copying"
|
|
261
|
-
f" in library: {self.library.path}"
|
|
262
|
-
)
|
|
263
|
-
return
|
|
264
|
-
self._log_task()
|
|
265
|
-
self._init_librarian_status(self.library.path)
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"""Link Covers."""
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
from codex.librarian.importer.const import CLASS_CUSTOM_COVER_GROUP_MAP, LINK_COVER_PKS
|
|
6
|
-
from codex.librarian.importer.failed_imports import FailedImportsImporter
|
|
7
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
8
|
-
from codex.models import CustomCover, Folder
|
|
9
|
-
from codex.status import Status
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class LinkCoversImporter(FailedImportsImporter):
|
|
13
|
-
"""Link Covers methods."""
|
|
14
|
-
|
|
15
|
-
def _link_custom_cover_prepare(self, cover, model_map):
|
|
16
|
-
"""Prepare one cover in the model map for bulk update."""
|
|
17
|
-
if cover.library and cover.library.covers_only:
|
|
18
|
-
model = CLASS_CUSTOM_COVER_GROUP_MAP.inverse.get(cover.group)
|
|
19
|
-
if not model:
|
|
20
|
-
self.log.warning(f"Custom Cover model not found for {cover.path}")
|
|
21
|
-
return
|
|
22
|
-
group_filter = {"sort_name": cover.sort_name}
|
|
23
|
-
else:
|
|
24
|
-
model = Folder
|
|
25
|
-
path = str(Path(cover.path).parent)
|
|
26
|
-
group_filter = {"path": path}
|
|
27
|
-
qs = model.objects.filter(**group_filter).exclude(custom_cover=cover)
|
|
28
|
-
if not qs.exists():
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
if model not in model_map:
|
|
32
|
-
model_map[model] = []
|
|
33
|
-
|
|
34
|
-
for obj in qs.iterator():
|
|
35
|
-
obj.custom_cover = cover
|
|
36
|
-
model_map[model].append(obj)
|
|
37
|
-
|
|
38
|
-
def _link_custom_cover_group(self, model, objs, status):
|
|
39
|
-
"""Bulk link a group to it's custom covers."""
|
|
40
|
-
count = 0
|
|
41
|
-
if not objs:
|
|
42
|
-
return count
|
|
43
|
-
model.objects.bulk_update(objs, ["custom_cover"])
|
|
44
|
-
count += len(objs)
|
|
45
|
-
self.log.info(f"Linked {count} custom covers to {model.__name__}s")
|
|
46
|
-
status.complete += count
|
|
47
|
-
self.status_controller.update(status, notify=False)
|
|
48
|
-
return count
|
|
49
|
-
|
|
50
|
-
def link_custom_covers(self):
|
|
51
|
-
"""Link Custom Covers to Groups."""
|
|
52
|
-
link_cover_pks = self.metadata.get(LINK_COVER_PKS, {})
|
|
53
|
-
num_link_cover_pks = len(link_cover_pks)
|
|
54
|
-
if not num_link_cover_pks:
|
|
55
|
-
return 0
|
|
56
|
-
status = Status(ImportStatusTypes.COVERS_LINK, 0, num_link_cover_pks)
|
|
57
|
-
try:
|
|
58
|
-
self.status_controller.start(status)
|
|
59
|
-
# Aggregate objs to update for each group model.
|
|
60
|
-
model_map = {}
|
|
61
|
-
covers = CustomCover.objects.filter(pk__in=link_cover_pks).only(
|
|
62
|
-
"library", "path"
|
|
63
|
-
)
|
|
64
|
-
for cover in covers:
|
|
65
|
-
self._link_custom_cover_prepare(cover, model_map)
|
|
66
|
-
|
|
67
|
-
# Bulk update each model type
|
|
68
|
-
total_count = 0
|
|
69
|
-
for model, objs in model_map.items():
|
|
70
|
-
total_count += self._link_custom_cover_group(model, objs, status)
|
|
71
|
-
finally:
|
|
72
|
-
self.status_controller.finish(status)
|
|
73
|
-
return total_count
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"""Query Missing Custom Covers."""
|
|
2
|
-
|
|
3
|
-
from codex.librarian.importer.const import (
|
|
4
|
-
COVERS_CREATE,
|
|
5
|
-
COVERS_UPDATE,
|
|
6
|
-
)
|
|
7
|
-
from codex.librarian.importer.create_fks import CreateForeignKeysImporter
|
|
8
|
-
from codex.librarian.importer.status import ImportStatusTypes
|
|
9
|
-
from codex.logger.logging import get_logger
|
|
10
|
-
from codex.models.paths import CustomCover
|
|
11
|
-
from codex.status import Status
|
|
12
|
-
|
|
13
|
-
LOG = get_logger(__name__)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class QueryCustomCoversImporter(CreateForeignKeysImporter):
|
|
17
|
-
"""Query Missing Custom Covers."""
|
|
18
|
-
|
|
19
|
-
def query_missing_custom_covers(self):
|
|
20
|
-
"""Identify update & create covers."""
|
|
21
|
-
cover_paths = self.task.covers_created | self.task.covers_modified
|
|
22
|
-
num_cover_paths = len(cover_paths)
|
|
23
|
-
if not num_cover_paths:
|
|
24
|
-
return
|
|
25
|
-
self.log.debug(f"Querying {num_cover_paths} custom cover_paths")
|
|
26
|
-
status = Status(ImportStatusTypes.QUERY_MISSING_COVERS, None, num_cover_paths)
|
|
27
|
-
self.status_controller.start(status)
|
|
28
|
-
|
|
29
|
-
update_covers_qs = CustomCover.objects.filter(
|
|
30
|
-
library=self.library, path__in=cover_paths
|
|
31
|
-
)
|
|
32
|
-
self.metadata[COVERS_UPDATE] = update_covers_qs
|
|
33
|
-
update_cover_paths = frozenset(update_covers_qs.values_list("path", flat=True))
|
|
34
|
-
update_count = len(update_cover_paths)
|
|
35
|
-
update_status = Status(ImportStatusTypes.COVERS_MODIFIED, 0, update_count)
|
|
36
|
-
self.status_controller.update(update_status, notify=False)
|
|
37
|
-
|
|
38
|
-
create_cover_paths = cover_paths - update_cover_paths
|
|
39
|
-
self.metadata[COVERS_CREATE] = create_cover_paths
|
|
40
|
-
create_count = len(create_cover_paths)
|
|
41
|
-
create_status = Status(ImportStatusTypes.COVERS_CREATED, 0, create_count)
|
|
42
|
-
self.status_controller.update(create_status, notify=False)
|
|
43
|
-
|
|
44
|
-
self.task.covers_created = self.task.covers_modified = frozenset()
|
|
45
|
-
|
|
46
|
-
count = create_count + update_count
|
|
47
|
-
if count:
|
|
48
|
-
self.log.debug(
|
|
49
|
-
f"Discovered {update_count} custom covers to update and {create_count} to create."
|
|
50
|
-
)
|
|
51
|
-
self.status_controller.finish(status)
|
|
52
|
-
return
|