rename root to library and add home with on deck WIP

This commit is contained in:
Jared Turner
2020-05-18 21:06:14 +01:00
parent 392b3d8339
commit 16734c2c59
5 changed files with 106 additions and 2 deletions

View File

@@ -32,12 +32,12 @@ class MainRouter < Router
end
end
get "/" do |env|
get "/library" do |env|
begin
titles = @context.library.titles
username = get_username env
percentage = titles.map &.load_percentage username
layout "index"
layout "library"
rescue e
@context.error e
env.response.status_code = 500
@@ -62,5 +62,23 @@ class MainRouter < Router
base_url = @context.config.mangadex["base_url"]
layout "download"
end
get "/" do |env|
begin
titles = @context.library.titles
username = get_username env
on_deck_entries = [] of Entry
titles.each do |title|
on_deck_entry = title.get_on_deck_entry username
on_deck_entries << on_deck_entry if on_deck_entry # ingnore titles without latest on deck entry
end
layout "home"
rescue e
@context.error e
env.response.status_code = 500
end
end
end
end