codex 1.6.0a6__py3-none-any.whl → 1.6.0a8__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 +1 -0
- codex/integrity.py +4 -4
- codex/librarian/importer/{aggregate_metadata.py → aggregate.py} +56 -86
- codex/librarian/importer/cache.py +180 -0
- codex/librarian/importer/const.py +15 -6
- codex/librarian/importer/create_comics.py +102 -17
- codex/librarian/importer/create_covers.py +98 -0
- codex/librarian/importer/create_fks.py +73 -170
- codex/librarian/importer/deleted.py +59 -46
- codex/librarian/importer/{clean_metadata.py → extract.py} +33 -4
- codex/librarian/importer/failed_imports.py +41 -62
- codex/librarian/importer/importer.py +96 -0
- codex/librarian/importer/importerd.py +71 -395
- codex/librarian/importer/init.py +265 -0
- codex/librarian/importer/link_comics.py +26 -81
- codex/librarian/importer/link_covers.py +73 -0
- codex/librarian/importer/moved.py +72 -96
- codex/librarian/importer/query_covers.py +52 -0
- codex/librarian/importer/query_fks.py +128 -172
- codex/librarian/importer/status.py +2 -39
- codex/librarian/importer/tasks.py +22 -13
- codex/librarian/janitor/cleanup.py +2 -2
- codex/librarian/janitor/janitor.py +11 -1
- codex/librarian/librariand.py +8 -2
- codex/migrations/0027_import_order_and_covers.py +345 -0
- codex/models/comic.py +1 -2
- codex/models/groups.py +3 -2
- codex/models/paths.py +0 -1
- codex/permissions.py +1 -1
- codex/search/query.py +25 -2
- codex/search/writing.py +1 -1
- codex/serializers/admin.py +1 -2
- codex/serializers/browser/filters.py +8 -101
- codex/serializers/browser/mixins.py +2 -3
- codex/serializers/browser/page.py +2 -2
- codex/serializers/browser/settings.py +4 -3
- codex/serializers/choices.py +10 -1
- codex/serializers/fields.py +123 -0
- codex/serializers/mtime.py +25 -0
- codex/serializers/opds/v2.py +7 -11
- codex/serializers/opds/v2_unused.py +5 -3
- codex/serializers/reader.py +5 -2
- codex/serializers/route.py +7 -3
- codex/settings/settings.py +2 -2
- codex/static_root/assets/VCheckbox-DI-DgMb4.8eeb1bd3e18b.js +1 -0
- codex/static_root/assets/VCheckbox-DI-DgMb4.8eeb1bd3e18b.js.br +0 -0
- codex/static_root/assets/VCheckbox-DI-DgMb4.8eeb1bd3e18b.js.gz +0 -0
- codex/static_root/assets/VCheckbox-DI-DgMb4.js +1 -0
- codex/static_root/assets/VCheckbox-DI-DgMb4.js.br +0 -0
- codex/static_root/assets/VCheckbox-DI-DgMb4.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-m4IbdjEe.f0c4a814ded8.js → VCheckboxBtn-B8Z4NA-t.3d8921f98ad9.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-B8Z4NA-t.3d8921f98ad9.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B8Z4NA-t.3d8921f98ad9.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-m4IbdjEe.js → VCheckboxBtn-B8Z4NA-t.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-B8Z4NA-t.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B8Z4NA-t.js.gz +0 -0
- codex/static_root/assets/VCombobox-D1_0lCri.6ef85a29c2dc.js +1 -0
- codex/static_root/assets/VCombobox-D1_0lCri.6ef85a29c2dc.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_0lCri.6ef85a29c2dc.js.gz +0 -0
- codex/static_root/assets/VCombobox-D1_0lCri.js +1 -0
- codex/static_root/assets/VCombobox-D1_0lCri.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_0lCri.js.gz +0 -0
- codex/static_root/assets/VDialog-opmV0YZz.d77216e97599.js +1 -0
- codex/static_root/assets/VDialog-opmV0YZz.d77216e97599.js.br +0 -0
- codex/static_root/assets/VDialog-opmV0YZz.d77216e97599.js.gz +0 -0
- codex/static_root/assets/VDialog-opmV0YZz.js +1 -0
- codex/static_root/assets/VDialog-opmV0YZz.js.br +0 -0
- codex/static_root/assets/VDialog-opmV0YZz.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.ecc2ebfa62ec.js +1 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.ecc2ebfa62ec.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.ecc2ebfa62ec.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.js +1 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-DX2dhUf5.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.d1a3ad7266bd.js +1 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.d1a3ad7266bd.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.d1a3ad7266bd.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.js +1 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BGa6_q5a.js.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.gz +0 -0
- codex/static_root/assets/VSelect-sIYW_-ud.7d40da0ec3ff.js +1 -0
- codex/static_root/assets/VSelect-sIYW_-ud.7d40da0ec3ff.js.br +0 -0
- codex/static_root/assets/VSelect-sIYW_-ud.7d40da0ec3ff.js.gz +0 -0
- codex/static_root/assets/VSelect-sIYW_-ud.js +1 -0
- codex/static_root/assets/VSelect-sIYW_-ud.js.br +0 -0
- codex/static_root/assets/VSelect-sIYW_-ud.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.ef80e8e3dfc1.js +1 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.ef80e8e3dfc1.js.br +0 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.ef80e8e3dfc1.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.js +1 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.js.br +0 -0
- codex/static_root/assets/VSelectionControl-C8DP9rgp.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.3534ec94b2f1.js +1 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.3534ec94b2f1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.3534ec94b2f1.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.js +1 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BRYhkLH8.js.gz +0 -0
- codex/static_root/assets/{VTable-C0gAriFq.fa6e4b60d4ef.js → VTable-D1esKtlw.52165930e3b9.js} +1 -1
- codex/static_root/assets/VTable-D1esKtlw.52165930e3b9.js.br +0 -0
- codex/static_root/assets/VTable-D1esKtlw.52165930e3b9.js.gz +0 -0
- codex/static_root/assets/{VTable-C0gAriFq.js → VTable-D1esKtlw.js} +1 -1
- codex/static_root/assets/VTable-D1esKtlw.js.br +0 -0
- codex/static_root/assets/VTable-D1esKtlw.js.gz +0 -0
- codex/static_root/assets/VTextField-BnGscKcY.54032adf3a4b.js +1 -0
- codex/static_root/assets/VTextField-BnGscKcY.54032adf3a4b.js.br +0 -0
- codex/static_root/assets/VTextField-BnGscKcY.54032adf3a4b.js.gz +0 -0
- codex/static_root/assets/VTextField-BnGscKcY.js +1 -0
- codex/static_root/assets/VTextField-BnGscKcY.js.br +0 -0
- codex/static_root/assets/VTextField-BnGscKcY.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-CFhKCj49.b2458002a937.js → VWindowItem-B0KokcAk.ea94224aecb9.js} +1 -1
- codex/static_root/assets/VWindowItem-B0KokcAk.ea94224aecb9.js.br +0 -0
- codex/static_root/assets/VWindowItem-B0KokcAk.ea94224aecb9.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-CFhKCj49.js → VWindowItem-B0KokcAk.js} +1 -1
- codex/static_root/assets/VWindowItem-B0KokcAk.js.br +0 -0
- codex/static_root/assets/VWindowItem-B0KokcAk.js.gz +0 -0
- codex/static_root/assets/admin-Y0bL21AB.42d4f0d68163.js +1 -0
- codex/static_root/assets/admin-Y0bL21AB.42d4f0d68163.js.br +0 -0
- codex/static_root/assets/admin-Y0bL21AB.42d4f0d68163.js.gz +0 -0
- codex/static_root/assets/admin-Y0bL21AB.js +1 -0
- codex/static_root/assets/admin-Y0bL21AB.js.br +0 -0
- codex/static_root/assets/admin-Y0bL21AB.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.4e992e3fe86e.js +30 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.4e992e3fe86e.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.4e992e3fe86e.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.js +30 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DNngWUEM.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BHdNPwzF.bd2c1d6148bb.css → admin-drawer-panel-o87BwD38.ce39427c8201.css} +1 -1
- codex/static_root/assets/admin-drawer-panel-o87BwD38.ce39427c8201.css.br +0 -0
- codex/static_root/assets/{admin-drawer-panel-BHdNPwzF.bd2c1d6148bb.css.gz → admin-drawer-panel-o87BwD38.ce39427c8201.css.gz} +0 -0
- codex/static_root/assets/{admin-drawer-panel-BHdNPwzF.css → admin-drawer-panel-o87BwD38.css} +1 -1
- codex/static_root/assets/admin-drawer-panel-o87BwD38.css.br +0 -0
- codex/static_root/assets/{admin-drawer-panel-BHdNPwzF.css.gz → admin-drawer-panel-o87BwD38.css.gz} +0 -0
- codex/static_root/assets/browser-CMAtBCLx.17a277ce43a9.css +1 -0
- codex/static_root/assets/browser-CMAtBCLx.17a277ce43a9.css.br +0 -0
- codex/static_root/assets/browser-CMAtBCLx.17a277ce43a9.css.gz +0 -0
- codex/static_root/assets/browser-CMAtBCLx.css +1 -0
- codex/static_root/assets/browser-CMAtBCLx.css.br +0 -0
- codex/static_root/assets/browser-CMAtBCLx.css.gz +0 -0
- codex/static_root/assets/browser-DoJk8uvb.2c97a3858932.js +1 -0
- codex/static_root/assets/browser-DoJk8uvb.2c97a3858932.js.br +0 -0
- codex/static_root/assets/browser-DoJk8uvb.2c97a3858932.js.gz +0 -0
- codex/static_root/assets/browser-DoJk8uvb.js +1 -0
- codex/static_root/assets/browser-DoJk8uvb.js.br +0 -0
- codex/static_root/assets/browser-DoJk8uvb.js.gz +0 -0
- codex/static_root/assets/{change-password-dialog-JYM9aAR9.js → change-password-dialog-CH4xbjJa.b749aa6ea07e.js} +1 -1
- codex/static_root/assets/change-password-dialog-CH4xbjJa.b749aa6ea07e.js.br +0 -0
- codex/static_root/assets/change-password-dialog-CH4xbjJa.b749aa6ea07e.js.gz +0 -0
- codex/static_root/assets/{change-password-dialog-JYM9aAR9.f71d378f4fa6.js → change-password-dialog-CH4xbjJa.js} +1 -1
- codex/static_root/assets/change-password-dialog-CH4xbjJa.js.br +0 -0
- codex/static_root/assets/change-password-dialog-CH4xbjJa.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-ZAZ6P1Rc.515858dd21e8.js → confirm-dialog-DkU0twE6.a20006aa5ba6.js} +1 -1
- codex/static_root/assets/confirm-dialog-DkU0twE6.a20006aa5ba6.js.br +0 -0
- codex/static_root/assets/confirm-dialog-DkU0twE6.a20006aa5ba6.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-ZAZ6P1Rc.js → confirm-dialog-DkU0twE6.js} +1 -1
- codex/static_root/assets/confirm-dialog-DkU0twE6.js.br +0 -0
- codex/static_root/assets/confirm-dialog-DkU0twE6.js.gz +0 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.bec27f144aca.js +1 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.bec27f144aca.js.br +0 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.js +1 -0
- codex/static_root/assets/copy-to-clipboard-DoUvDJVx.js.br +0 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.6a614321a435.js +1 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.6a614321a435.js.br +0 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.6a614321a435.js.gz +0 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.js +1 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.js.br +0 -0
- codex/static_root/assets/datetime-column-BfW_j_3Q.js.gz +0 -0
- codex/static_root/assets/datetime-column-DeCthByU.1f3bf499e063.css +1 -0
- codex/static_root/assets/datetime-column-DeCthByU.css +1 -0
- codex/static_root/assets/filter-DjxN78cK.35673f6e49b1.js +1 -0
- codex/static_root/assets/filter-DjxN78cK.35673f6e49b1.js.br +0 -0
- codex/static_root/assets/filter-DjxN78cK.35673f6e49b1.js.gz +0 -0
- codex/static_root/assets/filter-DjxN78cK.js +1 -0
- codex/static_root/assets/filter-DjxN78cK.js.br +0 -0
- codex/static_root/assets/filter-DjxN78cK.js.gz +0 -0
- codex/static_root/assets/{flag-tab-Ci_XcDT0.a5ea640a08d6.js → flag-tab-D4ZNSbMR.e763a9937701.js} +1 -1
- codex/static_root/assets/flag-tab-D4ZNSbMR.e763a9937701.js.br +0 -0
- codex/static_root/assets/flag-tab-D4ZNSbMR.e763a9937701.js.gz +0 -0
- codex/static_root/assets/{flag-tab-Ci_XcDT0.js → flag-tab-D4ZNSbMR.js} +1 -1
- codex/static_root/assets/flag-tab-D4ZNSbMR.js.br +0 -0
- codex/static_root/assets/flag-tab-D4ZNSbMR.js.gz +0 -0
- codex/static_root/assets/{group-tab-DFma2R-E.879c37b15bbd.js → group-tab-DucpNoBs.a6f37ae940c0.js} +1 -1
- codex/static_root/assets/group-tab-DucpNoBs.a6f37ae940c0.js.br +0 -0
- codex/static_root/assets/group-tab-DucpNoBs.a6f37ae940c0.js.gz +0 -0
- codex/static_root/assets/{group-tab-DFma2R-E.js → group-tab-DucpNoBs.js} +1 -1
- codex/static_root/assets/group-tab-DucpNoBs.js.br +0 -0
- codex/static_root/assets/group-tab-DucpNoBs.js.gz +0 -0
- codex/static_root/assets/http-error-Cj0hTq-c.062a88ddd4dc.js +1 -0
- codex/static_root/assets/http-error-Cj0hTq-c.062a88ddd4dc.js.br +0 -0
- codex/static_root/assets/http-error-Cj0hTq-c.062a88ddd4dc.js.gz +0 -0
- codex/static_root/assets/http-error-Cj0hTq-c.js +1 -0
- codex/static_root/assets/http-error-Cj0hTq-c.js.br +0 -0
- codex/static_root/assets/http-error-Cj0hTq-c.js.gz +0 -0
- codex/static_root/assets/{library-tab-V8DUGoHN.js → library-tab-CzksdS3Q.566acdb45dec.js} +1 -1
- codex/static_root/assets/library-tab-CzksdS3Q.566acdb45dec.js.br +0 -0
- codex/static_root/assets/library-tab-CzksdS3Q.566acdb45dec.js.gz +0 -0
- codex/static_root/assets/{library-tab-V8DUGoHN.809c548ff347.js → library-tab-CzksdS3Q.js} +1 -1
- codex/static_root/assets/library-tab-CzksdS3Q.js.br +0 -0
- codex/static_root/assets/library-tab-CzksdS3Q.js.gz +0 -0
- codex/static_root/assets/main-DX-k2724.f73d08e9ad64.js +32 -0
- codex/static_root/assets/main-DX-k2724.f73d08e9ad64.js.br +0 -0
- codex/static_root/assets/main-DX-k2724.f73d08e9ad64.js.gz +0 -0
- codex/static_root/assets/main-DX-k2724.js +32 -0
- codex/static_root/assets/main-DX-k2724.js.br +0 -0
- codex/static_root/assets/main-DX-k2724.js.gz +0 -0
- codex/static_root/assets/{main-sK7HC5h4.css → main-Ztp855PW.css} +1 -1
- codex/static_root/assets/main-Ztp855PW.css.br +0 -0
- codex/static_root/assets/{main-sK7HC5h4.css.gz → main-Ztp855PW.css.gz} +0 -0
- codex/static_root/assets/{main-sK7HC5h4.6f04ddfc5f1a.css → main-Ztp855PW.d46d718fac45.css} +1 -1
- codex/static_root/assets/main-Ztp855PW.d46d718fac45.css.br +0 -0
- codex/static_root/assets/{main-sK7HC5h4.6f04ddfc5f1a.css.gz → main-Ztp855PW.d46d718fac45.css.gz} +0 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.7a2d33ed8c39.js +1 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.7a2d33ed8c39.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.7a2d33ed8c39.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.js +1 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CQcR0a3T.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.css +1 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.f98f47e87612.css +1 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.f98f47e87612.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DWdp_kmz.f98f47e87612.css.gz +0 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.ef24c859a7a4.js +305 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.ef24c859a7a4.js.br +0 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.ef24c859a7a4.js.gz +0 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.js +305 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.js.br +0 -0
- codex/static_root/assets/pdf-doc-GkMk4o5L.js.gz +0 -0
- codex/static_root/assets/reader-CCCfpM3x.1553e45bd775.css +1 -0
- codex/static_root/assets/reader-CCCfpM3x.1553e45bd775.css.br +0 -0
- codex/static_root/assets/reader-CCCfpM3x.1553e45bd775.css.gz +0 -0
- codex/static_root/assets/reader-CCCfpM3x.css +1 -0
- codex/static_root/assets/reader-CCCfpM3x.css.br +0 -0
- codex/static_root/assets/reader-CCCfpM3x.css.gz +0 -0
- codex/static_root/assets/reader-Cl6mmQB_.7b9e7591954f.js +2 -0
- codex/static_root/assets/reader-Cl6mmQB_.7b9e7591954f.js.br +0 -0
- codex/static_root/assets/reader-Cl6mmQB_.7b9e7591954f.js.gz +0 -0
- codex/static_root/assets/reader-Cl6mmQB_.js +2 -0
- codex/static_root/assets/reader-Cl6mmQB_.js.br +0 -0
- codex/static_root/assets/reader-Cl6mmQB_.js.gz +0 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.d4232f3c2518.js +1 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.d4232f3c2518.js.br +0 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.d4232f3c2518.js.gz +0 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.js +1 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.js.br +0 -0
- codex/static_root/assets/relation-chips-CZ8VvR4y.js.gz +0 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.17a98928589f.js +2 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.17a98928589f.js.br +0 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.17a98928589f.js.gz +0 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.js +2 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.js.br +0 -0
- codex/static_root/assets/settings-drawer-DyS0A2pN.js.gz +0 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.70fa09a67518.js +1 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.70fa09a67518.js.br +0 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.70fa09a67518.js.gz +0 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.js +1 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.js.br +0 -0
- codex/static_root/assets/stats-tab-R3Ekobfm.js.gz +0 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.28ff51b3ed01.js +1 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.28ff51b3ed01.js.br +0 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.28ff51b3ed01.js.gz +0 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.js +1 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.js.br +0 -0
- codex/static_root/assets/task-tab-BhLDK_7Q.js.gz +0 -0
- codex/static_root/assets/to-case-BR2frjFx.87de5d7a0503.js +1 -0
- codex/static_root/assets/to-case-BR2frjFx.js +1 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.d48912d34a68.js +1 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.d48912d34a68.js.br +0 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.d48912d34a68.js.gz +0 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.js +1 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.js.br +0 -0
- codex/static_root/assets/unauthorized-BbXjAe5l.js.gz +0 -0
- codex/static_root/assets/user-tab-DxITIl2d.d79d7f062930.js +1 -0
- codex/static_root/assets/user-tab-DxITIl2d.d79d7f062930.js.br +0 -0
- codex/static_root/assets/user-tab-DxITIl2d.d79d7f062930.js.gz +0 -0
- codex/static_root/assets/user-tab-DxITIl2d.js +1 -0
- codex/static_root/assets/user-tab-DxITIl2d.js.br +0 -0
- codex/static_root/assets/user-tab-DxITIl2d.js.gz +0 -0
- codex/static_root/js/choices-admin.d790df01c20a.json +1 -0
- codex/static_root/js/choices-admin.d790df01c20a.json.br +0 -0
- codex/static_root/js/choices-admin.d790df01c20a.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.a0aaaa6c7ef7.json +1 -0
- codex/static_root/js/choices.a0aaaa6c7ef7.json.br +0 -0
- codex/static_root/js/choices.a0aaaa6c7ef7.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.16d52597ef50.json +629 -0
- codex/static_root/manifest.16d52597ef50.json.br +0 -0
- codex/static_root/manifest.16d52597ef50.json.gz +0 -0
- codex/static_root/manifest.json +275 -288
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/urls/api/auth.py +2 -1
- codex/urls/api/browser.py +13 -4
- codex/urls/api/reader.py +3 -9
- codex/urls/api/v3.py +2 -0
- codex/urls/opds/binary.py +1 -1
- codex/util.py +10 -0
- codex/views/admin/api_key.py +2 -6
- codex/views/admin/auth.py +28 -0
- codex/views/admin/flag.py +2 -7
- codex/views/admin/group.py +2 -6
- codex/views/admin/library.py +7 -20
- codex/views/admin/stats.py +7 -66
- codex/views/admin/tasks.py +24 -11
- codex/views/admin/user.py +3 -9
- codex/views/auth.py +30 -53
- codex/views/bookmark.py +7 -11
- codex/views/browser/{browser_annotations.py → annotations.py} +90 -181
- codex/views/browser/base.py +23 -88
- codex/views/browser/breadcrumbs.py +202 -0
- codex/views/browser/browser.py +64 -342
- codex/views/browser/choices.py +22 -54
- codex/views/browser/cover.py +177 -0
- codex/views/browser/filters/annotations.py +24 -23
- codex/views/browser/filters/bookmark.py +9 -13
- codex/views/browser/filters/field.py +5 -5
- codex/views/browser/filters/group.py +18 -10
- codex/views/browser/filters/search.py +30 -18
- codex/views/browser/metadata.py +22 -31
- codex/views/browser/{browser_order_by.py → order_by.py} +2 -6
- codex/views/browser/paginate.py +106 -0
- codex/views/browser/{session.py → settings.py} +4 -3
- codex/views/browser/title.py +48 -0
- codex/views/browser/validate.py +158 -0
- codex/views/const.py +109 -0
- codex/views/download.py +5 -8
- codex/views/frontend.py +4 -2
- codex/views/mtime.py +72 -0
- codex/views/opds/auth.py +17 -0
- codex/views/opds/authentication_v1.py +46 -45
- codex/views/opds/binary.py +5 -10
- codex/views/opds/const.py +13 -0
- codex/views/opds/urls.py +6 -4
- codex/views/opds/util.py +4 -12
- codex/views/opds/v1/entry/links.py +18 -33
- codex/views/opds/v1/facets.py +7 -7
- codex/views/opds/v1/feed.py +52 -40
- codex/views/opds/v1/links.py +7 -5
- codex/views/opds/v1/opensearch_v1.py +2 -6
- codex/views/opds/v2/feed.py +22 -23
- codex/views/opds/v2/links.py +4 -2
- codex/views/opds/v2/publications.py +34 -54
- codex/views/opds/v2/top_links.py +2 -2
- codex/views/public.py +36 -0
- codex/views/reader/arcs.py +101 -0
- codex/views/reader/books.py +199 -0
- codex/views/reader/page.py +3 -7
- codex/views/reader/reader.py +56 -301
- codex/views/reader/{session.py → settings.py} +4 -2
- codex/views/session.py +77 -103
- codex/views/settings.py +34 -0
- codex/views/template.py +3 -3
- codex/views/util.py +63 -0
- codex/views/version.py +2 -2
- {codex-1.6.0a6.dist-info → codex-1.6.0a8.dist-info}/METADATA +19 -14
- {codex-1.6.0a6.dist-info → codex-1.6.0a8.dist-info}/RECORD +373 -362
- codex/librarian/importer/covers.py +0 -47
- codex/librarian/importer/update_comics.py +0 -85
- codex/migrations/0027_sort_name.py +0 -139
- codex/migrations/0028_custom_covers.py +0 -166
- codex/migrations/0029_choices_adminflag_and_timestamp.py +0 -44
- codex/static_root/assets/VCheckbox-BS5fdM4M.a5d446e4aeb3.js +0 -1
- codex/static_root/assets/VCheckbox-BS5fdM4M.a5d446e4aeb3.js.br +0 -0
- codex/static_root/assets/VCheckbox-BS5fdM4M.a5d446e4aeb3.js.gz +0 -0
- codex/static_root/assets/VCheckbox-BS5fdM4M.js +0 -1
- codex/static_root/assets/VCheckbox-BS5fdM4M.js.br +0 -0
- codex/static_root/assets/VCheckbox-BS5fdM4M.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-m4IbdjEe.f0c4a814ded8.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-m4IbdjEe.f0c4a814ded8.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-m4IbdjEe.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-m4IbdjEe.js.gz +0 -0
- codex/static_root/assets/VCombobox-jg7SI5mn.af66f18b4c54.js +0 -1
- codex/static_root/assets/VCombobox-jg7SI5mn.af66f18b4c54.js.br +0 -0
- codex/static_root/assets/VCombobox-jg7SI5mn.af66f18b4c54.js.gz +0 -0
- codex/static_root/assets/VCombobox-jg7SI5mn.js +0 -1
- codex/static_root/assets/VCombobox-jg7SI5mn.js.br +0 -0
- codex/static_root/assets/VCombobox-jg7SI5mn.js.gz +0 -0
- codex/static_root/assets/VDialog-DiixpkQL.f84fd1fd1f84.js +0 -1
- codex/static_root/assets/VDialog-DiixpkQL.f84fd1fd1f84.js.br +0 -0
- codex/static_root/assets/VDialog-DiixpkQL.f84fd1fd1f84.js.gz +0 -0
- codex/static_root/assets/VDialog-DiixpkQL.js +0 -1
- codex/static_root/assets/VDialog-DiixpkQL.js.br +0 -0
- codex/static_root/assets/VDialog-DiixpkQL.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Db5mPFue.56d0ad094a62.js +0 -1
- codex/static_root/assets/VExpansionPanels-Db5mPFue.56d0ad094a62.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Db5mPFue.56d0ad094a62.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Db5mPFue.js +0 -1
- codex/static_root/assets/VExpansionPanels-Db5mPFue.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Db5mPFue.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DULWiMSI.4ae535e01d2b.js +0 -1
- codex/static_root/assets/VRadioGroup-DULWiMSI.4ae535e01d2b.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DULWiMSI.4ae535e01d2b.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DULWiMSI.js +0 -1
- codex/static_root/assets/VRadioGroup-DULWiMSI.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DULWiMSI.js.gz +0 -0
- codex/static_root/assets/VSelect-BnoCfCLY.4d50fd11c77c.js +0 -1
- codex/static_root/assets/VSelect-BnoCfCLY.4d50fd11c77c.js.br +0 -0
- codex/static_root/assets/VSelect-BnoCfCLY.4d50fd11c77c.js.gz +0 -0
- codex/static_root/assets/VSelect-BnoCfCLY.js +0 -1
- codex/static_root/assets/VSelect-BnoCfCLY.js.br +0 -0
- codex/static_root/assets/VSelect-BnoCfCLY.js.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-BSL0qeL9.5b5835d286df.js +0 -1
- codex/static_root/assets/VSelectionControl-BSL0qeL9.5b5835d286df.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BSL0qeL9.5b5835d286df.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-BSL0qeL9.js +0 -1
- codex/static_root/assets/VSelectionControl-BSL0qeL9.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BSL0qeL9.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BQtz8h9p.ff97dbf209e1.js +0 -1
- codex/static_root/assets/VSlideGroup-BQtz8h9p.ff97dbf209e1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BQtz8h9p.ff97dbf209e1.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BQtz8h9p.js +0 -1
- codex/static_root/assets/VSlideGroup-BQtz8h9p.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BQtz8h9p.js.gz +0 -0
- codex/static_root/assets/VTable-C0gAriFq.fa6e4b60d4ef.js.br +0 -0
- codex/static_root/assets/VTable-C0gAriFq.fa6e4b60d4ef.js.gz +0 -0
- codex/static_root/assets/VTable-C0gAriFq.js.br +0 -0
- codex/static_root/assets/VTable-C0gAriFq.js.gz +0 -0
- codex/static_root/assets/VTextField-Da_Hs7ls.c295f24c251e.js +0 -1
- codex/static_root/assets/VTextField-Da_Hs7ls.c295f24c251e.js.br +0 -0
- codex/static_root/assets/VTextField-Da_Hs7ls.c295f24c251e.js.gz +0 -0
- codex/static_root/assets/VTextField-Da_Hs7ls.js +0 -1
- codex/static_root/assets/VTextField-Da_Hs7ls.js.br +0 -0
- codex/static_root/assets/VTextField-Da_Hs7ls.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CFhKCj49.b2458002a937.js.br +0 -0
- codex/static_root/assets/VWindowItem-CFhKCj49.b2458002a937.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CFhKCj49.js.br +0 -0
- codex/static_root/assets/VWindowItem-CFhKCj49.js.gz +0 -0
- codex/static_root/assets/admin-BpGFsvOH.d7193c78d0dd.js +0 -1
- codex/static_root/assets/admin-BpGFsvOH.d7193c78d0dd.js.br +0 -0
- codex/static_root/assets/admin-BpGFsvOH.d7193c78d0dd.js.gz +0 -0
- codex/static_root/assets/admin-BpGFsvOH.js +0 -1
- codex/static_root/assets/admin-BpGFsvOH.js.br +0 -0
- codex/static_root/assets/admin-BpGFsvOH.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BHdNPwzF.bd2c1d6148bb.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BHdNPwzF.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.113c50cdf2cc.js +0 -30
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.113c50cdf2cc.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.113c50cdf2cc.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.js +0 -30
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-C34Ze3-5.js.gz +0 -0
- codex/static_root/assets/browser-CRPvEdqv.f355a71f4380.js +0 -1
- codex/static_root/assets/browser-CRPvEdqv.f355a71f4380.js.br +0 -0
- codex/static_root/assets/browser-CRPvEdqv.f355a71f4380.js.gz +0 -0
- codex/static_root/assets/browser-CRPvEdqv.js +0 -1
- codex/static_root/assets/browser-CRPvEdqv.js.br +0 -0
- codex/static_root/assets/browser-CRPvEdqv.js.gz +0 -0
- codex/static_root/assets/browser-Zqc9cR6T.b7d6ddeff130.css +0 -1
- codex/static_root/assets/browser-Zqc9cR6T.b7d6ddeff130.css.br +0 -0
- codex/static_root/assets/browser-Zqc9cR6T.b7d6ddeff130.css.gz +0 -0
- codex/static_root/assets/browser-Zqc9cR6T.css +0 -1
- codex/static_root/assets/browser-Zqc9cR6T.css.br +0 -0
- codex/static_root/assets/browser-Zqc9cR6T.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-JYM9aAR9.f71d378f4fa6.js.br +0 -0
- codex/static_root/assets/change-password-dialog-JYM9aAR9.f71d378f4fa6.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-JYM9aAR9.js.br +0 -0
- codex/static_root/assets/change-password-dialog-JYM9aAR9.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-ZAZ6P1Rc.515858dd21e8.js.br +0 -0
- codex/static_root/assets/confirm-dialog-ZAZ6P1Rc.515858dd21e8.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-ZAZ6P1Rc.js.br +0 -0
- codex/static_root/assets/confirm-dialog-ZAZ6P1Rc.js.gz +0 -0
- codex/static_root/assets/datetime-column-BT1MSP82.9617f6b94ebf.js +0 -1
- codex/static_root/assets/datetime-column-BT1MSP82.9617f6b94ebf.js.br +0 -0
- codex/static_root/assets/datetime-column-BT1MSP82.9617f6b94ebf.js.gz +0 -0
- codex/static_root/assets/datetime-column-BT1MSP82.js +0 -1
- codex/static_root/assets/datetime-column-BT1MSP82.js.br +0 -0
- codex/static_root/assets/datetime-column-BT1MSP82.js.gz +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css +0 -1
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css.br +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.css +0 -1
- codex/static_root/assets/datetime-column-Dg_RxTVM.css.br +0 -0
- codex/static_root/assets/filter-frSNsexx.eab1570bd32d.js +0 -1
- codex/static_root/assets/filter-frSNsexx.eab1570bd32d.js.br +0 -0
- codex/static_root/assets/filter-frSNsexx.eab1570bd32d.js.gz +0 -0
- codex/static_root/assets/filter-frSNsexx.js +0 -1
- codex/static_root/assets/filter-frSNsexx.js.br +0 -0
- codex/static_root/assets/filter-frSNsexx.js.gz +0 -0
- codex/static_root/assets/flag-tab-Ci_XcDT0.a5ea640a08d6.js.br +0 -0
- codex/static_root/assets/flag-tab-Ci_XcDT0.a5ea640a08d6.js.gz +0 -0
- codex/static_root/assets/flag-tab-Ci_XcDT0.js.br +0 -0
- codex/static_root/assets/flag-tab-Ci_XcDT0.js.gz +0 -0
- codex/static_root/assets/group-tab-DFma2R-E.879c37b15bbd.js.br +0 -0
- codex/static_root/assets/group-tab-DFma2R-E.879c37b15bbd.js.gz +0 -0
- codex/static_root/assets/group-tab-DFma2R-E.js.br +0 -0
- codex/static_root/assets/group-tab-DFma2R-E.js.gz +0 -0
- codex/static_root/assets/http-error-B3fQGxpt.9efc29496e30.js +0 -1
- codex/static_root/assets/http-error-B3fQGxpt.9efc29496e30.js.br +0 -0
- codex/static_root/assets/http-error-B3fQGxpt.9efc29496e30.js.gz +0 -0
- codex/static_root/assets/http-error-B3fQGxpt.js +0 -1
- codex/static_root/assets/http-error-B3fQGxpt.js.br +0 -0
- codex/static_root/assets/http-error-B3fQGxpt.js.gz +0 -0
- codex/static_root/assets/index-DUjeNg4x.36d50c91b2c1.js +0 -1
- 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 +0 -1
- 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-V8DUGoHN.809c548ff347.js.br +0 -0
- codex/static_root/assets/library-tab-V8DUGoHN.809c548ff347.js.gz +0 -0
- codex/static_root/assets/library-tab-V8DUGoHN.js.br +0 -0
- codex/static_root/assets/library-tab-V8DUGoHN.js.gz +0 -0
- codex/static_root/assets/main-Cavvqkyp.a9c4df906406.js +0 -32
- codex/static_root/assets/main-Cavvqkyp.a9c4df906406.js.br +0 -0
- codex/static_root/assets/main-Cavvqkyp.a9c4df906406.js.gz +0 -0
- codex/static_root/assets/main-Cavvqkyp.js +0 -32
- codex/static_root/assets/main-Cavvqkyp.js.br +0 -0
- codex/static_root/assets/main-Cavvqkyp.js.gz +0 -0
- codex/static_root/assets/main-sK7HC5h4.6f04ddfc5f1a.css.br +0 -0
- codex/static_root/assets/main-sK7HC5h4.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.697d7ae11c21.css +0 -1
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.697d7ae11c21.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.697d7ae11c21.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.css +0 -1
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-ClZui9Zf.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.b2eb1e0c6985.js +0 -1
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.b2eb1e0c6985.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.b2eb1e0c6985.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.js +0 -1
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Dg9tH1Ju.js.gz +0 -0
- codex/static_root/assets/pdf-doc-4PKLN-Z3.62d8de4d1fd8.js +0 -35
- codex/static_root/assets/pdf-doc-4PKLN-Z3.62d8de4d1fd8.js.br +0 -0
- codex/static_root/assets/pdf-doc-4PKLN-Z3.62d8de4d1fd8.js.gz +0 -0
- codex/static_root/assets/pdf-doc-4PKLN-Z3.js +0 -35
- codex/static_root/assets/pdf-doc-4PKLN-Z3.js.br +0 -0
- codex/static_root/assets/pdf-doc-4PKLN-Z3.js.gz +0 -0
- codex/static_root/assets/reader-C39uGGxn.67b0f324cd5e.js +0 -2
- codex/static_root/assets/reader-C39uGGxn.67b0f324cd5e.js.br +0 -0
- codex/static_root/assets/reader-C39uGGxn.67b0f324cd5e.js.gz +0 -0
- codex/static_root/assets/reader-C39uGGxn.js +0 -2
- codex/static_root/assets/reader-C39uGGxn.js.br +0 -0
- codex/static_root/assets/reader-C39uGGxn.js.gz +0 -0
- codex/static_root/assets/reader-N2Ei_y2K.8c0cdc0d513f.css +0 -1
- codex/static_root/assets/reader-N2Ei_y2K.8c0cdc0d513f.css.br +0 -0
- codex/static_root/assets/reader-N2Ei_y2K.8c0cdc0d513f.css.gz +0 -0
- codex/static_root/assets/reader-N2Ei_y2K.css +0 -1
- codex/static_root/assets/reader-N2Ei_y2K.css.br +0 -0
- codex/static_root/assets/reader-N2Ei_y2K.css.gz +0 -0
- codex/static_root/assets/relation-chips-CAC5ytqH.f205d920ffea.js +0 -1
- codex/static_root/assets/relation-chips-CAC5ytqH.f205d920ffea.js.br +0 -0
- codex/static_root/assets/relation-chips-CAC5ytqH.f205d920ffea.js.gz +0 -0
- codex/static_root/assets/relation-chips-CAC5ytqH.js +0 -1
- codex/static_root/assets/relation-chips-CAC5ytqH.js.br +0 -0
- codex/static_root/assets/relation-chips-CAC5ytqH.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CT73ieiV.fac6f69e86ff.js +0 -2
- codex/static_root/assets/settings-drawer-CT73ieiV.fac6f69e86ff.js.br +0 -0
- codex/static_root/assets/settings-drawer-CT73ieiV.fac6f69e86ff.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CT73ieiV.js +0 -2
- codex/static_root/assets/settings-drawer-CT73ieiV.js.br +0 -0
- codex/static_root/assets/settings-drawer-CT73ieiV.js.gz +0 -0
- codex/static_root/assets/stats-tab-C6qAnV6-.f08c46b5f141.js +0 -1
- codex/static_root/assets/stats-tab-C6qAnV6-.f08c46b5f141.js.br +0 -0
- codex/static_root/assets/stats-tab-C6qAnV6-.f08c46b5f141.js.gz +0 -0
- codex/static_root/assets/stats-tab-C6qAnV6-.js +0 -1
- codex/static_root/assets/stats-tab-C6qAnV6-.js.br +0 -0
- codex/static_root/assets/stats-tab-C6qAnV6-.js.gz +0 -0
- codex/static_root/assets/task-tab-JcG2vvgt.eed6e03db487.js +0 -1
- codex/static_root/assets/task-tab-JcG2vvgt.eed6e03db487.js.br +0 -0
- codex/static_root/assets/task-tab-JcG2vvgt.eed6e03db487.js.gz +0 -0
- codex/static_root/assets/task-tab-JcG2vvgt.js +0 -1
- codex/static_root/assets/task-tab-JcG2vvgt.js.br +0 -0
- codex/static_root/assets/task-tab-JcG2vvgt.js.gz +0 -0
- codex/static_root/assets/to-case-kUm8NPpW.5b3369f511b8.js +0 -1
- codex/static_root/assets/to-case-kUm8NPpW.js +0 -1
- codex/static_root/assets/unauthorized-28bmiwAU.c74825b5c16f.js +0 -1
- codex/static_root/assets/unauthorized-28bmiwAU.c74825b5c16f.js.br +0 -0
- codex/static_root/assets/unauthorized-28bmiwAU.c74825b5c16f.js.gz +0 -0
- codex/static_root/assets/unauthorized-28bmiwAU.js +0 -1
- codex/static_root/assets/unauthorized-28bmiwAU.js.br +0 -0
- codex/static_root/assets/unauthorized-28bmiwAU.js.gz +0 -0
- codex/static_root/assets/user-tab-BOq4BMMc.b64ac15dd772.js +0 -1
- codex/static_root/assets/user-tab-BOq4BMMc.b64ac15dd772.js.br +0 -0
- codex/static_root/assets/user-tab-BOq4BMMc.b64ac15dd772.js.gz +0 -0
- codex/static_root/assets/user-tab-BOq4BMMc.js +0 -1
- codex/static_root/assets/user-tab-BOq4BMMc.js.br +0 -0
- codex/static_root/assets/user-tab-BOq4BMMc.js.gz +0 -0
- codex/static_root/js/choices-admin.ef1ff3a8b9da.json +0 -1
- codex/static_root/js/choices-admin.ef1ff3a8b9da.json.br +0 -0
- codex/static_root/js/choices-admin.ef1ff3a8b9da.json.gz +0 -0
- codex/static_root/js/choices.23fedac2b9ba.json +0 -1
- codex/static_root/js/choices.23fedac2b9ba.json.br +0 -0
- codex/static_root/js/choices.23fedac2b9ba.json.gz +0 -0
- codex/static_root/manifest.ad9da9714e46.json +0 -642
- codex/static_root/manifest.ad9da9714e46.json.br +0 -0
- codex/static_root/manifest.ad9da9714e46.json.gz +0 -0
- codex/views/browser/browser_breadcrumbs.py +0 -175
- codex/views/browser/const.py +0 -3
- codex/views/cover.py +0 -78
- {codex-1.6.0a6.dist-info → codex-1.6.0a8.dist-info}/LICENSE +0 -0
- {codex-1.6.0a6.dist-info → codex-1.6.0a8.dist-info}/WHEEL +0 -0
- {codex-1.6.0a6.dist-info → codex-1.6.0a8.dist-info}/entry_points.txt +0 -0
codex/views/reader/reader.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"""Views for reading comic books."""
|
|
2
2
|
|
|
3
|
-
from copy import deepcopy
|
|
4
3
|
from types import MappingProxyType
|
|
5
4
|
|
|
6
5
|
from comicbox.box import Comicbox
|
|
7
|
-
from django.db.models import F, IntegerField, Value
|
|
8
6
|
from django.urls import reverse
|
|
9
7
|
from drf_spectacular.types import OpenApiTypes
|
|
10
8
|
from drf_spectacular.utils import OpenApiParameter, extend_schema
|
|
@@ -14,41 +12,24 @@ from rest_framework.response import Response
|
|
|
14
12
|
from codex.librarian.importer.tasks import LazyImportComicsTask
|
|
15
13
|
from codex.librarian.mp_queue import LIBRARIAN_QUEUE
|
|
16
14
|
from codex.logger.logging import get_logger
|
|
17
|
-
from codex.models import AdminFlag, Bookmark, Comic
|
|
18
15
|
from codex.serializers.reader import ReaderArcSerializer, ReaderComicsSerializer
|
|
19
16
|
from codex.serializers.redirect import ReaderRedirectSerializer
|
|
20
|
-
from codex.views.
|
|
21
|
-
from codex.views.
|
|
22
|
-
from codex.views.session import BrowserSessionViewBase
|
|
17
|
+
from codex.views.reader.arcs import ReaderArcsView
|
|
18
|
+
from codex.views.util import pop_name
|
|
23
19
|
|
|
24
20
|
LOG = get_logger(__name__)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_MIN_CRUMB_WALKBACK_LEN = 3
|
|
21
|
+
_VALID_ARC_GROUPS = frozenset({"f", "s", "a"})
|
|
28
22
|
|
|
29
23
|
|
|
30
24
|
class ReaderView(
|
|
31
|
-
|
|
32
|
-
BrowserSessionViewBase,
|
|
33
|
-
SharedAnnotationsMixin,
|
|
25
|
+
ReaderArcsView,
|
|
34
26
|
):
|
|
35
27
|
"""Get info for displaying comic pages."""
|
|
36
28
|
|
|
37
29
|
serializer_class = ReaderComicsSerializer
|
|
38
30
|
input_serializer_class = ReaderArcSerializer
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
_COMIC_FIELDS = (
|
|
42
|
-
"file_type",
|
|
43
|
-
"issue_number",
|
|
44
|
-
"issue_suffix",
|
|
45
|
-
"page_count",
|
|
46
|
-
"series",
|
|
47
|
-
"volume",
|
|
48
|
-
"reading_direction",
|
|
49
|
-
"updated_at",
|
|
50
|
-
)
|
|
51
|
-
_VALID_ARC_GROUPS = frozenset({"f", "s", "a"})
|
|
32
|
+
SESSION_KEY = "reader"
|
|
52
33
|
TARGET = "reader"
|
|
53
34
|
|
|
54
35
|
def __init__(self, *args, **kwargs):
|
|
@@ -56,238 +37,6 @@ class ReaderView(
|
|
|
56
37
|
super().__init__(*args, **kwargs)
|
|
57
38
|
self.series_pks: tuple[int, ...] = ()
|
|
58
39
|
|
|
59
|
-
def _get_series_pks_from_breadcrumbs(self):
|
|
60
|
-
"""Get Multi-Group pks from the breadcrumbs."""
|
|
61
|
-
if self.series_pks:
|
|
62
|
-
return self.series_pks
|
|
63
|
-
breadcrumbs = self.get_from_session("breadcrumbs")
|
|
64
|
-
if breadcrumbs:
|
|
65
|
-
crumb = breadcrumbs[-1]
|
|
66
|
-
crumb_group = crumb.get("group")
|
|
67
|
-
if crumb_group == "v" and len(breadcrumbs) >= _MIN_CRUMB_WALKBACK_LEN:
|
|
68
|
-
crumb = breadcrumbs[-2]
|
|
69
|
-
crumb_group = crumb.get("group")
|
|
70
|
-
if crumb_group == "s":
|
|
71
|
-
self.series_pks = crumb.get("pks", ())
|
|
72
|
-
|
|
73
|
-
return self.series_pks
|
|
74
|
-
|
|
75
|
-
def _get_reader_arc_pks(
|
|
76
|
-
self, arc, arc_pk_select_related, prefetch_related, arc_pk_rel
|
|
77
|
-
):
|
|
78
|
-
"""Get the nav filter."""
|
|
79
|
-
arc_pks = arc.get("pks", ())
|
|
80
|
-
if not arc_pks:
|
|
81
|
-
comic_pk = self.kwargs["pk"]
|
|
82
|
-
try:
|
|
83
|
-
arc_pk_qs = Comic.objects.filter(pk=comic_pk)
|
|
84
|
-
arc_pk_qs = arc_pk_qs.select_related(*arc_pk_select_related)
|
|
85
|
-
arc_pk_qs = arc_pk_qs.prefetch_related(*prefetch_related)
|
|
86
|
-
arc_pk = arc_pk_qs.values_list(arc_pk_rel, flat=True)[0]
|
|
87
|
-
except IndexError:
|
|
88
|
-
arc_pk = 0
|
|
89
|
-
|
|
90
|
-
if arc_pk_rel == "series__pk":
|
|
91
|
-
multi_arc_pks = self._get_series_pks_from_breadcrumbs()
|
|
92
|
-
if not arc_pk or arc_pk in multi_arc_pks:
|
|
93
|
-
arc_pks = multi_arc_pks
|
|
94
|
-
if not arc_pks:
|
|
95
|
-
arc_pks = (arc_pk,)
|
|
96
|
-
|
|
97
|
-
return arc_pks
|
|
98
|
-
|
|
99
|
-
def _get_comics_list(self):
|
|
100
|
-
"""Get the reader naviation group filter."""
|
|
101
|
-
select_related = ("series", "volume")
|
|
102
|
-
prefetch_related = ()
|
|
103
|
-
|
|
104
|
-
arc = self.params.get("arc", {})
|
|
105
|
-
|
|
106
|
-
arc_group = arc.get("group", "s")
|
|
107
|
-
if arc_group == "a":
|
|
108
|
-
# for story arcs
|
|
109
|
-
rel = "story_arc_numbers__story_arc"
|
|
110
|
-
fields = self._COMIC_FIELDS
|
|
111
|
-
arc_pk_rel = "story_arc_numbers__story_arc__pk"
|
|
112
|
-
prefetch_related = (*prefetch_related, "story_arc_numbers__story_arc")
|
|
113
|
-
arc_index = F("story_arc_numbers__number")
|
|
114
|
-
ordering = ("arc_index", "date")
|
|
115
|
-
arc_pk_select_related = ()
|
|
116
|
-
elif arc_group == self.FOLDER_GROUP:
|
|
117
|
-
# folder mode
|
|
118
|
-
rel = "parent_folder"
|
|
119
|
-
fields = (*self._COMIC_FIELDS, "parent_folder")
|
|
120
|
-
arc_pk_rel = "parent_folder__pk"
|
|
121
|
-
select_related = (*select_related, "parent_folder")
|
|
122
|
-
arc_index = Value(None, IntegerField())
|
|
123
|
-
ordering = ("path", "pk")
|
|
124
|
-
arc_pk_select_related = ("parent_folder",)
|
|
125
|
-
else:
|
|
126
|
-
# browser mode.
|
|
127
|
-
rel = "series"
|
|
128
|
-
fields = self._COMIC_FIELDS
|
|
129
|
-
arc_pk_rel = "series__pk"
|
|
130
|
-
arc_index = Value(None, IntegerField())
|
|
131
|
-
ordering = ()
|
|
132
|
-
arc_pk_select_related = ("series",)
|
|
133
|
-
|
|
134
|
-
arc_pks = self._get_reader_arc_pks(
|
|
135
|
-
arc,
|
|
136
|
-
arc_pk_select_related,
|
|
137
|
-
prefetch_related,
|
|
138
|
-
arc_pk_rel,
|
|
139
|
-
)
|
|
140
|
-
nav_filter = {f"{rel}__in": arc_pks}
|
|
141
|
-
group_acl_filter = self.get_group_acl_filter(Comic)
|
|
142
|
-
|
|
143
|
-
qs = (
|
|
144
|
-
Comic.objects.filter(group_acl_filter)
|
|
145
|
-
.filter(**nav_filter)
|
|
146
|
-
.select_related(*select_related)
|
|
147
|
-
.prefetch_related(*prefetch_related)
|
|
148
|
-
.only(*fields)
|
|
149
|
-
.annotate(
|
|
150
|
-
issue_count=F("volume__issue_count"),
|
|
151
|
-
)
|
|
152
|
-
.annotate(
|
|
153
|
-
arc_pk=F(arc_pk_rel),
|
|
154
|
-
arc_index=arc_index,
|
|
155
|
-
)
|
|
156
|
-
.annotate(mtime=F("updated_at"))
|
|
157
|
-
)
|
|
158
|
-
qs = self.annotate_group_names(qs, Comic)
|
|
159
|
-
if arc_group == "s":
|
|
160
|
-
show = deepcopy(self.get_from_session("show"))
|
|
161
|
-
show.pop("p", None)
|
|
162
|
-
show.pop("i", None)
|
|
163
|
-
qs, comic_sort_names = self.alias_sort_names(
|
|
164
|
-
qs, Comic, pks=arc_pks, model_group="i", show=show
|
|
165
|
-
)
|
|
166
|
-
ordering = (
|
|
167
|
-
*comic_sort_names,
|
|
168
|
-
"issue_number",
|
|
169
|
-
"issue_suffix",
|
|
170
|
-
"sort_name",
|
|
171
|
-
)
|
|
172
|
-
return qs.order_by(*ordering), arc_group
|
|
173
|
-
|
|
174
|
-
def _append_with_settings(self, book, bookmark_filter):
|
|
175
|
-
"""Append bookmark to book list."""
|
|
176
|
-
book.settings = (
|
|
177
|
-
Bookmark.objects.filter(**bookmark_filter, comic=book)
|
|
178
|
-
.only(*self.SETTINGS_ATTRS)
|
|
179
|
-
.first()
|
|
180
|
-
)
|
|
181
|
-
return book
|
|
182
|
-
|
|
183
|
-
def _get_book_collection(self):
|
|
184
|
-
"""Get the -1, +1 window around the current issue.
|
|
185
|
-
|
|
186
|
-
Uses iteration in python. There are some complicated ways of
|
|
187
|
-
doing this with __gt[0] & __lt[0] in the db, but I think they
|
|
188
|
-
might be even more expensive.
|
|
189
|
-
|
|
190
|
-
Yields 1 to 3 books
|
|
191
|
-
"""
|
|
192
|
-
comics, arc_group = self._get_comics_list()
|
|
193
|
-
bookmark_filter = self.get_bookmark_filter()
|
|
194
|
-
books = {}
|
|
195
|
-
prev_book = None
|
|
196
|
-
pk = self.kwargs.get("pk")
|
|
197
|
-
for index, book in enumerate(comics):
|
|
198
|
-
if books:
|
|
199
|
-
# after match set next comic and break
|
|
200
|
-
books["next"] = self._append_with_settings(book, bookmark_filter)
|
|
201
|
-
break
|
|
202
|
-
if book.pk == pk:
|
|
203
|
-
# first match. set previous and current comic
|
|
204
|
-
if prev_book:
|
|
205
|
-
books["prev"] = self._append_with_settings(
|
|
206
|
-
prev_book, bookmark_filter
|
|
207
|
-
)
|
|
208
|
-
# create extra current book attrs:
|
|
209
|
-
if book.arc_index is None: # type: ignore
|
|
210
|
-
book.arc_index = index + 1 # type: ignore
|
|
211
|
-
book.filename = book.get_filename() # type: ignore
|
|
212
|
-
book.arc_group = arc_group
|
|
213
|
-
book.arc_count = comics.count()
|
|
214
|
-
books["current"] = self._append_with_settings(book, bookmark_filter)
|
|
215
|
-
else:
|
|
216
|
-
# Haven't matched yet, so set the previous comic
|
|
217
|
-
prev_book = book
|
|
218
|
-
return books
|
|
219
|
-
|
|
220
|
-
def _get_folder_arc(self, book):
|
|
221
|
-
"""Create the folder arc."""
|
|
222
|
-
efv_flag = (
|
|
223
|
-
AdminFlag.objects.only("on")
|
|
224
|
-
.get(key=AdminFlag.FlagChoices.FOLDER_VIEW.value)
|
|
225
|
-
.on
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
if efv_flag:
|
|
229
|
-
folder = book.parent_folder
|
|
230
|
-
folder_arc = {
|
|
231
|
-
"group": self.FOLDER_GROUP,
|
|
232
|
-
"pks": (folder.pk,),
|
|
233
|
-
"name": folder.name,
|
|
234
|
-
}
|
|
235
|
-
else:
|
|
236
|
-
folder_arc = None
|
|
237
|
-
return folder_arc
|
|
238
|
-
|
|
239
|
-
def _get_series_arc(self, book):
|
|
240
|
-
"""Create the series arc."""
|
|
241
|
-
series = book.series
|
|
242
|
-
if series:
|
|
243
|
-
arc_pks = self._get_series_pks_from_breadcrumbs()
|
|
244
|
-
if book.series.pk not in arc_pks:
|
|
245
|
-
arc_pks = (book.series.pk,)
|
|
246
|
-
arc = (
|
|
247
|
-
{"group": "s", "pks": arc_pks, "name": series.name} if series else None
|
|
248
|
-
)
|
|
249
|
-
else:
|
|
250
|
-
arc = None
|
|
251
|
-
return arc
|
|
252
|
-
|
|
253
|
-
def _get_story_arcs(self, book):
|
|
254
|
-
"""Create story arcs."""
|
|
255
|
-
sas = []
|
|
256
|
-
for san in book.story_arc_numbers.all():
|
|
257
|
-
sa = san.story_arc
|
|
258
|
-
arc = {
|
|
259
|
-
"group": "a",
|
|
260
|
-
"pks": (sa.pk,),
|
|
261
|
-
"name": sa.name,
|
|
262
|
-
}
|
|
263
|
-
sas.append(arc)
|
|
264
|
-
return sorted(sas, key=lambda x: x["name"])
|
|
265
|
-
|
|
266
|
-
def _get_arcs(self, book):
|
|
267
|
-
"""Get all series/folder/story arcs."""
|
|
268
|
-
# create top arcs
|
|
269
|
-
folder_arc = self._get_folder_arc(book)
|
|
270
|
-
series_arc = self._get_series_arc(book)
|
|
271
|
-
|
|
272
|
-
# order top arcs
|
|
273
|
-
top_group = self.params.get("top_group")
|
|
274
|
-
if top_group == self.FOLDER_GROUP and folder_arc:
|
|
275
|
-
arc = folder_arc
|
|
276
|
-
other_arc = series_arc
|
|
277
|
-
else:
|
|
278
|
-
arc = series_arc
|
|
279
|
-
other_arc = folder_arc
|
|
280
|
-
|
|
281
|
-
arcs = []
|
|
282
|
-
arcs.append(arc)
|
|
283
|
-
if other_arc:
|
|
284
|
-
arcs.append(other_arc)
|
|
285
|
-
|
|
286
|
-
# story arcs
|
|
287
|
-
sas = self._get_story_arcs(book)
|
|
288
|
-
arcs += sas
|
|
289
|
-
return arcs
|
|
290
|
-
|
|
291
40
|
def _raise_not_found(self):
|
|
292
41
|
"""Raise not found exception."""
|
|
293
42
|
pk = self.kwargs.get("pk")
|
|
@@ -298,6 +47,46 @@ class ReaderView(
|
|
|
298
47
|
}
|
|
299
48
|
raise NotFound(detail=detail)
|
|
300
49
|
|
|
50
|
+
def _parse_params(self):
|
|
51
|
+
data = self.request.GET
|
|
52
|
+
# Hack for query_parm parser
|
|
53
|
+
arc_data = MappingProxyType(
|
|
54
|
+
{"group": data.get("arc[group]"), "pks": data.get("arc[pks]")}
|
|
55
|
+
)
|
|
56
|
+
serializer = self.input_serializer_class(data=arc_data)
|
|
57
|
+
arc = {}
|
|
58
|
+
try:
|
|
59
|
+
serializer.is_valid()
|
|
60
|
+
arc: dict = serializer.validated_data # type: ignore
|
|
61
|
+
except ValidationError:
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
# PARAMS
|
|
65
|
+
top_group = self.get_from_session(
|
|
66
|
+
"top_group", "s", session_key=self.BROWSER_SESSION_KEY
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# arc.group validation
|
|
70
|
+
# Can't be in the serializer
|
|
71
|
+
arc_group = arc.get("group", "")
|
|
72
|
+
if not arc_group:
|
|
73
|
+
series_pks = self.get_series_pks_from_breadcrumbs()
|
|
74
|
+
if series_pks:
|
|
75
|
+
arc_group = "s"
|
|
76
|
+
arc["pks"] = series_pks
|
|
77
|
+
if not arc_group:
|
|
78
|
+
arc_group = top_group
|
|
79
|
+
if arc_group not in _VALID_ARC_GROUPS:
|
|
80
|
+
arc_group = None
|
|
81
|
+
|
|
82
|
+
params = MappingProxyType(
|
|
83
|
+
{
|
|
84
|
+
"arc": arc,
|
|
85
|
+
"top_group": top_group,
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
self.params = params
|
|
89
|
+
|
|
301
90
|
@staticmethod
|
|
302
91
|
def _lazy_metadata(current, prev_book, next_book):
|
|
303
92
|
"""Get reader metadata from comicbox if it's not in the db."""
|
|
@@ -326,7 +115,7 @@ class ReaderView(
|
|
|
326
115
|
"""Get the previous and next comics in a group or story arc."""
|
|
327
116
|
# Books
|
|
328
117
|
self.last_route = self.get_last_route()
|
|
329
|
-
books = self.
|
|
118
|
+
books = self.get_book_collection()
|
|
330
119
|
|
|
331
120
|
current = books.get("current")
|
|
332
121
|
if not current:
|
|
@@ -343,7 +132,7 @@ class ReaderView(
|
|
|
343
132
|
}
|
|
344
133
|
|
|
345
134
|
# Arcs
|
|
346
|
-
arcs = self.
|
|
135
|
+
arcs, mtime = self.get_arcs(current)
|
|
347
136
|
|
|
348
137
|
arc = self.params.get("arc", {})
|
|
349
138
|
if not arc.get("group"):
|
|
@@ -352,49 +141,15 @@ class ReaderView(
|
|
|
352
141
|
arc["pks"] = (current.arc_pk,) # type: ignore
|
|
353
142
|
arc["index"] = current.arc_index # type:ignore
|
|
354
143
|
arc["count"] = current.arc_count # type: ignore
|
|
355
|
-
close_route = self.last_route
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
{"group": data.get("arc[group]"), "pks": data.get("arc[pks]")}
|
|
365
|
-
)
|
|
366
|
-
serializer = self.input_serializer_class(data=arc_data)
|
|
367
|
-
arc = {}
|
|
368
|
-
try:
|
|
369
|
-
serializer.is_valid()
|
|
370
|
-
arc = serializer.validated_data
|
|
371
|
-
except ValidationError:
|
|
372
|
-
pass
|
|
373
|
-
|
|
374
|
-
# PARAMS
|
|
375
|
-
session = self.request.session.get(BrowserSessionViewBase.SESSION_KEY, {})
|
|
376
|
-
top_group = session.get("top_group", "s")
|
|
377
|
-
|
|
378
|
-
# arc.group validation
|
|
379
|
-
# Can't be in the serializer
|
|
380
|
-
arc_group = arc.get("group", "")
|
|
381
|
-
if not arc_group:
|
|
382
|
-
series_pks = self._get_series_pks_from_breadcrumbs()
|
|
383
|
-
if series_pks:
|
|
384
|
-
arc_group = "s"
|
|
385
|
-
arc["pks"] = series_pks
|
|
386
|
-
if not arc_group:
|
|
387
|
-
arc_group = top_group
|
|
388
|
-
if arc_group not in self._VALID_ARC_GROUPS:
|
|
389
|
-
arc_group = None
|
|
390
|
-
|
|
391
|
-
params = MappingProxyType(
|
|
392
|
-
{
|
|
393
|
-
"arc": arc,
|
|
394
|
-
"top_group": top_group,
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
self.params = params
|
|
144
|
+
close_route = pop_name(self.last_route)
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
"books": books,
|
|
148
|
+
"arcs": arcs,
|
|
149
|
+
"arc": arc,
|
|
150
|
+
"close_route": close_route,
|
|
151
|
+
"mtime": mtime,
|
|
152
|
+
}
|
|
398
153
|
|
|
399
154
|
@extend_schema(
|
|
400
155
|
parameters=[
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"""Reader session view."""
|
|
2
2
|
|
|
3
3
|
from codex.serializers.reader import ReaderSettingsSerializer
|
|
4
|
-
from codex.views.
|
|
4
|
+
from codex.views.settings import SettingsView
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ReaderSettingsView(SettingsView):
|
|
8
8
|
"""Get Reader Settings."""
|
|
9
9
|
|
|
10
10
|
serializer_class = ReaderSettingsSerializer # type: ignore
|
|
11
|
+
|
|
12
|
+
SESSION_KEY = "reader"
|
codex/views/session.py
CHANGED
|
@@ -3,64 +3,21 @@
|
|
|
3
3
|
from abc import ABC
|
|
4
4
|
from copy import deepcopy
|
|
5
5
|
from types import MappingProxyType
|
|
6
|
-
from typing import ClassVar
|
|
7
|
-
|
|
8
|
-
from drf_spectacular.utils import extend_schema
|
|
9
|
-
from rest_framework.generics import GenericAPIView
|
|
10
|
-
from rest_framework.response import Response
|
|
11
6
|
|
|
12
7
|
from codex.logger.logging import get_logger
|
|
13
8
|
from codex.serializers.choices import DEFAULTS
|
|
14
|
-
from codex.views.auth import
|
|
9
|
+
from codex.views.auth import AuthFilterGenericAPIView
|
|
10
|
+
from codex.views.util import pop_name
|
|
15
11
|
|
|
16
12
|
LOG = get_logger(__name__)
|
|
17
13
|
|
|
18
14
|
|
|
19
|
-
class
|
|
15
|
+
class SessionView(AuthFilterGenericAPIView, ABC):
|
|
20
16
|
"""Generic Session View."""
|
|
21
17
|
|
|
22
18
|
# Must override both of these
|
|
23
19
|
SESSION_KEY = ""
|
|
24
|
-
SESSION_DEFAULTS = MappingProxyType({})
|
|
25
|
-
|
|
26
|
-
@classmethod
|
|
27
|
-
def _get_source_values_or_set_defaults(cls, defaults_dict, source_dict, data):
|
|
28
|
-
"""Recursively copy source_dict values into data or use defaults."""
|
|
29
|
-
result = deepcopy(data)
|
|
30
|
-
for key, default_value in defaults_dict.items():
|
|
31
|
-
result[key] = source_dict.get(key, default_value)
|
|
32
|
-
if result[key] is None:
|
|
33
|
-
# extra check for migrated or corrupt data
|
|
34
|
-
result[key] = default_value
|
|
35
|
-
if isinstance(default_value, dict):
|
|
36
|
-
result[key] = cls._get_source_values_or_set_defaults(
|
|
37
|
-
default_value, source_dict.get(key, {}), result[key]
|
|
38
|
-
)
|
|
39
|
-
return result
|
|
40
|
-
|
|
41
|
-
def get_from_session(self, key): # only used by frontend
|
|
42
|
-
"""Get one key from the session or its default."""
|
|
43
|
-
session = self.request.session.get(self.SESSION_KEY, self.SESSION_DEFAULTS)
|
|
44
|
-
return session.get(key, self.SESSION_DEFAULTS[key])
|
|
45
20
|
|
|
46
|
-
def save_params_to_session(self, params): # reader session & browser final
|
|
47
|
-
"""Save the session from params with defaults for missing values."""
|
|
48
|
-
try:
|
|
49
|
-
# Deepcopy this so serializing the values later later for http response doesn't alter them
|
|
50
|
-
params = deepcopy(dict(params))
|
|
51
|
-
data = self._get_source_values_or_set_defaults(
|
|
52
|
-
self.SESSION_DEFAULTS, params, {}
|
|
53
|
-
)
|
|
54
|
-
self.request.session[self.SESSION_KEY] = data
|
|
55
|
-
self.request.session.save()
|
|
56
|
-
except Exception as exc:
|
|
57
|
-
LOG.warning(f"Saving params to session: {exc}")
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class BrowserSessionViewBase(SessionViewBaseBase):
|
|
61
|
-
"""Browser session base."""
|
|
62
|
-
|
|
63
|
-
SESSION_KEY = "browser" # type: ignore
|
|
64
21
|
CONTRIBUTOR_PERSON_UI_FIELD = "contributors"
|
|
65
22
|
STORY_ARC_UI_FIELD = "story_arcs"
|
|
66
23
|
IDENTIFIER_TYPE_UI_FIELD = "identifier_type"
|
|
@@ -80,7 +37,6 @@ class BrowserSessionViewBase(SessionViewBaseBase):
|
|
|
80
37
|
"locations": [],
|
|
81
38
|
"monochrome": [],
|
|
82
39
|
"original_format": [],
|
|
83
|
-
"q": "",
|
|
84
40
|
"reading_direction": [],
|
|
85
41
|
"series_groups": [],
|
|
86
42
|
"stories": [],
|
|
@@ -92,76 +48,94 @@ class BrowserSessionViewBase(SessionViewBaseBase):
|
|
|
92
48
|
}
|
|
93
49
|
)
|
|
94
50
|
FILTER_ATTRIBUTES = frozenset(_DYNAMIC_FILTER_DEFAULTS.keys())
|
|
51
|
+
BROWSER_SESSION_KEY = "browser"
|
|
52
|
+
READER_SESSION_KEY = "reader"
|
|
95
53
|
SESSION_DEFAULTS = MappingProxyType(
|
|
96
54
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
55
|
+
BROWSER_SESSION_KEY: {
|
|
56
|
+
"breadcrumbs": DEFAULTS["breadcrumbs"],
|
|
57
|
+
"filters": {
|
|
58
|
+
"bookmark": DEFAULTS["bookmarkFilter"],
|
|
59
|
+
**_DYNAMIC_FILTER_DEFAULTS,
|
|
60
|
+
},
|
|
61
|
+
"order_by": DEFAULTS["orderBy"],
|
|
62
|
+
"order_reverse": DEFAULTS["orderReverse"],
|
|
63
|
+
"q": DEFAULTS["q"],
|
|
64
|
+
"search_results_limit": DEFAULTS["searchResultsLimit"],
|
|
65
|
+
"show": DEFAULTS["show"],
|
|
66
|
+
"dynamic_covers": DEFAULTS["dynamicCovers"],
|
|
67
|
+
"custom_covers": DEFAULTS["customCovers"],
|
|
68
|
+
"twenty_four_hour_time": DEFAULTS["twentyFourHourTime"],
|
|
69
|
+
"top_group": DEFAULTS["topGroup"],
|
|
70
|
+
},
|
|
71
|
+
READER_SESSION_KEY: {
|
|
72
|
+
"fit_to": DEFAULTS["fitTo"],
|
|
73
|
+
"two_pages": False,
|
|
74
|
+
"reading_direction": DEFAULTS["readingDirection"],
|
|
101
75
|
},
|
|
102
|
-
"order_by": DEFAULTS["orderBy"],
|
|
103
|
-
"order_reverse": DEFAULTS["orderReverse"],
|
|
104
|
-
"q": DEFAULTS["q"],
|
|
105
|
-
"search_results_limit": DEFAULTS["searchResultsLimit"],
|
|
106
|
-
"show": DEFAULTS["show"],
|
|
107
|
-
"cover_style": DEFAULTS["coverStyle"],
|
|
108
|
-
"twenty_four_hour_time": False,
|
|
109
|
-
"top_group": DEFAULTS["topGroup"],
|
|
110
76
|
}
|
|
111
77
|
)
|
|
112
78
|
|
|
79
|
+
def get_from_session(
|
|
80
|
+
self, key, default=None, session_key=None
|
|
81
|
+
): # only used by frontend
|
|
82
|
+
"""Get one key from the session or its default."""
|
|
83
|
+
if session_key is None:
|
|
84
|
+
session_key = self.SESSION_KEY
|
|
85
|
+
session = self.request.session.get(
|
|
86
|
+
session_key, self.SESSION_DEFAULTS[session_key]
|
|
87
|
+
)
|
|
88
|
+
if default is None:
|
|
89
|
+
default = self.SESSION_DEFAULTS[session_key][key]
|
|
90
|
+
return session.get(key, default)
|
|
91
|
+
|
|
113
92
|
def get_last_route(self, name=True):
|
|
114
93
|
"""Get the last route from the breadcrumbs."""
|
|
115
|
-
breadcrumbs = self.get_from_session(
|
|
94
|
+
breadcrumbs = self.get_from_session(
|
|
95
|
+
"breadcrumbs", session_key=self.BROWSER_SESSION_KEY
|
|
96
|
+
)
|
|
116
97
|
if not breadcrumbs:
|
|
117
98
|
breadcrumbs = DEFAULTS["breadcrumbs"]
|
|
118
99
|
last_route = breadcrumbs[-1]
|
|
119
100
|
if not name:
|
|
120
|
-
last_route
|
|
101
|
+
last_route = pop_name(last_route)
|
|
121
102
|
|
|
122
103
|
return last_route
|
|
123
104
|
|
|
105
|
+
def load_params_from_session(self, validated_data=None, session_key=None):
|
|
106
|
+
"""Load params from the session with defaults."""
|
|
107
|
+
session_key = session_key if session_key else self.SESSION_KEY
|
|
108
|
+
params = deepcopy(dict(self.SESSION_DEFAULTS[session_key]))
|
|
109
|
+
session_params = self.request.session.get(session_key)
|
|
110
|
+
if session_params:
|
|
111
|
+
params.update(session_params)
|
|
112
|
+
if validated_data:
|
|
113
|
+
params.update(validated_data)
|
|
114
|
+
self.params = MappingProxyType(params)
|
|
124
115
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"""Session view for retrieving stored settings."""
|
|
140
|
-
|
|
141
|
-
permission_classes: ClassVar[list] = [IsAuthenticatedOrEnabledNonUsers] # type: ignore
|
|
142
|
-
|
|
143
|
-
def load_params_from_session(self):
|
|
144
|
-
"""Set the params from view session, creating missing values from defaults."""
|
|
145
|
-
session = self.request.session.get(self.SESSION_KEY, self.SESSION_DEFAULTS)
|
|
146
|
-
return self._get_source_values_or_set_defaults(
|
|
147
|
-
self.SESSION_DEFAULTS, session, {}
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
def get(self, *args, **kwargs):
|
|
151
|
-
"""Get session settings."""
|
|
152
|
-
params = self.load_params_from_session()
|
|
153
|
-
data = {}
|
|
154
|
-
for key, filter_name in params.get("filters", {}).items():
|
|
155
|
-
if filter_name:
|
|
156
|
-
data[key] = filter_name
|
|
157
|
-
params["filters"] = data
|
|
158
|
-
serializer = self.get_serializer(params)
|
|
159
|
-
return Response(serializer.data)
|
|
116
|
+
@classmethod
|
|
117
|
+
def _get_source_values_or_set_defaults(cls, defaults_dict, source_dict, data):
|
|
118
|
+
"""Recursively copy source_dict values into data or use defaults."""
|
|
119
|
+
result = deepcopy(data)
|
|
120
|
+
for key, default_value in defaults_dict.items():
|
|
121
|
+
result[key] = source_dict.get(key, default_value)
|
|
122
|
+
if result[key] is None:
|
|
123
|
+
# extra check for migrated or corrupt data
|
|
124
|
+
result[key] = default_value
|
|
125
|
+
if isinstance(default_value, dict):
|
|
126
|
+
result[key] = cls._get_source_values_or_set_defaults(
|
|
127
|
+
default_value, source_dict.get(key, {}), result[key]
|
|
128
|
+
)
|
|
129
|
+
return result
|
|
160
130
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
131
|
+
def save_params_to_session(self, params): # reader session & browser final
|
|
132
|
+
"""Save the session from params with defaults for missing values."""
|
|
133
|
+
try:
|
|
134
|
+
# Deepcopy this so serializing the values later later for http response doesn't alter them
|
|
135
|
+
params = deepcopy(dict(params))
|
|
136
|
+
defaults = self.SESSION_DEFAULTS[self.SESSION_KEY]
|
|
137
|
+
data = self._get_source_values_or_set_defaults(defaults, params, {})
|
|
138
|
+
self.request.session[self.SESSION_KEY] = data
|
|
139
|
+
self.request.session.save()
|
|
140
|
+
except Exception as exc:
|
|
141
|
+
LOG.warning(f"Saving params to session: {exc}")
|