-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes_admin.go
93 lines (82 loc) · 3.24 KB
/
routes_admin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package server
import (
// "fmt"
// "strings"
// fiber "github.com/gofiber/fiber/v2"
)
func ( s *Server ) SetupAdminRoutes() {
// 2 x 3 StreamDeck-1
streamdeck := s.FiberApp.Group( "/streamdeck" )
streamdeck.Use( validate_admin_mw )
streamdeck.Get( "spotify" , s.StreamDeckSpotify )
streamdeck.Get( "youtube" , s.StreamDeckYouTube )
streamdeck.Get( "disney" , s.StreamDeckDisney )
streamdeck.Get( "twitch" , s.StreamDeckTwitch )
streamdeck.Get( "escape-rope" , s.StreamDeckEscapeRope )
streamdeck.Get( "heart" , s.StreamDeckHeart )
// TV
tv := s.FiberApp.Group( "/tv" )
tv.Use( validate_admin_mw )
tv.Get( "/prepare" , s.TVPrepare )
tv.Get( "/power/on" , s.TVPowerOn )
tv.Get( "/power/off" , s.TVPowerOff )
tv.Get( "/power/status" , s.TVPowerStatus )
tv.Get( "/input" , s.TVGetInput )
tv.Get( "/input/:input" , s.TVSetInput )
tv.Get( "/mute/on" , s.TVMuteOn )
tv.Get( "/mute/off" , s.TVMuteOff )
tv.Get( "/volume" , s.TVGetVolume )
tv.Get( "/volume/:volume" , s.TVSetVolume )
// Generic ADB Media Buttons
adb := s.FiberApp.Group( "/adb" )
adb.Use( validate_admin_mw )
adb.Get( "play" , s.ADBPlay )
adb.Get( "pause" , s.ADBPause )
adb.Get( "stop" , s.ADBStop )
adb.Get( "next" , s.ADBNext )
adb.Get( "previous" , s.ADBPrevious )
adb.Get( "status" , s.GetStatusUrl )
// Responsive Media Buttons
s.FiberApp.Get( "play" , s.Play )
s.FiberApp.Get( "pause" , s.Pause )
s.FiberApp.Get( "resume" , s.Resume )
s.FiberApp.Get( "stop" , s.Stop )
s.FiberApp.Get( "next" , s.Next )
s.FiberApp.Get( "previous" , s.Previous )
s.FiberApp.Get( "status" , s.GetStatusUrl )
// Spotify
spotify := s.FiberApp.Group( "/spotify" )
spotify.Use( validate_admin_mw )
spotify.Get( "/shuffle/:state" , s.SpotifySetShuffle )
spotify.Get( "/song/:song_id" , s.SpotifySong )
spotify.Get( "/playlist/:playlist_id" , s.SpotifyPlaylist )
spotify.Get( "/playlist-shuffle/:playlist_id" , s.SpotifyPlaylistWithShuffle )
// spotify.Get( "/next/song" , SpotifyPlaylistWithShuffle )
// spotify.Get( "/next/playlist" , SpotifyNextPlaylist )
spotify.Get( "/next/playlist-shuffle" , s.SpotifyNextPlaylistWithShuffle )
// spotify.Get( "/previous/song" , SpotifyPlaylistWithShuffle )
// spotify.Get( "/previous/playlist" , SpotifyPlaylistWithShuffle )
// spotify.Get( "/previous" , SpotifyPressPreviousButton ) // needs a custom previous , requires 2 clicks if in shuffle-mode
// Twitch
twitch := s.FiberApp.Group( "/twitch" )
twitch.Use( validate_admin_mw )
twitch.Get( "/next" , s.TwitchLiveNext )
twitch.Get( "/previous" , s.TwitchLivePrevious )
twitch.Get( "/update" , s.GetTwitchLiveUpdate )
twitch.Get( "/set/quality/max" , s.TwitchLiveSetQualityMax )
twitch.Get( "/view/:username" , s.TwitchLiveUser )
// Disney
disney := s.FiberApp.Group( "/disney" )
disney.Use( validate_admin_mw )
disney.Get( "/next" , s.DisneyMovieNext )
disney.Get( "/previous" , s.DisneyMoviePrevious )
disney.Get( "/movie/:movie_id" , s.DisneyMovie )
// YouTube
youtube := s.FiberApp.Group( "/youtube" )
youtube.Use( validate_admin_mw )
youtube.Get( "/:video_id" , s.YouTubeVideo )
youtube.Get( "/live/next" , s.YouTubeLiveNext )
youtube.Get( "/live/previous" , s.YouTubeLivePrevious )
youtube.Get( "/update/live" , s.GetYouTubeLiveUpdate )
// s.SetupMediaPlayerRoutes( youtube , "youtube" )
}