diff --git a/src/config.cr b/src/config.cr index 60c2e40..1c80542 100644 --- a/src/config.cr +++ b/src/config.cr @@ -11,8 +11,9 @@ class Config property library_path : String = File.expand_path "~/mango/library", home: true property db_path : String = File.expand_path "~/mango/mango.db", home: true - @[YAML::Field(key: "scan_interval_minutes")] - property scan_interval : Int32 = 5 + property scan_interval_minutes : Int32 = 5 + property thumbnail_generation_interval_hours : Int32 = 24 + property db_optimization_interval_hours : Int32 = 24 property log_level : String = "info" property upload_path : String = File.expand_path "~/mango/uploads", home: true diff --git a/src/library/library.cr b/src/library/library.cr index f145342..2ecb495 100644 --- a/src/library/library.cr +++ b/src/library/library.cr @@ -1,6 +1,7 @@ class Library property dir : String, title_ids : Array(String), scan_interval : Int32, - title_hash : Hash(String, Title) + title_hash : Hash(String, Title), entries_count = 0, + thumbnails_count = 0 use_default diff --git a/src/views/home.html.ecr b/src/views/home.html.ecr index 0700f4f..598709d 100644 --- a/src/views/home.html.ecr +++ b/src/views/home.html.ecr @@ -1,83 +1,83 @@ <%- if new_user && empty_library -%> -
- -

Add your first manga

-

We can't find any files yet. Add some to your library and they'll appear here.

-
-
Current library path
-
<%= Config.current.library_path %>
-
Want to change your library path?
-
Update config.yml located at: <%= Config.current.path %>
-
Can't see your files yet?
-
- You must wait <%= Config.current.scan_interval %> minutes for the library scan to complete - <% if is_admin %> - , or manually re-scan from Admin - <% end %>. -
-
-
+
+ +

Add your first manga

+

We can't find any files yet. Add some to your library and they'll appear here.

+
+
Current library path
+
<%= Config.current.library_path %>
+
Want to change your library path?
+
Update config.yml located at: <%= Config.current.path %>
+
Can't see your files yet?
+
+ You must wait <%= Config.current.scan_interval_minutes %> minutes for the library scan to complete + <% if is_admin %> + , or manually re-scan from Admin + <% end %>. +
+
+
<%- elsif new_user && empty_library == false -%> -
- -

Read your first manga

-

Once you start reading, Mango will remember where you left off - and show your entries here.

- View library -
+
+ +

Read your first manga

+

Once you start reading, Mango will remember where you left off + and show your entries here.

+ View library +
<%- elsif new_user == false && empty_library == false -%> - <%- if continue_reading.empty? && recently_added.empty? -%> -
- -

A self-hosted manga server and reader

- View library -
- <%- end -%> + <%- if continue_reading.empty? && recently_added.empty? -%> +
+ +

A self-hosted manga server and reader

+ View library +
+ <%- end -%> - <%- unless continue_reading.empty? -%> -

Continue Reading

-
- <%- continue_reading.each do |cr| -%> - <% item = cr[:entry] %> - <% progress = cr[:percentage] %> - <%= render_component "card" %> - <%- end -%> -
- <%- end -%> + <%- unless continue_reading.empty? -%> +

Continue Reading

+
+ <%- continue_reading.each do |cr| -%> + <% item = cr[:entry] %> + <% progress = cr[:percentage] %> + <%= render_component "card" %> + <%- end -%> +
+ <%- end -%> - <%- unless start_reading.empty? -%> -

Start Reading

-
- <%- start_reading.each do |t| -%> - <% item = t %> - <% progress = 0.0 %> - <%= render_component "card" %> - <%- end -%> -
- <%- end -%> + <%- unless start_reading.empty? -%> +

Start Reading

+
+ <%- start_reading.each do |t| -%> + <% item = t %> + <% progress = 0.0 %> + <%= render_component "card" %> + <%- end -%> +
+ <%- end -%> - <%- unless recently_added.empty? -%> -

Recently Added

-
- <%- recently_added.each do |ra| -%> - <% item = ra %> - <% progress = ra[:percentage] %> - <%= render_component "card" %> - <%- end -%> -
- <%- end -%> + <%- unless recently_added.empty? -%> +

Recently Added

+
+ <%- recently_added.each do |ra| -%> + <% item = ra %> + <% progress = ra[:percentage] %> + <%= render_component "card" %> + <%- end -%> +
+ <%- end -%> - <%= render_component "entry-modal" %> + <%= render_component "entry-modal" %> <%- end -%> <% content_for "script" do %> - <%= render_component "dots-scripts" %> - - + <%= render_component "dots-scripts" %> + + <% end %>