#pragma once #include #include #include #include #include #include namespace definitions { struct StreamInfo { std::string url; int itag = 0; std::string mimeType; int bitrate = 0; int width = 0; int height = 0; }; struct Streams { StreamInfo audio; StreamInfo video; }; struct QueueItem { std::string name; std::string videoId; std::string shortUrl; std::string length; std::string requester; std::optional streams; QueueItem() = default; QueueItem(std::string name, std::string videoId, std::string shortUrl, std::string length, std::string requested_by, const std::optional &streams) : name{std::move(name)}, videoId(std::move(videoId)), shortUrl(std::move(shortUrl)), length(std::move(length)), requester{std::move(requested_by)}, streams{streams} { } }; struct SearchResultItem { std::string name; std::string length; std::string thumbnail; std::string viewCount; std::string url; std::string shortUrl; std::string videoId; }; struct PluginState { std::vector queue; std::vector onlineSubscribers; std::vector offlineSubscribers; std::uint64_t serverConnection; bool wasPlaying = false; }; } // namespace definitions template <> struct glz::meta { using T = definitions::StreamInfo; static constexpr auto value = object( "url", &T::url, "itag", &T::itag, "mimeType", &T::mimeType, "bitrate", &T::bitrate, "width", &T::width, "height", &T::height); }; template <> struct glz::meta { using T = definitions::Streams; static constexpr auto value = object("audio", &T::audio, "video", &T::video); }; template <> struct glz::meta { using T = definitions::QueueItem; static constexpr auto value = object("name", &T::name, "videoId", &T::videoId, "shortUrl", &T::shortUrl, "length", &T::length, "requester", &T::requester, "streams", &T::streams); };