mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Add config options for optimization tasks
This commit is contained in:
parent
83d96fd2a1
commit
0582b57d60
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,83 +1,83 @@
|
||||
<%- if new_user && empty_library -%>
|
||||
|
||||
<div class="uk-container uk-text-center">
|
||||
<i class="fas fa-plus" style="font-size: 80px;"></i>
|
||||
<h2>Add your first manga</h2>
|
||||
<p style="margin-bottom: 40px;">We can't find any files yet. Add some to your library and they'll appear here.</p>
|
||||
<dl class="uk-description-list">
|
||||
<dt style="font-weight: 500;">Current library path</dt>
|
||||
<dd><code><%= Config.current.library_path %></code></dd>
|
||||
<dt style="font-weight: 500;">Want to change your library path?</dt>
|
||||
<dd>Update <code>config.yml</code> located at: <code><%= Config.current.path %></code></dd>
|
||||
<dt style="font-weight: 500;">Can't see your files yet?</dt>
|
||||
<dd>
|
||||
You must wait <%= Config.current.scan_interval %> minutes for the library scan to complete
|
||||
<% if is_admin %>
|
||||
, or manually re-scan from <a href="<%= base_url %>admin">Admin</a>
|
||||
<% end %>.
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="uk-container uk-text-center">
|
||||
<i class="fas fa-plus" style="font-size: 80px;"></i>
|
||||
<h2>Add your first manga</h2>
|
||||
<p style="margin-bottom: 40px;">We can't find any files yet. Add some to your library and they'll appear here.</p>
|
||||
<dl class="uk-description-list">
|
||||
<dt style="font-weight: 500;">Current library path</dt>
|
||||
<dd><code><%= Config.current.library_path %></code></dd>
|
||||
<dt style="font-weight: 500;">Want to change your library path?</dt>
|
||||
<dd>Update <code>config.yml</code> located at: <code><%= Config.current.path %></code></dd>
|
||||
<dt style="font-weight: 500;">Can't see your files yet?</dt>
|
||||
<dd>
|
||||
You must wait <%= Config.current.scan_interval_minutes %> minutes for the library scan to complete
|
||||
<% if is_admin %>
|
||||
, or manually re-scan from <a href="<%= base_url %>admin">Admin</a>
|
||||
<% end %>.
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<%- elsif new_user && empty_library == false -%>
|
||||
|
||||
<div class="uk-container uk-text-center">
|
||||
<i class="fas fa-book-open" style="font-size: 80px;"></i>
|
||||
<h2>Read your first manga</h2>
|
||||
<p>Once you start reading, Mango will remember where you left off
|
||||
and show your entries here.</p>
|
||||
<a href="<%= base_url %>library" class="uk-button uk-button-default">View library</a>
|
||||
</div>
|
||||
<div class="uk-container uk-text-center">
|
||||
<i class="fas fa-book-open" style="font-size: 80px;"></i>
|
||||
<h2>Read your first manga</h2>
|
||||
<p>Once you start reading, Mango will remember where you left off
|
||||
and show your entries here.</p>
|
||||
<a href="<%= base_url %>library" class="uk-button uk-button-default">View library</a>
|
||||
</div>
|
||||
|
||||
<%- elsif new_user == false && empty_library == false -%>
|
||||
|
||||
<%- if continue_reading.empty? && recently_added.empty? -%>
|
||||
<div class="uk-container uk-text-center">
|
||||
<img src="<%= base_url %>img/banner.png" style="max-width: 400px; padding: 0 20px;">
|
||||
<p>A self-hosted manga server and reader</p>
|
||||
<a href="<%= base_url %>library" class="uk-button uk-button-default">View library</a>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<%- if continue_reading.empty? && recently_added.empty? -%>
|
||||
<div class="uk-container uk-text-center">
|
||||
<img src="<%= base_url %>img/banner.png" style="max-width: 400px; padding: 0 20px;">
|
||||
<p>A self-hosted manga server and reader</p>
|
||||
<a href="<%= base_url %>library" class="uk-button uk-button-default">View library</a>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<%- unless continue_reading.empty? -%>
|
||||
<h2 class="uk-title home-headings">Continue Reading</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- continue_reading.each do |cr| -%>
|
||||
<% item = cr[:entry] %>
|
||||
<% progress = cr[:percentage] %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<%- unless continue_reading.empty? -%>
|
||||
<h2 class="uk-title home-headings">Continue Reading</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- continue_reading.each do |cr| -%>
|
||||
<% item = cr[:entry] %>
|
||||
<% progress = cr[:percentage] %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<%- unless start_reading.empty? -%>
|
||||
<h2 class="uk-title home-headings">Start Reading</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- start_reading.each do |t| -%>
|
||||
<% item = t %>
|
||||
<% progress = 0.0 %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<%- unless start_reading.empty? -%>
|
||||
<h2 class="uk-title home-headings">Start Reading</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- start_reading.each do |t| -%>
|
||||
<% item = t %>
|
||||
<% progress = 0.0 %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<%- unless recently_added.empty? -%>
|
||||
<h2 class="uk-title home-headings">Recently Added</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- recently_added.each do |ra| -%>
|
||||
<% item = ra %>
|
||||
<% progress = ra[:percentage] %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<%- unless recently_added.empty? -%>
|
||||
<h2 class="uk-title home-headings">Recently Added</h2>
|
||||
<div class="uk-child-width-1-4@m uk-child-width-1-2" uk-grid>
|
||||
<%- recently_added.each do |ra| -%>
|
||||
<% item = ra %>
|
||||
<% progress = ra[:percentage] %>
|
||||
<%= render_component "card" %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<%= render_component "entry-modal" %>
|
||||
<%= render_component "entry-modal" %>
|
||||
|
||||
<%- end -%>
|
||||
|
||||
<% content_for "script" do %>
|
||||
<%= render_component "dots-scripts" %>
|
||||
<script src="<%= base_url %>js/alert.js"></script>
|
||||
<script src="<%= base_url %>js/title.js"></script>
|
||||
<%= render_component "dots-scripts" %>
|
||||
<script src="<%= base_url %>js/alert.js"></script>
|
||||
<script src="<%= base_url %>js/title.js"></script>
|
||||
<% end %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user