2021-02-02 10:48:16 +05:30
|
|
|
class Invidious::Routes::Misc < Invidious::Routes::BaseRoute
|
|
|
|
def home(env)
|
2020-10-06 10:11:18 +05:30
|
|
|
preferences = env.get("preferences").as(Preferences)
|
|
|
|
locale = LOCALES[preferences.locale]?
|
|
|
|
user = env.get? "user"
|
|
|
|
|
|
|
|
case preferences.default_home
|
|
|
|
when "Popular"
|
2020-12-27 10:42:43 +05:30
|
|
|
env.redirect "/feed/popular"
|
2020-10-06 10:11:18 +05:30
|
|
|
when "Trending"
|
|
|
|
env.redirect "/feed/trending"
|
|
|
|
when "Subscriptions"
|
|
|
|
if user
|
|
|
|
env.redirect "/feed/subscriptions"
|
|
|
|
else
|
2020-12-27 10:42:43 +05:30
|
|
|
env.redirect "/feed/popular"
|
2020-10-06 10:11:18 +05:30
|
|
|
end
|
|
|
|
when "Playlists"
|
|
|
|
if user
|
|
|
|
env.redirect "/view_all_playlists"
|
|
|
|
else
|
2020-12-27 10:42:43 +05:30
|
|
|
env.redirect "/feed/popular"
|
2020-10-06 10:11:18 +05:30
|
|
|
end
|
|
|
|
else
|
2021-04-17 17:46:35 +05:30
|
|
|
templated "search_homepage"
|
2020-10-06 10:11:18 +05:30
|
|
|
end
|
|
|
|
end
|
2021-02-02 10:48:16 +05:30
|
|
|
|
|
|
|
def privacy(env)
|
|
|
|
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
|
|
|
templated "privacy"
|
|
|
|
end
|
|
|
|
|
|
|
|
def licenses(env)
|
|
|
|
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
|
|
|
rendered "licenses"
|
|
|
|
end
|
2020-10-06 10:11:18 +05:30
|
|
|
end
|