Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-25 23:44:29 +03:00
1 parent 24075fbd52
commit caac928923
5 files changed
+131 -9

No files matched your search

+9 -6
View File
@@ -21,7 +21,10 @@ namespace Echoion::Api
URL,
// Appended after URL so existing uint8_t-serialized history rows
// keep their meaning.
Yandex
Yandex,
// Media returned by an extension plugin. Keep this distinct from
// Unknown so source allowlists never have to permit unknown values.
Plugin
};
struct TrackInfo {
@@ -34,15 +37,15 @@ namespace Echoion::Api
TrackSource source;
std::string originalUrl;
std::optional<std::string>
shortenedUrl; // faumaray.ru shortened link
shortenedUrl; // provider-generated public link
std::optional<std::string> streamUrl;
std::optional<AudioStreamInfo> audioInfo;
std::chrono::system_clock::time_point addedAt;
std::string requestedBy;
// Format track as markdown link: [Title](shortenedUrl)
// Only uses shortened URL (faumaray), returns empty string if not
// available
// Only uses a successfully generated shortened URL; returns no link
// if unavailable.
[[nodiscard]] std::string formatWithLink() const
{
if (shortenedUrl.has_value() && !shortenedUrl->empty()) {
@@ -53,8 +56,8 @@ namespace Echoion::Api
}
// Format track with artist and link
// Only uses shortened URL (faumaray), returns text only if not
// available
// Only uses a successfully generated shortened URL; returns text if
// unavailable.
[[nodiscard]] std::string formatWithArtistAndLink() const
{
std::string displayTitle = title;