Archived
1
0

Region settings fixed

Channel page cover fixed
Livestream toasts added
This commit is contained in:
Michael Gordeev
2019-04-04 22:10:47 +03:00
parent d745611ca5
commit b875124c1a
12 changed files with 175 additions and 40 deletions
+50
View File
@@ -23,6 +23,10 @@ namespace FoxTube.Background
{ "changelog", "Список изменений" },
{ "changelogHeader", "Что нового в версии" },
{ "videoContent", "загрузил новое видео" },
{ "live", "ПРЯМОЙ ЭФИР" },
{ "upcoming", "Запланирован" },
{ "liveContent", "начал прямой эфир" },
{ "upcomingContent", "запланировал прямой эфир" },
{ "goChannel", "Открыть канал" }
};
else
@@ -32,6 +36,10 @@ namespace FoxTube.Background
{ "changelog", "Changelog" },
{ "changelogHeader", "What's new in version" },
{ "videoContent", "uploaded a new video" },
{ "live", "LIVE" },
{ "upcoming", "Upcoming" },
{ "liveContent", "started live broadcast" },
{ "upcomingContent", "planned live broadcast" },
{ "goChannel", "Go to channel" }
};
}
@@ -76,6 +84,48 @@ namespace FoxTube.Background
return new ToastNotification(template);
}
public static ToastNotification GetStreamToast(string id, string channelId, string title, string channel, string thumbnail, DateTimeOffset timeStamp, string avatar)
{
XmlDocument template = new XmlDocument();
string ts = $"{timeStamp.Year}-{timeStamp.Month:00}-{timeStamp.Day:00}T{timeStamp.Hour:00}:{timeStamp.Minute:00}:{timeStamp.Second:00}Z";
template.LoadXml($@"<toast activationType='foreground' launch='video|{id}' displayTimestamp='{ts}'>
<visual>
<binding template='ToastGeneric'>
<image placement='hero' src='{thumbnail.Replace("&", "%26")}'/>
<image placement='appLogoOverride' hint-crop='circle' src='{avatar.Replace("&", "%26") ?? "http://foxgame-studio.000webhostapp.com/FoxTubeAssets/LogoAvatar.png"}'/>
<text>🔴 [{languagePack["live"]}] {System.Security.SecurityElement.Escape(title)}</text>
<text>{System.Security.SecurityElement.Escape(channel)} {languagePack["liveContent"]}</text>
</binding>
</visual>
<actions>
<action content='{languagePack["goChannel"]}' activationType='foreground' arguments='channel|{channelId}'/>
</actions>
</toast>");
return new ToastNotification(template);
}
public static ToastNotification GetUpcomingToast(string id, string channelId, string title, string channel, string thumbnail, DateTimeOffset timeStamp, string avatar)
{
XmlDocument template = new XmlDocument();
string ts = $"{timeStamp.Year}-{timeStamp.Month:00}-{timeStamp.Day:00}T{timeStamp.Hour:00}:{timeStamp.Minute:00}:{timeStamp.Second:00}Z";
template.LoadXml($@"<toast activationType='foreground' launch='video|{id}' displayTimestamp='{ts}'>
<visual>
<binding template='ToastGeneric'>
<image placement='hero' src='{thumbnail.Replace("&", "%26")}'/>
<image placement='appLogoOverride' hint-crop='circle' src='{avatar.Replace("&", "%26") ?? "http://foxgame-studio.000webhostapp.com/FoxTubeAssets/LogoAvatar.png"}'/>
<text>🔴 [{languagePack["upcoming"]}] {System.Security.SecurityElement.Escape(title)}</text>
<text>{System.Security.SecurityElement.Escape(channel)} {languagePack["upcomingContent"]}</text>
</binding>
</visual>
<actions>
<action content='{languagePack["goChannel"]}' activationType='foreground' arguments='channel|{channelId}'/>
</actions>
</toast>");
return new ToastNotification(template);
}
public static ToastNotification GetInternalToast(string id, string header, string content, string thumbnail, string avatar)
{