Archived
1
0

#166: Development 1

This commit is contained in:
Michael Gordeev
2018-10-10 20:56:59 +03:00
parent 7db118b498
commit 067e1456b4
3 changed files with 13 additions and 14 deletions
+5
View File
@@ -53,6 +53,11 @@ namespace FoxTube.Controls
ListChanged.Invoke(item, "add");
}
public void Add(string id, string url)
{
}
private void Item_DownloadComplete(object sender, params object[] e)
{
doc["downloads"].InnerXml += e[0];
+1 -3
View File
@@ -103,9 +103,7 @@
<CommandBar VerticalAlignment="Bottom" Name="commandbar">
<AppBarButton Icon="Download" Label="Download video" Name="download">
<AppBarButton.Flyout>
<MenuFlyout x:Name="downloadSelector">
<MenuFlyoutItem Text="No items are available" IsEnabled="False"/>
</MenuFlyout>
<MenuFlyout x:Name="downloadSelector"/>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Label="Add to" Icon="Add" IsEnabled="False"/>
+7 -11
View File
@@ -65,8 +65,6 @@ namespace FoxTube.Pages
string playlistId = null;
public Video item;
List<string> downloads = new List<string>();
bool wide;
bool isExtended = false;
@@ -252,28 +250,26 @@ namespace FoxTube.Pages
async void LoadDownloads()
{
downloadSelector.Items.Clear();
YouTubeUri[] uris = await YouTube.GetUrisAsync(item.Id);
if (uris.Length > 0)
List<YouTubeUri> uris = (await YouTube.GetUrisAsync(item.Id)).ToList();
if (uris.Count > 0)
foreach (YouTubeUri u in uris)
{
if (u.HasAudio && u.HasVideo)
{
downloads.Add(u.Uri.AbsoluteUri);
MenuFlyoutItem menuItem = new MenuFlyoutItem()
{
Text = Methods.QualityToString(u.VideoQuality)
Text = Methods.QualityToString(u.VideoQuality),
Tag = u.Uri.AbsoluteUri
};
menuItem.Click += downloadItemSelected;
downloadSelector.Items.Add(menuItem);
}
else if (u.HasAudio)
{
downloads.Add(u.Uri.AbsoluteUri);
MenuFlyoutItem menuItem = new MenuFlyoutItem()
{
Text = Methods.QualityToString(u.AudioQuality)
Text = Methods.QualityToString(u.AudioQuality),
Tag = u.Uri.AbsoluteUri
};
menuItem.Click += downloadItemSelected;
downloadSelector.Items.Add(menuItem);
@@ -285,7 +281,7 @@ namespace FoxTube.Pages
private void downloadItemSelected(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
Methods.MainPage.Agent.Add(videoId, (sender as MenuFlyoutItem).Tag.ToString());
}
async void LoadRelatedVideos()