summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-09-17 20:07:32 -0500
committerOmar Roth <omarroth@hotmail.com>2018-09-17 20:07:32 -0500
commit53c8b5ff2e7b274905204a12612ba4290d768719 (patch)
tree3d40a765b7fafd242bf75552b7c0469e8bbf8ebf /src
parent64cc0362fb43ff6168aff8be2759c641b49b779c (diff)
downloadinvidious-53c8b5ff2e7b274905204a12612ba4290d768719.tar.gz
invidious-53c8b5ff2e7b274905204a12612ba4290d768719.tar.bz2
invidious-53c8b5ff2e7b274905204a12612ba4290d768719.zip
Minor refactor
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr16
1 files 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