From cdf93b29e6376ea0c023da825aeb9d83ec588873 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Thu, 31 Oct 2024 11:51:33 +0100 Subject: [PATCH 1/2] Routing: Remove deprecated /api/v1/channels/.../:ucid routes --- src/invidious/routing.cr | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index ba05da19..9f76f15f 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -243,17 +243,16 @@ module Invidious::Routing # Channels get "/api/v1/channels/:ucid", {{namespace}}::Channels, :home + get "/api/v1/channels/:ucid/latest", {{namespace}}::Channels, :latest + get "/api/v1/channels/:ucid/videos", {{namespace}}::Channels, :videos get "/api/v1/channels/:ucid/shorts", {{namespace}}::Channels, :shorts get "/api/v1/channels/:ucid/streams", {{namespace}}::Channels, :streams get "/api/v1/channels/:ucid/podcasts", {{namespace}}::Channels, :podcasts get "/api/v1/channels/:ucid/releases", {{namespace}}::Channels, :releases - + get "/api/v1/channels/:ucid/playlists", {{namespace}}::Channels, :playlists + get "/api/v1/channels/:ucid/community", {{namespace}}::Channels, :community get "/api/v1/channels/:ucid/channels", {{namespace}}::Channels, :channels - - {% for route in {"videos", "latest", "playlists", "community", "search"} %} - get "/api/v1/channels/#{{{route}}}/:ucid", {{namespace}}::Channels, :{{route}} - get "/api/v1/channels/:ucid/#{{{route}}}", {{namespace}}::Channels, :{{route}} - {% end %} + get "/api/v1/channels/:ucid/search", {{namespace}}::Channels, :search # Posts get "/api/v1/post/:id", {{namespace}}::Channels, :post From 6da18ddc41a20cad06c736a28aef6064433e3bd5 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Thu, 31 Oct 2024 11:52:09 +0100 Subject: [PATCH 2/2] Routing: Also remove outdated comment about notification routes --- src/invidious/routing.cr | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index 9f76f15f..9009062f 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -270,11 +270,6 @@ module Invidious::Routing # Authenticated - # The notification APIs cannot be extracted yet! They require the *local* notifications constant defined in invidious.cr - # - # Invidious::Routing.get "/api/v1/auth/notifications", {{namespace}}::Authenticated, :notifications - # Invidious::Routing.post "/api/v1/auth/notifications", {{namespace}}::Authenticated, :notifications - get "/api/v1/auth/preferences", {{namespace}}::Authenticated, :get_preferences post "/api/v1/auth/preferences", {{namespace}}::Authenticated, :set_preferences