codex 1.6.19__py3-none-any.whl → 1.7.0__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/choices.py +419 -0
- codex/choices_to_json.py +122 -0
- codex/db.py +134 -0
- codex/exceptions.py +2 -3
- codex/librarian/bookmark/__init__.py +1 -0
- codex/librarian/bookmark/bookmarkd.py +38 -0
- codex/librarian/bookmark/tasks.py +19 -0
- codex/librarian/bookmark/update.py +154 -0
- codex/librarian/covers/coverd.py +3 -4
- codex/librarian/covers/create.py +8 -7
- codex/librarian/covers/path.py +1 -2
- codex/librarian/covers/purge.py +3 -3
- codex/librarian/importer/const.py +7 -1
- codex/librarian/importer/create_fks.py +5 -2
- codex/librarian/importer/importerd.py +17 -12
- codex/librarian/importer/moved.py +44 -13
- codex/librarian/importer/tasks.py +2 -0
- codex/librarian/janitor/cleanup.py +21 -8
- codex/librarian/janitor/integrity.py +371 -0
- codex/librarian/janitor/janitor.py +50 -15
- codex/librarian/janitor/latest_version.py +2 -1
- codex/librarian/janitor/status.py +5 -0
- codex/librarian/janitor/tasks.py +37 -0
- codex/librarian/janitor/update.py +1 -1
- codex/librarian/librariand.py +37 -24
- codex/librarian/search/optimize.py +43 -0
- codex/librarian/search/remove.py +18 -46
- codex/librarian/search/searchd.py +14 -17
- codex/librarian/search/status.py +2 -1
- codex/librarian/search/tasks.py +4 -9
- codex/librarian/search/update.py +223 -301
- codex/librarian/watchdog/emitter.py +21 -19
- codex/librarian/watchdog/event_batcherd.py +0 -1
- codex/librarian/watchdog/observers.py +2 -1
- codex/migrations/0029_comicfts.py +58 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +202 -0
- codex/models/admin.py +15 -11
- codex/models/base.py +9 -0
- codex/models/bookmark.py +3 -3
- codex/models/comic.py +68 -16
- codex/models/functions.py +60 -2
- codex/models/groups.py +6 -1
- codex/models/library.py +1 -3
- codex/models/paths.py +9 -3
- codex/models/query.py +6 -0
- codex/run.py +11 -9
- codex/serializers/admin/tasks.py +2 -2
- codex/serializers/browser/mixins.py +18 -14
- codex/serializers/browser/page.py +2 -0
- codex/serializers/browser/settings.py +4 -4
- codex/serializers/fields.py +9 -5
- codex/settings/settings.py +16 -17
- codex/signals/django_signals.py +4 -10
- codex/startup.py +7 -39
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js +1 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js +1 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js +1 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js +1 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js +1 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js +1 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js +1 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js +1 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css +1 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css +1 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js +1 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js +1 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js +1 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js +1 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js +1 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js +1 -0
- codex/static_root/assets/VSelect-C1gez8rl.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css +1 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css +1 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js +1 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js +1 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css +1 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css +1 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js +1 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js +1 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js +1 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js +1 -0
- codex/static_root/assets/VTable-CYC-wMpk.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css +1 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css +1 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js +1 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js +1 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js +1 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js +1 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js +1 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.js +1 -0
- codex/static_root/assets/admin-CD90VMen.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.js.gz +0 -0
- codex/static_root/assets/{admin-CWEjaFr5.7d4523387384.css → admin-DJ7pIXDQ.css} +1 -1
- codex/static_root/assets/admin-DJ7pIXDQ.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.css.gz +0 -0
- codex/static_root/assets/{admin-CWEjaFr5.css → admin-DJ7pIXDQ.e2a77af73ef2.css} +1 -1
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css +1 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css +1 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js +1 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js +1 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js +1 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js +1 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.2548c49a853e.css +1 -0
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.css +1 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js +1 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.gz +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js +1 -0
- codex/static_root/assets/browser-C0KS3g2E.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css +1 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css +1 -0
- codex/static_root/assets/browser-JFL2hLjt.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js +1 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js +1 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css +1 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css +1 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-B7w6z2rf.472011c06253.css +1 -0
- codex/static_root/assets/confirm-dialog-B7w6z2rf.css +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js +1 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js +1 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js +1 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js +1 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.js +1 -0
- codex/static_root/assets/filter-DskcqZHA.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.js.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css +1 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css +1 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js +1 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js +1 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js +1 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js +1 -0
- codex/static_root/assets/group-tab-Czt2x61x.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css +1 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css +1 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js +1 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js +1 -0
- codex/static_root/assets/http-error-NHcwE5e_.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css +1 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css +1 -0
- codex/static_root/assets/index-CL_6g4tJ.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js +1 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.js +1 -0
- codex/static_root/assets/index-DYNNO5kn.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js +1 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js +1 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js.gz +0 -0
- codex/static_root/assets/{library-tab-Bh7ErAk7.7c44200ee727.css → library-tab-Wew8YOLv.0c1780a6b68e.css} +1 -1
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.gz +0 -0
- codex/static_root/assets/{library-tab-Bh7ErAk7.css → library-tab-Wew8YOLv.css} +1 -1
- codex/static_root/assets/library-tab-Wew8YOLv.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.css.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js +35 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js +35 -0
- codex/static_root/assets/main-B3EwXQ3Q.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js +1 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js +1 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js +1 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js +1 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.4722195bb60b.css → pagination-toolbar-DGrxp2OD.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.css → pagination-toolbar-DGrxp2OD.f960a624f04f.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.0f056fa321b6.js → pdf-doc-ctqZIwOP.7e7b2c815ea4.js} +3 -3
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.js → pdf-doc-ctqZIwOP.js} +3 -3
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js +2 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js +2 -0
- codex/static_root/assets/reader-DPLhdrJD.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css +1 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.css +1 -0
- codex/static_root/assets/reader-nD70BeEz.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.css.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js +1 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js +1 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js +2 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js +2 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.9b7a71e7fe28.css → stats-tab-BAYTqQNg.5f715428c394.css} +1 -1
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.css → stats-tab-BAYTqQNg.css} +1 -1
- codex/static_root/assets/stats-tab-BAYTqQNg.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.css.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js +1 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js +1 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css +1 -0
- codex/static_root/assets/{task-tab-1XiWn9xP.06cb8e1b794d.css.br → task-tab--cXi48kg.5dfd6890a1c2.css.br} +1 -1
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.css +1 -0
- codex/static_root/assets/{task-tab-1XiWn9xP.css.br → task-tab--cXi48kg.css.br} +1 -1
- codex/static_root/assets/task-tab--cXi48kg.css.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js +1 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js +1 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js +1 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.js +1 -0
- codex/static_root/assets/transition-3g2arGgl.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.js.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css +1 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.br +4 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.css +1 -0
- codex/static_root/assets/transition-5LRFTPo5.css.br +4 -0
- codex/static_root/assets/transition-5LRFTPo5.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.css → unauthorized-BjhIc97q.728511c92cd0.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.2166ec8b3a32.css → unauthorized-BjhIc97q.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.css.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js +1 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js +1 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js +1 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js +1 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js.gz +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json +712 -0
- codex/static_root/manifest.c5f1de88b1ac.json.br +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json.gz +0 -0
- codex/static_root/manifest.json +371 -294
- 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 +15 -10
- codex/threads.py +1 -1
- codex/urls/api/auth.py +1 -1
- codex/urls/api/browser.py +1 -1
- codex/views/admin/library.py +18 -13
- codex/views/admin/stats.py +23 -16
- codex/views/admin/tasks.py +45 -40
- codex/views/auth.py +50 -74
- codex/views/bookmark.py +16 -153
- codex/views/browser/annotate/__init__.py +1 -0
- codex/views/browser/annotate/bookmark.py +112 -0
- codex/views/browser/annotate/card.py +61 -0
- codex/views/browser/annotate/order.py +247 -0
- codex/views/browser/breadcrumbs.py +90 -11
- codex/views/browser/browser.py +82 -117
- codex/views/browser/choices.py +15 -18
- codex/views/browser/cover.py +18 -24
- codex/views/browser/filters/bookmark.py +18 -19
- codex/views/browser/filters/field.py +8 -3
- codex/views/browser/filters/filter.py +69 -0
- codex/views/browser/filters/group.py +9 -6
- codex/views/browser/filters/search/__init__.py +1 -0
- codex/views/browser/filters/search/aliases.py +81 -0
- codex/views/browser/filters/search/field/__init__.py +1 -0
- codex/views/browser/filters/search/field/column.py +53 -0
- codex/views/browser/filters/search/field/expression.py +177 -0
- codex/views/browser/filters/search/field/filter.py +70 -0
- codex/views/browser/filters/search/field/optimize.py +71 -0
- codex/views/browser/filters/search/field/parse.py +187 -0
- codex/views/browser/filters/search/fts.py +24 -0
- codex/views/browser/filters/search/parse.py +250 -0
- codex/views/browser/group_mtime.py +83 -0
- codex/views/browser/metadata/__init__.py +1 -0
- codex/views/browser/metadata/annotate.py +109 -0
- codex/views/browser/metadata/copy_intersections.py +90 -0
- codex/views/browser/metadata/metadata.py +83 -0
- codex/views/browser/metadata/query_intersections.py +112 -0
- codex/views/browser/mtime.py +2 -10
- codex/views/browser/order_by.py +22 -16
- codex/views/browser/page_in_bounds.py +88 -0
- codex/views/browser/paginate.py +32 -123
- codex/views/browser/params.py +64 -0
- codex/views/browser/title.py +1 -6
- codex/views/browser/validate.py +68 -33
- codex/views/const.py +0 -1
- codex/views/download.py +1 -1
- codex/views/mixins.py +27 -15
- codex/views/opds/const.py +2 -3
- codex/views/opds/urls.py +2 -2
- codex/views/opds/util.py +2 -3
- codex/views/opds/v1/entry/links.py +3 -1
- codex/views/opds/v1/facets.py +65 -12
- codex/views/opds/v1/feed.py +7 -65
- codex/views/opds/v1/links.py +5 -4
- codex/views/opds/v2/feed.py +2 -28
- codex/views/opds/v2/links.py +27 -2
- codex/views/opds/v2/publications.py +5 -6
- codex/views/opds/v2/top_links.py +3 -6
- codex/views/public.py +2 -2
- codex/views/reader/arcs.py +0 -3
- codex/views/reader/books.py +57 -41
- codex/views/reader/page.py +13 -7
- codex/views/reader/{init.py → params.py} +37 -31
- codex/views/reader/reader.py +1 -2
- codex/views/session.py +43 -54
- codex/views/timezone.py +54 -0
- codex/views/version.py +1 -1
- {codex-1.6.19.dist-info → codex-1.7.0.dist-info}/METADATA +15 -10
- {codex-1.6.19.dist-info → codex-1.7.0.dist-info}/RECORD +467 -484
- codex/_vendor/__init__.py +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/AUTHORS +0 -127
- codex/_vendor/django_haystack-3.2.1.dist-info/INSTALLER +0 -1
- codex/_vendor/django_haystack-3.2.1.dist-info/LICENSE +0 -31
- codex/_vendor/django_haystack-3.2.1.dist-info/METADATA +0 -98
- codex/_vendor/django_haystack-3.2.1.dist-info/RECORD +0 -97
- codex/_vendor/django_haystack-3.2.1.dist-info/REQUESTED +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/WHEEL +0 -5
- codex/_vendor/django_haystack-3.2.1.dist-info/top_level.txt +0 -1
- codex/_vendor/haystack/__init__.py +0 -80
- codex/_vendor/haystack/admin.py +0 -163
- codex/_vendor/haystack/apps.py +0 -31
- codex/_vendor/haystack/backends/__init__.py +0 -1109
- codex/_vendor/haystack/backends/elasticsearch2_backend.py +0 -390
- codex/_vendor/haystack/backends/elasticsearch5_backend.py +0 -483
- codex/_vendor/haystack/backends/elasticsearch7_backend.py +0 -586
- codex/_vendor/haystack/backends/elasticsearch_backend.py +0 -1141
- codex/_vendor/haystack/backends/simple_backend.py +0 -132
- codex/_vendor/haystack/backends/solr_backend.py +0 -991
- codex/_vendor/haystack/backends/whoosh_backend.py +0 -1104
- codex/_vendor/haystack/constants.py +0 -57
- codex/_vendor/haystack/exceptions.py +0 -57
- codex/_vendor/haystack/fields.py +0 -562
- codex/_vendor/haystack/forms.py +0 -135
- codex/_vendor/haystack/generic_views.py +0 -141
- codex/_vendor/haystack/indexes.py +0 -548
- codex/_vendor/haystack/inputs.py +0 -169
- codex/_vendor/haystack/management/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/build_solr_schema.py +0 -187
- codex/_vendor/haystack/management/commands/clear_index.py +0 -67
- codex/_vendor/haystack/management/commands/haystack_info.py +0 -22
- codex/_vendor/haystack/management/commands/rebuild_index.py +0 -65
- codex/_vendor/haystack/management/commands/update_index.py +0 -438
- codex/_vendor/haystack/manager.py +0 -105
- codex/_vendor/haystack/models.py +0 -257
- codex/_vendor/haystack/panels.py +0 -89
- codex/_vendor/haystack/query.py +0 -771
- codex/_vendor/haystack/routers.py +0 -14
- codex/_vendor/haystack/signals.py +0 -88
- codex/_vendor/haystack/templates/panels/haystack.html +0 -33
- codex/_vendor/haystack/templates/search_configuration/schema.xml +0 -1056
- codex/_vendor/haystack/templates/search_configuration/solrconfig.xml +0 -1446
- codex/_vendor/haystack/templatetags/__init__.py +0 -0
- codex/_vendor/haystack/templatetags/highlight.py +0 -131
- codex/_vendor/haystack/templatetags/more_like_this.py +0 -119
- codex/_vendor/haystack/urls.py +0 -5
- codex/_vendor/haystack/utils/__init__.py +0 -84
- codex/_vendor/haystack/utils/app_loading.py +0 -34
- codex/_vendor/haystack/utils/geo.py +0 -71
- codex/_vendor/haystack/utils/highlighting.py +0 -165
- codex/_vendor/haystack/utils/loading.py +0 -374
- codex/_vendor/haystack/utils/log.py +0 -21
- codex/_vendor/haystack/version.py +0 -16
- codex/_vendor/haystack/views.py +0 -253
- codex/integrity.py +0 -492
- codex/librarian/search/merge.py +0 -86
- codex/librarian/search/version.py +0 -63
- codex/search/__init__.py +0 -1
- codex/search/backend.py +0 -524
- codex/search/backend_search.py +0 -229
- codex/search/engine.py +0 -33
- codex/search/indexes.py +0 -79
- codex/search/query.py +0 -67
- codex/search/writing.py +0 -180
- codex/serializers/choices.py +0 -196
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js +0 -1
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.gz +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js +0 -1
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js +0 -1
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js +0 -1
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js +0 -1
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js +0 -1
- codex/static_root/assets/VCombobox-Bjp6lffE.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css +0 -1
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css +0 -1
- codex/static_root/assets/VDialog-38np3TSA.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js +0 -1
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js +0 -1
- codex/static_root/assets/VDialog-BkpVGB70.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js +0 -1
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js +0 -1
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js +0 -1
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js +0 -1
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css +0 -1
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css +0 -1
- codex/static_root/assets/VSelect-Ca2bIOso.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js +0 -1
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js +0 -1
- codex/static_root/assets/VSelect-DtvZsYZz.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js +0 -1
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js +0 -1
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css +0 -1
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css +0 -1
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js +0 -1
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js +0 -1
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js +0 -1
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js +0 -1
- codex/static_root/assets/VTable-DXH_yQ0o.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js +0 -1
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js +0 -1
- codex/static_root/assets/VTextField-Blqy56_L.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css +0 -1
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css +0 -1
- codex/static_root/assets/VTextField-Crc3gdNh.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js +0 -1
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js +0 -1
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.gz +0 -0
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.gz +0 -0
- codex/static_root/assets/admin-CWEjaFr5.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.css.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js +0 -1
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js +0 -1
- codex/static_root/assets/admin-DTRn8bBs.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BmhedLCx.7c2103d319d4.css +0 -1
- codex/static_root/assets/confirm-dialog-BmhedLCx.css +0 -1
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js +0 -1
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js +0 -1
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js +0 -1
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js +0 -1
- codex/static_root/assets/datetime-column-BxC1Li9e.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js +0 -1
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.js +0 -1
- codex/static_root/assets/filter-Bzk7x841.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css +0 -1
- codex/static_root/assets/flag-tab-DBqpLKi7.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css +0 -1
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js +0 -1
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js +0 -1
- codex/static_root/assets/group-tab-5esH4lwX.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css +0 -1
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css +0 -1
- codex/static_root/assets/group-tab-CBKuS3Iv.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js +0 -1
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js +0 -1
- codex/static_root/assets/http-error-BTOBfcGY.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.gz +0 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.br +0 -2
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.gz +0 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.css.br +0 -2
- codex/static_root/assets/library-tab-Bh7ErAk7.css.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js +0 -1
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js +0 -1
- codex/static_root/assets/library-tab-DiPEdOF7.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js +0 -1
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js +0 -1
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.css.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js +0 -1
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js +0 -1
- codex/static_root/assets/relation-chips-CUSatZET.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js +0 -2
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js +0 -2
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css +0 -1
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.css +0 -1
- codex/static_root/assets/task-tab-1XiWn9xP.css.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js +0 -1
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js +0 -1
- codex/static_root/assets/task-tab-NORFAa9p.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js +0 -1
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js +0 -1
- codex/static_root/assets/user-tab-CHbyN1EW.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.gz +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json +0 -1
- codex/static_root/js/choices-admin.1a20a5648f20.json.br +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json.gz +0 -0
- codex/static_root/js/choices-admin.json +0 -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.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/js/choices.json +0 -1
- codex/static_root/js/choices.json.br +0 -0
- codex/static_root/js/choices.json.gz +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json +0 -635
- codex/static_root/manifest.0fe31a6cb99f.json.br +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json.gz +0 -0
- codex/templates/search/indexes/codex/comic_text.txt +0 -47
- codex/views/browser/annotations.py +0 -296
- codex/views/browser/base.py +0 -140
- codex/views/browser/filters/annotations.py +0 -103
- codex/views/browser/filters/search.py +0 -196
- codex/views/browser/metadata.py +0 -332
- {codex-1.6.19.dist-info → codex-1.7.0.dist-info}/LICENSE +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0.dist-info}/WHEEL +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0.dist-info}/entry_points.txt +0 -0
codex/views/bookmark.py
CHANGED
|
@@ -1,180 +1,41 @@
|
|
|
1
1
|
"""Bookmark views."""
|
|
2
2
|
|
|
3
|
-
from django.db.models.expressions import F
|
|
4
|
-
from django.db.models.functions import Now
|
|
5
3
|
from drf_spectacular.utils import extend_schema
|
|
6
4
|
from rest_framework.response import Response
|
|
7
5
|
|
|
8
|
-
from codex.librarian.
|
|
9
|
-
from codex.librarian.notifier.tasks import NotifierTask
|
|
6
|
+
from codex.librarian.bookmark.update import BookmarkUpdate
|
|
10
7
|
from codex.logger.logging import get_logger
|
|
11
|
-
from codex.models import Bookmark, Comic
|
|
12
8
|
from codex.serializers.models.bookmark import (
|
|
13
9
|
BookmarkFinishedSerializer,
|
|
14
10
|
BookmarkSerializer,
|
|
15
11
|
)
|
|
16
12
|
from codex.views.auth import (
|
|
13
|
+
AuthFilterAPIView,
|
|
17
14
|
AuthFilterGenericAPIView,
|
|
18
15
|
)
|
|
19
16
|
from codex.views.const import FILTER_ONLY_GROUP_RELATION
|
|
20
17
|
|
|
21
18
|
LOG = get_logger(__name__)
|
|
22
|
-
VERTICAL_READING_DIRECTIONS = frozenset({"ttb", "btt"})
|
|
23
|
-
_BOOKMARK_UPDATE_FIELDS = frozenset(
|
|
24
|
-
{
|
|
25
|
-
"page",
|
|
26
|
-
"finished",
|
|
27
|
-
"fit_to",
|
|
28
|
-
"two_pages",
|
|
29
|
-
"reading_direction",
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
_COMIC_ONLY_FIELDS = ("pk", "page_count")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class BookmarkFilterBaseView(AuthFilterGenericAPIView):
|
|
36
|
-
"""API Views that get Bookmarks."""
|
|
37
19
|
|
|
38
|
-
def get_bookmark_search_kwargs(self, comic_filter=None):
|
|
39
|
-
"""Get the search kwargs for a user's authentication state."""
|
|
40
|
-
search_kwargs = {}
|
|
41
20
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
search_kwargs[f"comic__{key}"] = value
|
|
21
|
+
class BookmarkBaseView(AuthFilterAPIView):
|
|
22
|
+
"""Base class for Bookmark Views."""
|
|
45
23
|
|
|
24
|
+
def get_bookmark_auth_filter(self):
|
|
25
|
+
"""Filter only the user's bookmarks."""
|
|
46
26
|
if self.request.user.is_authenticated:
|
|
47
|
-
|
|
27
|
+
key = "user_id"
|
|
28
|
+
value = self.request.user.pk
|
|
48
29
|
else:
|
|
49
30
|
if not self.request.session or not self.request.session.session_key:
|
|
50
31
|
LOG.debug("no session, make one")
|
|
51
32
|
self.request.session.save()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class BookmarkBaseView(BookmarkFilterBaseView):
|
|
57
|
-
"""Bookmark Updater."""
|
|
58
|
-
|
|
59
|
-
@staticmethod
|
|
60
|
-
def _update_bookmarks_validate_page(bm, updates):
|
|
61
|
-
"""Force bookmark page into valid range."""
|
|
62
|
-
page = updates.get("page")
|
|
63
|
-
if page is None:
|
|
64
|
-
return
|
|
65
|
-
max_page = bm.page_count + 1
|
|
66
|
-
page = max(min(page, max_page), 0)
|
|
67
|
-
if page == max_page:
|
|
68
|
-
# Auto finish on bookmark last page
|
|
69
|
-
bm.finished = True
|
|
70
|
-
updates["page"] = page
|
|
71
|
-
|
|
72
|
-
@staticmethod
|
|
73
|
-
def _update_bookmarks_validate_two_pages(bm, updates):
|
|
74
|
-
"""Force vertical view to not use two pages."""
|
|
75
|
-
rd = updates.get("reading_direction")
|
|
76
|
-
if (
|
|
77
|
-
bm.two_pages
|
|
78
|
-
and rd in VERTICAL_READING_DIRECTIONS
|
|
79
|
-
or bm.reading_direction in VERTICAL_READING_DIRECTIONS
|
|
80
|
-
):
|
|
81
|
-
updates["two_pages"] = None
|
|
82
|
-
|
|
83
|
-
def notify_library_changed(self):
|
|
84
|
-
"""Notify one user that their library changed."""
|
|
85
|
-
if user := self.request.user:
|
|
86
|
-
uid = user.id # type: ignore
|
|
87
|
-
else:
|
|
88
|
-
uid = self.request.session.session_key
|
|
89
|
-
group = f"user_{uid}"
|
|
90
|
-
task = NotifierTask("LIBRARY_CHANGED", group)
|
|
91
|
-
LIBRARIAN_QUEUE.put(task)
|
|
33
|
+
key = "session_id"
|
|
34
|
+
value = self.request.session.session_key
|
|
35
|
+
return {key: value}
|
|
92
36
|
|
|
93
|
-
def _update_bookmarks(self, search_kwargs, updates):
|
|
94
|
-
"""Update existing bookmarks."""
|
|
95
|
-
count = 0
|
|
96
|
-
finished = False
|
|
97
|
-
if not updates:
|
|
98
|
-
return count, finished
|
|
99
|
-
group_acl_filter = self.get_group_acl_filter(Bookmark)
|
|
100
|
-
update_fields = set(updates.keys()) & _BOOKMARK_UPDATE_FIELDS
|
|
101
|
-
update_fields.add("updated_at")
|
|
102
|
-
only_fields = (*update_fields, "pk")
|
|
103
|
-
existing_bookmarks = Bookmark.objects.filter(group_acl_filter).filter(
|
|
104
|
-
**search_kwargs
|
|
105
|
-
)
|
|
106
|
-
if updates.get("page") is not None:
|
|
107
|
-
existing_bookmarks = existing_bookmarks.annotate(
|
|
108
|
-
page_count=F("comic__page_count")
|
|
109
|
-
)
|
|
110
|
-
existing_bookmarks = existing_bookmarks.only(*only_fields)
|
|
111
|
-
update_bookmarks = []
|
|
112
|
-
for bm in existing_bookmarks:
|
|
113
|
-
self._update_bookmarks_validate_page(bm, updates)
|
|
114
|
-
self._update_bookmarks_validate_two_pages(bm, updates)
|
|
115
|
-
for key, value in updates.items():
|
|
116
|
-
setattr(bm, key, value)
|
|
117
|
-
bm.updated_at = Now()
|
|
118
|
-
update_bookmarks.append(bm)
|
|
119
|
-
count = len(update_bookmarks)
|
|
120
|
-
if count:
|
|
121
|
-
Bookmark.objects.bulk_update(update_bookmarks, tuple(update_fields))
|
|
122
|
-
return count
|
|
123
37
|
|
|
124
|
-
|
|
125
|
-
def _create_bookmarks_validate_two_pages(updates):
|
|
126
|
-
"""Force vertical view to not use two pages."""
|
|
127
|
-
if (
|
|
128
|
-
updates.get("two_pages")
|
|
129
|
-
and updates.get("reading_direction") in VERTICAL_READING_DIRECTIONS
|
|
130
|
-
):
|
|
131
|
-
updates.pop("two_pages", None)
|
|
132
|
-
|
|
133
|
-
def _create_bookmarks(self, comic_filter, search_kwargs, updates):
|
|
134
|
-
"""Create new bookmarks for comics that don't exist yet."""
|
|
135
|
-
count = 0
|
|
136
|
-
self._create_bookmarks_validate_two_pages(updates)
|
|
137
|
-
if not updates:
|
|
138
|
-
return count
|
|
139
|
-
create_bookmarks = []
|
|
140
|
-
group_acl_filter = self.get_group_acl_filter(Comic)
|
|
141
|
-
exclude = {}
|
|
142
|
-
for key, value in search_kwargs.items():
|
|
143
|
-
exclude["bookmark__" + key] = value
|
|
144
|
-
create_bookmark_comics = (
|
|
145
|
-
Comic.objects.filter(group_acl_filter)
|
|
146
|
-
.filter(**comic_filter)
|
|
147
|
-
.exclude(**exclude)
|
|
148
|
-
.only(*_COMIC_ONLY_FIELDS)
|
|
149
|
-
)
|
|
150
|
-
for comic in create_bookmark_comics:
|
|
151
|
-
defaults = {"comic": comic}
|
|
152
|
-
defaults.update(updates)
|
|
153
|
-
for key, value in search_kwargs.items():
|
|
154
|
-
if not key.startswith("comic"):
|
|
155
|
-
defaults[key] = value
|
|
156
|
-
|
|
157
|
-
bm = Bookmark(**defaults)
|
|
158
|
-
create_bookmarks.append(bm)
|
|
159
|
-
count = len(create_bookmarks)
|
|
160
|
-
if count:
|
|
161
|
-
Bookmark.objects.bulk_create(
|
|
162
|
-
create_bookmarks,
|
|
163
|
-
update_fields=tuple(_BOOKMARK_UPDATE_FIELDS),
|
|
164
|
-
unique_fields=Bookmark._meta.unique_together[0], # type: ignore
|
|
165
|
-
)
|
|
166
|
-
return count
|
|
167
|
-
|
|
168
|
-
def update_bookmarks(self, updates, comic_filter):
|
|
169
|
-
"""Update a user bookmark."""
|
|
170
|
-
search_kwargs = self.get_bookmark_search_kwargs(comic_filter)
|
|
171
|
-
count = self._update_bookmarks(search_kwargs, updates)
|
|
172
|
-
count = +self._create_bookmarks(comic_filter, search_kwargs, updates)
|
|
173
|
-
if count:
|
|
174
|
-
self.notify_library_changed()
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
class BookmarkView(BookmarkBaseView):
|
|
38
|
+
class BookmarkView(AuthFilterGenericAPIView, BookmarkBaseView, BookmarkUpdate):
|
|
178
39
|
"""User Bookmark View."""
|
|
179
40
|
|
|
180
41
|
serializer_class = BookmarkSerializer
|
|
@@ -198,10 +59,12 @@ class BookmarkView(BookmarkBaseView):
|
|
|
198
59
|
"""Update bookmarks recursively."""
|
|
199
60
|
updates = self._parse_params()
|
|
200
61
|
|
|
62
|
+
auth_filter = self.get_bookmark_auth_filter()
|
|
63
|
+
|
|
201
64
|
group = self.kwargs.get("group")
|
|
202
|
-
pks = self.kwargs.get("pks")
|
|
203
65
|
rel = FILTER_ONLY_GROUP_RELATION[group] + "__in"
|
|
66
|
+
pks = self.kwargs.get("pks")
|
|
204
67
|
comic_filter = {rel: pks}
|
|
205
68
|
|
|
206
|
-
self.update_bookmarks(
|
|
69
|
+
self.update_bookmarks(auth_filter, comic_filter, updates)
|
|
207
70
|
return Response()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Browser annotation methods."""
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""Base view for metadata annotations."""
|
|
2
|
+
|
|
3
|
+
from django.db.models import (
|
|
4
|
+
Case,
|
|
5
|
+
F,
|
|
6
|
+
Sum,
|
|
7
|
+
Value,
|
|
8
|
+
When,
|
|
9
|
+
)
|
|
10
|
+
from django.db.models.fields import BooleanField, PositiveSmallIntegerField
|
|
11
|
+
from django.db.models.functions import Least
|
|
12
|
+
from django.db.models.functions.comparison import Coalesce
|
|
13
|
+
|
|
14
|
+
from codex.logger.logging import get_logger
|
|
15
|
+
from codex.models import (
|
|
16
|
+
Comic,
|
|
17
|
+
)
|
|
18
|
+
from codex.models.functions import JsonGroupArray
|
|
19
|
+
from codex.views.browser.annotate.order import BrowserAnnotateOrderView
|
|
20
|
+
|
|
21
|
+
LOG = get_logger(__name__)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class BrowserAnnotateBookmarkView(BrowserAnnotateOrderView):
|
|
25
|
+
"""Base class for views that need special metadata annotations."""
|
|
26
|
+
|
|
27
|
+
def _get_group_bookmark_page_annotation(
|
|
28
|
+
self, qs, bm_rel, bm_filter, page_rel, finished_rel
|
|
29
|
+
):
|
|
30
|
+
"""Get bookmark page subquery."""
|
|
31
|
+
finished_filter = {finished_rel: True}
|
|
32
|
+
prefix = "" if qs.model is Comic else self.rel_prefix
|
|
33
|
+
page_count = prefix + "page_count"
|
|
34
|
+
# Can't use a filtered relation for page & finished because of this
|
|
35
|
+
# page_count case.
|
|
36
|
+
bookmark_page_case = Case(
|
|
37
|
+
When(**{bm_rel: None}, then=0),
|
|
38
|
+
When(**finished_filter, then=page_count),
|
|
39
|
+
default=page_rel,
|
|
40
|
+
output_field=PositiveSmallIntegerField(),
|
|
41
|
+
)
|
|
42
|
+
return Sum(
|
|
43
|
+
bookmark_page_case,
|
|
44
|
+
default=0,
|
|
45
|
+
filter=bm_filter,
|
|
46
|
+
output_field=PositiveSmallIntegerField(),
|
|
47
|
+
distinct=True,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def _get_group_bookmark_finished_annotation(cls, qs, bm_filter, finished_rel):
|
|
52
|
+
"""Get finished_count subquery."""
|
|
53
|
+
finished_count = Sum(
|
|
54
|
+
finished_rel,
|
|
55
|
+
default=0,
|
|
56
|
+
filter=bm_filter,
|
|
57
|
+
output_field=PositiveSmallIntegerField(),
|
|
58
|
+
# distinct breaks this sum and only returns one. idk why.
|
|
59
|
+
)
|
|
60
|
+
qs = qs.alias(finished_count=finished_count)
|
|
61
|
+
|
|
62
|
+
finished_aggregate = Case(
|
|
63
|
+
When(finished_count=F("child_count"), then=True),
|
|
64
|
+
When(finished_count=0, then=False),
|
|
65
|
+
default=None,
|
|
66
|
+
output_field=BooleanField(),
|
|
67
|
+
)
|
|
68
|
+
return qs, finished_aggregate
|
|
69
|
+
|
|
70
|
+
def annotate_bookmarks(self, qs):
|
|
71
|
+
"""Hoist up bookmark annotations."""
|
|
72
|
+
bm_rel = self._get_bm_rel(qs.model)
|
|
73
|
+
bm_filter = self._get_my_bookmark_filter(bm_rel)
|
|
74
|
+
page_rel = f"{bm_rel}__page"
|
|
75
|
+
finished_rel = f"{bm_rel}__finished"
|
|
76
|
+
|
|
77
|
+
if qs.model is Comic:
|
|
78
|
+
bookmark_page = Sum(page_rel, filter=bm_filter, default=0)
|
|
79
|
+
finished_aggregate = Sum(finished_rel, filter=bm_filter, default=False)
|
|
80
|
+
else:
|
|
81
|
+
bookmark_page = self._get_group_bookmark_page_annotation(
|
|
82
|
+
qs, bm_rel, bm_filter, page_rel, finished_rel
|
|
83
|
+
)
|
|
84
|
+
qs, finished_aggregate = self._get_group_bookmark_finished_annotation(
|
|
85
|
+
qs, bm_filter, finished_rel
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
if (
|
|
89
|
+
(self.TARGET == "browser" and qs.model is Comic)
|
|
90
|
+
or self.is_opds_acquisition
|
|
91
|
+
or self.TARGET == "metadata"
|
|
92
|
+
):
|
|
93
|
+
qs = qs.annotate(page=bookmark_page)
|
|
94
|
+
else:
|
|
95
|
+
qs = qs.alias(page=bookmark_page)
|
|
96
|
+
|
|
97
|
+
qs = qs.annotate(finished=finished_aggregate)
|
|
98
|
+
|
|
99
|
+
if not self.bmua_is_max:
|
|
100
|
+
mbmua = self.get_max_bookmark_updated_at_aggregate(qs.model, JsonGroupArray)
|
|
101
|
+
qs = qs.annotate(bookmark_updated_ats=mbmua)
|
|
102
|
+
return qs
|
|
103
|
+
|
|
104
|
+
def annotate_progress(self, qs):
|
|
105
|
+
"""Compute progress for each member of a qs."""
|
|
106
|
+
# Requires bookmark and annotation hoisted from bookmarks.
|
|
107
|
+
# Requires page_count native to comic or aggregated
|
|
108
|
+
# Page counts can be null with metadata turned off.
|
|
109
|
+
# Least guard is for rare instances when bookmarks are set to
|
|
110
|
+
# invalid high values
|
|
111
|
+
progress = Least(Coalesce(F("page"), 0) * 100.0 / F("page_count"), Value(100.0))
|
|
112
|
+
return qs.annotate(progress=progress)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Base view for metadata annotations."""
|
|
2
|
+
|
|
3
|
+
from types import MappingProxyType
|
|
4
|
+
|
|
5
|
+
from django.db.models import (
|
|
6
|
+
Value,
|
|
7
|
+
)
|
|
8
|
+
from django.db.models.aggregates import Count
|
|
9
|
+
from django.db.models.fields import CharField
|
|
10
|
+
|
|
11
|
+
from codex.logger.logging import get_logger
|
|
12
|
+
from codex.models.comic import Comic
|
|
13
|
+
from codex.models.functions import JsonGroupArray
|
|
14
|
+
from codex.models.groups import BrowserGroupModel, Imprint, Publisher, Series, Volume
|
|
15
|
+
from codex.views.browser.annotate.bookmark import BrowserAnnotateBookmarkView
|
|
16
|
+
|
|
17
|
+
_GROUP_BY: MappingProxyType[type[BrowserGroupModel], str] = MappingProxyType(
|
|
18
|
+
{Publisher: "sort_name", Imprint: "sort_name", Series: "sort_name", Volume: "name"}
|
|
19
|
+
)
|
|
20
|
+
LOG = get_logger(__name__)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BrowserAnnotateCardView(BrowserAnnotateBookmarkView):
|
|
24
|
+
"""Base class for views that need special metadata annotations."""
|
|
25
|
+
|
|
26
|
+
def add_group_by(self, qs):
|
|
27
|
+
"""Get the group by for the model."""
|
|
28
|
+
if group_by := _GROUP_BY.get(qs.model): # type: ignore
|
|
29
|
+
qs = qs.group_by(group_by)
|
|
30
|
+
return qs
|
|
31
|
+
|
|
32
|
+
def _annotate_child_count(self, qs):
|
|
33
|
+
"""Annotate child chount for card."""
|
|
34
|
+
if qs.model is Comic:
|
|
35
|
+
return qs
|
|
36
|
+
rel = self.rel_prefix + "pk"
|
|
37
|
+
count_func = Count(rel, distinct=True)
|
|
38
|
+
ann = {"child_count": count_func}
|
|
39
|
+
if self.TARGET == "opds2":
|
|
40
|
+
if qs.model is not Comic:
|
|
41
|
+
qs = qs.alias(**ann)
|
|
42
|
+
else:
|
|
43
|
+
qs = qs.annotate(**ann)
|
|
44
|
+
return qs
|
|
45
|
+
|
|
46
|
+
def _annotate_group(self, qs):
|
|
47
|
+
"""Annotate Group."""
|
|
48
|
+
value = "c" if qs.model is Comic else self.model_group # type: ignore
|
|
49
|
+
return qs.annotate(group=Value(value, CharField(max_length=1)))
|
|
50
|
+
|
|
51
|
+
def annotate_card_aggregates(self, qs):
|
|
52
|
+
"""Annotate aggregates that appear the browser card."""
|
|
53
|
+
if qs.model is Comic:
|
|
54
|
+
# comic adds order_value for cards late
|
|
55
|
+
qs = self.annotate_order_value(qs)
|
|
56
|
+
qs = self._annotate_group(qs)
|
|
57
|
+
qs = self.annotate_group_names(qs)
|
|
58
|
+
qs = self._annotate_child_count(qs)
|
|
59
|
+
qs = self.annotate_bookmarks(qs)
|
|
60
|
+
qs = self.annotate_progress(qs)
|
|
61
|
+
return qs.annotate(updated_ats=JsonGroupArray("updated_at", distinct=True))
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"""Base view for metadata annotations."""
|
|
2
|
+
|
|
3
|
+
from os import sep
|
|
4
|
+
from types import MappingProxyType
|
|
5
|
+
|
|
6
|
+
from django.db.models import (
|
|
7
|
+
F,
|
|
8
|
+
FilteredRelation,
|
|
9
|
+
Q,
|
|
10
|
+
Value,
|
|
11
|
+
)
|
|
12
|
+
from django.db.models.aggregates import Avg, Max, Min, Sum
|
|
13
|
+
from django.db.models.fields import CharField
|
|
14
|
+
from django.db.models.functions import Reverse, Right, StrIndex
|
|
15
|
+
|
|
16
|
+
from codex.logger.logging import get_logger
|
|
17
|
+
from codex.models import (
|
|
18
|
+
Comic,
|
|
19
|
+
Folder,
|
|
20
|
+
StoryArc,
|
|
21
|
+
)
|
|
22
|
+
from codex.models.functions import ComicFTSRank, JsonGroupArray
|
|
23
|
+
from codex.views.browser.order_by import (
|
|
24
|
+
BrowserOrderByView,
|
|
25
|
+
)
|
|
26
|
+
from codex.views.const import (
|
|
27
|
+
NONE_INTEGERFIELD,
|
|
28
|
+
STORY_ARC_GROUP,
|
|
29
|
+
)
|
|
30
|
+
from codex.views.mixins import SharedAnnotationsMixin
|
|
31
|
+
|
|
32
|
+
_ORDER_AGGREGATE_FUNCS = MappingProxyType(
|
|
33
|
+
# These are annotated to order_value because they're simple relations
|
|
34
|
+
{
|
|
35
|
+
"age_rating": Avg,
|
|
36
|
+
"community_rating": Avg,
|
|
37
|
+
"created_at": Min,
|
|
38
|
+
"critical_rating": Avg,
|
|
39
|
+
"date": Min,
|
|
40
|
+
"page_count": Sum,
|
|
41
|
+
"size": Sum,
|
|
42
|
+
"updated_at": Min,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
_ANNOTATED_ORDER_FIELDS = frozenset(
|
|
46
|
+
# These are annotated with their own functions
|
|
47
|
+
{
|
|
48
|
+
"filename",
|
|
49
|
+
"sort_name",
|
|
50
|
+
"search_score",
|
|
51
|
+
"bookmark_updated_at",
|
|
52
|
+
"story_arc_number",
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
LOG = get_logger(__name__)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class BrowserAnnotateOrderView(BrowserOrderByView, SharedAnnotationsMixin):
|
|
60
|
+
"""Base class for views that need special metadata annotations."""
|
|
61
|
+
|
|
62
|
+
CARD_TARGETS = frozenset({"browser", "metadata"})
|
|
63
|
+
_OPDS_TARGETS = frozenset({"opds1", "opds2"})
|
|
64
|
+
_PAGE_COUNT_TARGETS = frozenset(CARD_TARGETS | _OPDS_TARGETS)
|
|
65
|
+
_COVER_AND_CARD_TARGETS = frozenset(CARD_TARGETS | {"cover"})
|
|
66
|
+
|
|
67
|
+
def __init__(self, *args, **kwargs):
|
|
68
|
+
"""Set params for the type checker."""
|
|
69
|
+
super().__init__(*args, **kwargs)
|
|
70
|
+
self._order_agg_func: type[Min | Max] | None = None
|
|
71
|
+
self._is_opds_acquisition: bool | None = None
|
|
72
|
+
self._opds_acquisition_groups: frozenset[str] | None = None
|
|
73
|
+
self.bmua_is_max = False
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def opds_acquisition_groups(self):
|
|
77
|
+
"""Memoize the opds acquisition groups."""
|
|
78
|
+
if self._opds_acquisition_groups is None:
|
|
79
|
+
groups = {"a", "f", "c"}
|
|
80
|
+
groups |= {*self.valid_nav_groups[-2:]}
|
|
81
|
+
self._opds_acquisition_groups = frozenset(groups)
|
|
82
|
+
return self._opds_acquisition_groups
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def is_opds_acquisition(self):
|
|
86
|
+
"""Memoize if we're in an opds acquisition view."""
|
|
87
|
+
if self._is_opds_acquisition is None:
|
|
88
|
+
is_opds_acquisition = self.TARGET in self._OPDS_TARGETS
|
|
89
|
+
if is_opds_acquisition:
|
|
90
|
+
group = self.kwargs.get("group")
|
|
91
|
+
is_opds_acquisition &= group in self.opds_acquisition_groups
|
|
92
|
+
if is_opds_acquisition and group == "a":
|
|
93
|
+
pks = self.kwargs["pks"]
|
|
94
|
+
is_opds_acquisition &= bool(pks and 0 not in pks)
|
|
95
|
+
self._is_opds_acquisition = is_opds_acquisition
|
|
96
|
+
return self._is_opds_acquisition
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def order_agg_func(self):
|
|
100
|
+
"""Get the order aggregate function."""
|
|
101
|
+
if self._order_agg_func is None:
|
|
102
|
+
order_reverse = self.params.get("order_reverse")
|
|
103
|
+
self._order_agg_func = Max if order_reverse else Min
|
|
104
|
+
return self._order_agg_func
|
|
105
|
+
|
|
106
|
+
def _alias_sort_names(self, qs):
|
|
107
|
+
"""Annotate sort_name."""
|
|
108
|
+
if self.order_key != "sort_name" and not (
|
|
109
|
+
qs.model is StoryArc and self.order_key == "story_arc_number"
|
|
110
|
+
):
|
|
111
|
+
return qs
|
|
112
|
+
pks = self.kwargs.get("pks")
|
|
113
|
+
show = MappingProxyType(self.params["show"]) # type: ignore
|
|
114
|
+
# TODO too many annotations for order?
|
|
115
|
+
# Move other annotations to card.
|
|
116
|
+
# eager publisher for imprint of course
|
|
117
|
+
sort_name_annotations = self.get_sort_name_annotations(
|
|
118
|
+
qs.model, self.model_group, pks, show
|
|
119
|
+
)
|
|
120
|
+
if sort_name_annotations:
|
|
121
|
+
qs = qs.alias(**sort_name_annotations)
|
|
122
|
+
if qs.model is Comic:
|
|
123
|
+
self._comic_sort_names = tuple(sort_name_annotations.keys())
|
|
124
|
+
return qs
|
|
125
|
+
|
|
126
|
+
def _alias_filename(self, qs):
|
|
127
|
+
"""Calculate filename from path in the db."""
|
|
128
|
+
if self.order_key != "filename":
|
|
129
|
+
return qs
|
|
130
|
+
if qs.model is Folder:
|
|
131
|
+
filename = F("name")
|
|
132
|
+
else:
|
|
133
|
+
prefix = "" if qs.model == Comic else self.rel_prefix
|
|
134
|
+
path_rel = prefix + "path"
|
|
135
|
+
filename = self.order_agg_func(
|
|
136
|
+
Right(
|
|
137
|
+
path_rel,
|
|
138
|
+
StrIndex(Reverse(F(path_rel)), Value(sep)) - 1, # type: ignore
|
|
139
|
+
output_field=CharField(),
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
return qs.alias(filename=filename)
|
|
143
|
+
|
|
144
|
+
def _alias_story_arc_number(self, qs):
|
|
145
|
+
if self.order_key != "story_arc_number":
|
|
146
|
+
return qs
|
|
147
|
+
|
|
148
|
+
# Get story_arc__pk
|
|
149
|
+
group = self.kwargs["group"]
|
|
150
|
+
pks = self.kwargs["pks"]
|
|
151
|
+
if group == STORY_ARC_GROUP and pks:
|
|
152
|
+
story_arc_pks = pks
|
|
153
|
+
else:
|
|
154
|
+
story_arc_pks = self.params.get("filters", {}).get( # type: ignore
|
|
155
|
+
"story_arcs", ()
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# If we have one annotate it.
|
|
159
|
+
if story_arc_pks:
|
|
160
|
+
rel = self.get_rel_prefix(qs.model) + "story_arc_numbers"
|
|
161
|
+
condition_rel = "pk" if qs.model is StoryArc else rel + "__story_arc"
|
|
162
|
+
condition = Q(**{f"{condition_rel}__in": story_arc_pks})
|
|
163
|
+
qs = qs.alias(
|
|
164
|
+
selected_story_arc_number=FilteredRelation(rel, condition=condition),
|
|
165
|
+
)
|
|
166
|
+
story_arc_number = self.order_agg_func("selected_story_arc_number__number")
|
|
167
|
+
else:
|
|
168
|
+
story_arc_number = NONE_INTEGERFIELD
|
|
169
|
+
|
|
170
|
+
return qs.alias(story_arc_number=story_arc_number)
|
|
171
|
+
|
|
172
|
+
def _annotate_page_count(self, qs):
|
|
173
|
+
"""Hoist up total page_count of children."""
|
|
174
|
+
# Used for sorting and progress
|
|
175
|
+
if qs.model is Comic or (
|
|
176
|
+
self.order_key != "page_count"
|
|
177
|
+
and self.TARGET not in self._PAGE_COUNT_TARGETS
|
|
178
|
+
):
|
|
179
|
+
return qs
|
|
180
|
+
|
|
181
|
+
rel = self.rel_prefix + "page_count"
|
|
182
|
+
page_count_sum = Sum(rel, distinct=True)
|
|
183
|
+
if self.TARGET == "browser":
|
|
184
|
+
qs = qs.alias(page_count=page_count_sum)
|
|
185
|
+
else:
|
|
186
|
+
qs = qs.annotate(page_count=page_count_sum)
|
|
187
|
+
return qs
|
|
188
|
+
|
|
189
|
+
def _annotate_bookmark_updated_at(self, qs):
|
|
190
|
+
if self.is_opds_acquisition or self.order_key == "bookmark_updated_at":
|
|
191
|
+
bmua_agg = self.get_max_bookmark_updated_at_aggregate(
|
|
192
|
+
qs.model, agg_func=self.order_agg_func
|
|
193
|
+
)
|
|
194
|
+
# This is used by annotate.bookmark to avoid a
|
|
195
|
+
# similar query.
|
|
196
|
+
self.bmua_is_max = self.order_agg_func is Max
|
|
197
|
+
qs = qs.annotate(bookmark_updated_at=bmua_agg)
|
|
198
|
+
# This is used by the serializer to compute mtime
|
|
199
|
+
return qs.annotate(bmua_is_max=Value(self.bmua_is_max))
|
|
200
|
+
|
|
201
|
+
def annotate_order_value(self, qs):
|
|
202
|
+
"""Annotate a main key for sorting and browser card display."""
|
|
203
|
+
# Determine order func
|
|
204
|
+
if self.TARGET == "metadata":
|
|
205
|
+
return qs
|
|
206
|
+
if qs.model is Folder and self.order_key == "filename":
|
|
207
|
+
order_value = F("name")
|
|
208
|
+
elif qs.model is Comic or self.order_key in _ANNOTATED_ORDER_FIELDS:
|
|
209
|
+
# These are annotated in browser_annotaions
|
|
210
|
+
order_value = F(self.order_key)
|
|
211
|
+
else:
|
|
212
|
+
agg_func = _ORDER_AGGREGATE_FUNCS[self.order_key]
|
|
213
|
+
agg_func = self.order_agg_func if agg_func == Min else agg_func
|
|
214
|
+
field = self.rel_prefix + self.order_key
|
|
215
|
+
order_value = agg_func(field)
|
|
216
|
+
|
|
217
|
+
if self.TARGET == "browser":
|
|
218
|
+
qs = qs.annotate(order_value=order_value)
|
|
219
|
+
else:
|
|
220
|
+
qs = qs.alias(order_value=order_value)
|
|
221
|
+
return qs
|
|
222
|
+
|
|
223
|
+
def _annotate_search_scores(self, qs):
|
|
224
|
+
"""Annotate Search Scores."""
|
|
225
|
+
if (
|
|
226
|
+
self.TARGET not in self._COVER_AND_CARD_TARGETS
|
|
227
|
+
or self.order_key != "search_score"
|
|
228
|
+
):
|
|
229
|
+
return qs
|
|
230
|
+
|
|
231
|
+
# Rank is always the max of the relations, cannot aggregate?
|
|
232
|
+
# group by here fixes duplicates with story_arc, probably because it's a long relation
|
|
233
|
+
return qs.annotate(search_score=ComicFTSRank()).group_by("id")
|
|
234
|
+
|
|
235
|
+
def annotate_order_aggregates(self, qs):
|
|
236
|
+
"""Annotate common aggregates between browser and metadata."""
|
|
237
|
+
qs = qs.annotate(ids=JsonGroupArray("id", distinct=True))
|
|
238
|
+
qs = self._annotate_search_scores(qs)
|
|
239
|
+
qs = self._alias_sort_names(qs)
|
|
240
|
+
qs = self._alias_filename(qs)
|
|
241
|
+
qs = self._alias_story_arc_number(qs)
|
|
242
|
+
qs = self._annotate_page_count(qs)
|
|
243
|
+
qs = self._annotate_bookmark_updated_at(qs)
|
|
244
|
+
if qs.model is not Comic:
|
|
245
|
+
# comic orders on indexed fields when it can
|
|
246
|
+
qs = self.annotate_order_value(qs)
|
|
247
|
+
return qs
|