Skip to content

Commit 8ca5039

Browse files
authored
v0.10.8 (#178)
1 parent 7befbe1 commit 8ca5039

40 files changed

+1756
-1055
lines changed

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
.pytest_cache
55
.venv
66
/config
7+
/node_modules
78
/test-results
89
__pycache__
910
cache
1011
codex/_vendor/haystack
1112
codex/static_build
1213
codex/static_root
14+
codex/templates/*.xml
15+
codex/templates/admin/codex/queuejob/change_list.html
16+
codex/templates/site.webmanifest
1317
comics
1418
frontend
15-
/node_modules
16-
templates
1719
webpack-stats.json

NEWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# 📰 Codex News
22

3+
## v0.10.8
4+
5+
- Fixes
6+
7+
- Fixed reader nav clicks always showing the toolbars.
8+
- Attempt to fix unwanted browser toolbars when treated as mobile app
9+
- Wait half a second before displaying reader placeholder spinner.
10+
- Fix metadata missing search query.
11+
- Fix metadata cache busting.
12+
13+
- Features
14+
15+
- Accessibility enhancements for screen readers.
16+
317
## v0.10.7
418

519
- Features

codex/librarian/db/updaterd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ def _apply(task):
182182
if changed:
183183
LIBRARIAN_QUEUE.put(BroadcastNotifierTask("LIBRARY_CHANGED"))
184184
elapsed_time = time.time() - start_time
185-
LOG.info(f"Updated library {library.path} in {precisedelta(elapsed_time)}.")
185+
LOG.info(
186+
f"Updated library {library.path} in {precisedelta(int(elapsed_time))}."
187+
)
186188
suffix = ""
187189
if imported_count:
188190
cps = int(imported_count / elapsed_time)

codex/librarian/janitor/crond.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _get_timeout():
5656
next_midnight = datetime.combine(tomorrow, time.min).astimezone()
5757
delta = next_midnight - now
5858
seconds = max(0, delta.total_seconds())
59-
return seconds
59+
return int(seconds)
6060

6161
def run(self):
6262
"""Watch a path and log the events."""

codex/librarian/watchdog/emitter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ def queue_events(self, timeout=None):
184184
# timeout behaves like an interval for polling emitters.
185185
try:
186186
with self._poll_cond:
187-
LOG.verbose(
188-
f"Polling {self.watch.path} again in {precisedelta(timeout)}."
189-
)
187+
if timeout:
188+
LOG.verbose(
189+
f"Polling {self.watch.path} again in {precisedelta(timeout)}."
190+
)
190191
self._poll_cond.wait(timeout)
191192
if not self.should_keep_running():
192193
return

codex/static_src/admin/css/codex-admin.css

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.caps {
2+
font-variant-caps: small-caps;
3+
}
14
/* Dirty hack for django admin's refusal to display non-editable fields */
25
.field-last_poll .vDateField,
36
.field-last_poll .vTimeField {
@@ -6,7 +9,6 @@
69
-ms-user-select: none;
710
user-select: none;
811
}
9-
1012
.field-last_poll .datetimeshortcuts {
1113
display: none;
1214
}
@@ -24,3 +26,23 @@
2426
#footer > h2 {
2527
color: #ccc;
2628
}
29+
30+
/* Queue Jobs */
31+
table.queueJobs {
32+
}
33+
table.queueJobs th {
34+
background-color: #242424;
35+
font-size: large;
36+
padding-top: 20px;
37+
padding-bottom: 10px;
38+
}
39+
table.queueJobs td {
40+
padding-left: 0.25em;
41+
padding-right: 0px;
42+
}
43+
table.queueJobs td:nth-child(3) {
44+
color: darkgray;
45+
}
46+
#queueJobButton {
47+
margin-top: 20px;
48+
}
Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
{% extends "admin/base_site.html" %}
2-
{% load static %}
3-
{% block title %}Codex Administration{% endblock %}
4-
5-
{% block extrastyle %}
6-
<link href="{% static 'admin/css/dark.css' %}" type="text/css" media="(prefers-color-scheme: dark)" rel="stylesheet">
7-
<link href="{% static 'admin/css/codex-admin-dark.css' %}" type="text/css" rel="stylesheet">
8-
<link href="{% static 'admin/css/codex-admin.css' %}" rel="stylesheet" type="text/css">
9-
{% block extrapagestyle %}{% endblock %}
10-
{% endblock %}
11-
12-
{% block branding %}
13-
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ _('Codex administration') }}</a></h1>
1+
{% extends "admin/base_site.html" %} {% load static %} {% block title %}Codex
2+
Administration{% endblock %} {% block extrastyle %}
3+
<link
4+
href="{% static 'admin/css/dark.css' %}"
5+
type="text/css"
6+
media="(prefers-color-scheme: dark)"
7+
rel="stylesheet"
8+
/>
9+
<link
10+
href="{% static 'admin/css/codex-admin-dark.css' %}"
11+
type="text/css"
12+
rel="stylesheet"
13+
/>
14+
<link
15+
href="{% static 'admin/css/codex-admin.css' %}"
16+
rel="stylesheet"
17+
type="text/css"
18+
/>
19+
{% block extrapagestyle %}{% endblock %} {% endblock %} {% block branding %}
20+
<h1 id="site-name">
21+
<a href="{% url 'admin:index' %}">{{ _('Codex administration') }}</a>
22+
</h1>
1423
{% endblock %}
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
{% extends "admin/change_list.html" %}
2-
3-
{% block footer %}
1+
{% extends "admin/change_list.html" %} {% block footer %}
42
<div id="footer">
5-
<h1>Admin Flags</h1>
6-
Administration Flags that effect the operation of the entire site.
7-
<h2>Enable Auto Update</h2>
8-
If enabled, codex will attempt to update the codex python package once a day and restart the server if an update occurred. <strong>Not advisable if running from Docker</strong> as running containers aren't meant to hold state and will be rebuilt if you update the image. Look into <a href="https://containrrr.dev/watchtower/">Watchtower</a> for automating Docker updates.
9-
<h2>Enable Non Users</h2>
10-
By default all Codex features, including bookmarking, are available to users who are not logged in. You may disable this feature and Codex will hide its browser and reader and disable its API from anyone who is not logged in as a user.
11-
<h2>Enable Registration</h2>
12-
By default users bookmarks and preferences are saved in an anonymous browser session. Users can create a username and password to save their bookmarks in between browsers. You may disable this feature. Admins may still create users using this Admin Panel.
13-
<h2>Enable Folder View</h2>
14-
By default, codex provides a "Folder View" which mimics the directory hierarchy of the libraries that you've added to Codex. You may disable this feature. The database style browser view is always available. This flag also enables and disables the "Filename" sort option.
3+
<h1>Admin Flags</h1>
4+
Administration Flags that effect the operation of the entire site.
5+
<h2>Enable Auto Update</h2>
6+
If enabled, codex will attempt to update the codex python package once a day
7+
and restart the server if an update occurred.
8+
<strong>Not advisable if running from Docker</strong> as running containers
9+
aren't meant to hold state and will be rebuilt if you update the image. Look
10+
into <a href="https://containrrr.dev/watchtower/">Watchtower</a> for
11+
automating Docker updates.
12+
<h2>Enable Non Users</h2>
13+
By default all Codex features, including bookmarking, are available to users
14+
who are not logged in. You may disable this feature and Codex will hide its
15+
browser and reader and disable its API from anyone who is not logged in as a
16+
user.
17+
<h2>Enable Registration</h2>
18+
By default users bookmarks and preferences are saved in an anonymous browser
19+
session. Users can create a username and password to save their bookmarks in
20+
between browsers. You may disable this feature. Admins may still create users
21+
using this Admin Panel.
22+
<h2>Enable Folder View</h2>
23+
By default, codex provides a "Folder View" which mimics the directory
24+
hierarchy of the libraries that you've added to Codex. You may disable this
25+
feature. The database style browser view is always available. This flag also
26+
enables and disables the "Filename" sort option.
1527
</div>
1628
{% endblock %}
Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1-
{% extends "admin/change_list.html" %}
2-
3-
{% block footer %}
1+
{% extends "admin/change_list.html" %} {% block footer %}
42
<div id="footer">
5-
<h1>Failed Imports</h1>
6-
<p>
7-
Comic archives that have failed to import.
8-
This list is updated every time the library updates.
9-
You should probably review these files and fix or remove them
10-
</p>
11-
<h2>Fixing comics</h2>
12-
<p>
13-
Try using the zip fixer:
14-
<pre>
3+
<h1>Failed Imports</h1>
4+
<div>
5+
Comic archives that have failed to import. This list is updated every time
6+
the library updates. You should probably review these files and fix or
7+
remove them
8+
</div>
9+
<h2>Fixing comics</h2>
10+
<div>
11+
Try using the zip fixer:
12+
<pre>
1513
cp problem-comic.cbz /somewhere/safe/problem-comic.cbz.backup
1614
zip -F problem-comic.cbz --out fixed.zip
1715
mv fixed.zip problem-comic.cbz
18-
</pre>
19-
to fix comics. I've found that even if the fixed comic looks exactly the same as the original, replacing the original with the fixed archive can often get Codex to import it properly.<br/>
20-
If you've removed or fixed the unimportable comics in your library you can try polling the library again.<br/>
21-
You may also try <code>zip -FF</code> to fix comics which uses a different (not necissarily better) algorithm to fix archives.
22-
</p>
23-
<h1>Actions</h1>
24-
<h2>Delete selected failed imports</h2>
25-
<p>
26-
Deletes the failed imports entry from the database. May reappear after the next poll if Codex fails to import it again.
27-
</p>
28-
<h2>Poll selected failed imports' libraries for changes.</h2>
29-
<p>
30-
Poll the libraries the selected failed imports come from for changes, possibly clearing some failed imports if the comic archives were fixed or removed.
31-
</p>
32-
<h1>Reporting Issues</h1>
33-
<p>
34-
If the comic looks good to you, but still shows up as a failed import, it might be Codex's fault for not importing it correctly. Please file an <a href="https://github.com/ajslater/codex/issues">Issue Report</a> and include the stack trace from the logs at <code>config/logs/codex.log</code> if you can.
35-
</p>
16+
</pre>
17+
to fix comics. I've found that even if the fixed comic looks exactly the
18+
same as the original, replacing the original with the fixed archive can
19+
often get Codex to import it properly.<br />
20+
If you've removed or fixed the unimportable comics in your library you can
21+
try polling the library again.<br />
22+
You may also try <code>zip -FF</code> to fix comics which uses a different
23+
(not necissarily better) algorithm to fix archives.
24+
</div>
25+
<h1>Actions</h1>
26+
<h2>Delete selected failed imports</h2>
27+
<div>
28+
Deletes the failed imports entry from the database. May reappear after the
29+
next poll if Codex fails to import it again.
30+
</div>
31+
<h2>Poll selected failed imports' libraries for changes.</h2>
32+
<div>
33+
Poll the libraries the selected failed imports come from for changes,
34+
possibly clearing some failed imports if the comic archives were fixed or
35+
removed.
36+
</div>
37+
<h1>Reporting Issues</h1>
38+
<div>
39+
If the comic looks good to you, but still shows up as a failed import, it
40+
might be Codex's fault for not importing it correctly. Please file an
41+
<a href="https://github.com/ajslater/codex/issues">Issue Report</a> and
42+
include the stack trace from the logs at
43+
<code>config/logs/codex.log</code> if you can.
44+
</div>
3645
</div>
3746
{% endblock %}
Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
1-
{% extends "admin/change_list.html" %}
2-
3-
{% block footer %}
1+
{% extends "admin/change_list.html" %} {% block footer %}
42
<div id="footer">
5-
<h1>Libraries</h1>
6-
<p>
7-
A Library is a path where Codex can recursively search for comic archives. Codex will try to import comics from a Library immediately.
8-
You may navigate back to the browser view by clicking the "<span style="font-variant-caps: small-caps">view site</span>" link in the upper right of this Admin Panel.
9-
</p><p>
10-
Wait for comics to appear. It may take some time to import large comic libraries and Codex will refresh the browser the library has finished loaded. A snackbar will notify admins that a library update is in progress, but check the logs in <code>config/logs/codex.log</code> if you want to follow the import in detail.
11-
</p>
12-
<h2>events</h2>
13-
Watch the Library filesystem for events and update Codex instantly when the filesystem changes.
14-
<h2>poll</h2>
15-
Periodically poll the library for changes. Possibly CPU and disk intensive.
16-
<h2>poll every</h2>
17-
How long to wait between polling the filesystem
18-
<h2>last poll</h2>
19-
A timestamp telling you when the last time this library was polled.
20-
<h2>groups</h2>
21-
A library with <em>no</em> groups is accessible to every user and non-users if those are enabled.<br/>
22-
A library with <em>any</em> groups is accessible only to users who are in those groups. Use the Groups admin panel to create groups and the Users admin panel to add users to groups.
23-
<br/><br/>
24-
<small>Hold down “Control”, or “Command” on a Mac, to select more than one.</small>
25-
<h1>Actions</h1>
26-
<h2>Delete selected libraries</h2>
27-
Will delete the selected libraries from the codex database. Will not delete your comic archives on disk.
28-
Deleting large libraries may take a long time to create the confirmation screen.
29-
<h2>Poll Selected libraries for changes</h2>
30-
Poll selected libraries now for changes. Update the library if changes are detected.
31-
<h2>Update All Comics in Selected Libraries</h2>
32-
Forcibly update all the comics for a library, overwrite the database and regenerate covers.
33-
<h2>Recreate Comic Covers in Selected Libraries</h2>
34-
Recreate all the comic covers for a library.
3+
<h1>Libraries</h1>
4+
<div>
5+
A Library is a path where Codex can recursively search for comic archives.
6+
Codex will try to import comics from a Library immediately. You may navigate
7+
back to the browser view by clicking the "<span class="caps">view site</span
8+
>" link in the upper right of this Admin Panel.
9+
</div>
10+
<div>
11+
Wait for comics to appear. It may take some time to import large comic
12+
libraries and Codex will refresh the browser the library has finished
13+
loaded. A snackbar will notify admins that a library update is in progress,
14+
but check the logs in <code>config/logs/codex.log</code> if you want to
15+
follow the import in detail.
16+
</div>
17+
<h2>events</h2>
18+
Watch the Library filesystem for events and update Codex instantly when the
19+
filesystem changes.
20+
<h2>poll</h2>
21+
Periodically poll the library for changes. Possibly CPU and disk intensive.
22+
<h2>poll every</h2>
23+
How long to wait between polling the filesystem
24+
<h2>last poll</h2>
25+
A timestamp telling you when the last time this library was polled.
26+
<h2>groups</h2>
27+
A library with <em>no</em> groups is accessible to every user and non-users if
28+
those are enabled.<br />
29+
A library with <em>any</em> groups is accessible only to users who are in
30+
those groups. Use the Groups admin panel to create groups and the Users admin
31+
panel to add users to groups. <br /><br />
32+
<small
33+
>Hold down “control”, or “command” on a Mac, to select more than one.</small
34+
>
35+
<h1>Actions</h1>
36+
<h2>Delete selected libraries</h2>
37+
Will delete the selected libraries from the codex database. Will not delete
38+
your comic archives on disk. Deleting large libraries may take a long time to
39+
create the confirmation screen.
40+
<h2>Poll Selected libraries for changes</h2>
41+
Poll selected libraries now for changes. Update the library if changes are
42+
detected.
43+
<h2>Update All Comics in Selected Libraries</h2>
44+
Forcibly update all the comics for a library, overwrite the database and
45+
regenerate covers.
46+
<h2>Recreate Comic Covers in Selected Libraries</h2>
47+
Recreate all the comic covers for a library.
3548
</div>
3649
{% endblock %}

0 commit comments

Comments
 (0)