Merge branch 'dev' into fix/rescan-when-files-added

This commit is contained in:
Alex Ling
2022-06-26 11:52:15 +08:00
committed by GitHub
3 changed files with 18 additions and 4 deletions

View File

@@ -632,6 +632,16 @@ class Title
if last_read_entry && last_read_entry.finished? username
last_read_entry = last_read_entry.next_entry username
if last_read_entry.nil?
# The last entry is finished. Return the first unfinished entry
# (if any)
sorted_entries(username).each do |e|
unless e.finished? username
last_read_entry = e
break
end
end
end
end
last_read_entry

View File

@@ -11,6 +11,7 @@ SUPPORTED_IMG_TYPES = %w(
image/avif
image/gif
image/svg+xml
image/jxl
)
def random_str
@@ -49,6 +50,7 @@ def register_mime_types
# defiend by Crystal in `MIME.DEFAULT_TYPES`
".apng" => "image/apng",
".avif" => "image/avif",
".jxl" => "image/jxl",
}.each do |k, v|
MIME.register k, v
end