From 53c8b5ff2e7b274905204a12612ba4290d768719 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 17 Sep 2018 20:07:32 -0500 Subject: [PATCH] Minor refactor --- src/invidious.cr | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index ff1f2579..3bf3d9be 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -390,17 +390,13 @@ get "/playlist" do |env| page = env.params.query["page"]?.try &.to_i? page ||= 1 - if plid - begin - videos = extract_playlist(plid, page) - rescue ex - error_message = ex.message - next templated "error" - end - playlist = fetch_playlist(plid) - else - next env.redirect "/" + begin + videos = extract_playlist(plid, page) + rescue ex + error_message = ex.message + next templated "error" end + playlist = fetch_playlist(plid) templated "playlist" end