diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 0ddc9a35..2680bae6 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -419,6 +420,24 @@ public static string ClipLinkId { } } + /// + /// Looks up a localized string similar to Copy ID to clipboard. + /// + public static string CopyVideoIDToClipboard { + get { + return ResourceManager.GetString("CopyVideoIDToClipboard", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy URL to clipboard. + /// + public static string CopyVideoURLToClipboard { + get { + return ResourceManager.GetString("CopyVideoURLToClipboard", resourceCulture); + } + } + /// /// Looks up a localized string similar to End. /// @@ -1085,6 +1104,15 @@ public static string OfflineTooltip { } } + /// + /// Looks up a localized string similar to Open in browser. + /// + public static string OpenVideoInBrowser { + get { + return ResourceManager.GetString("OpenVideoInBrowser", resourceCulture); + } + } + /// /// Looks up a localized string similar to Outline:. /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index 6db5706a..d40389e1 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -778,4 +778,13 @@ Descarga FFmpeg {0}% - + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index f7a00758..6be5233c 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -777,4 +777,13 @@ Downloading FFmpeg {0}% + + Copier l'identifiant vidéo + + + Copier le lien vidéo + + + Ouvrir dans un navigateur web + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index f9cb43b9..858d3e5d 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -777,4 +777,13 @@ Downloading FFmpeg {0}% + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index 0bc72b6b..1f22a7b8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -776,4 +776,13 @@ Downloading FFmpeg {0}% + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index 454118e6..a627640d 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -777,4 +777,13 @@ Downloading FFmpeg {0}% + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index e4acd7b5..a2b08a71 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -778,4 +778,13 @@ FFmpeg İndiriliyor {0}% - + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 98839027..d7bce07f 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -777,4 +777,13 @@ Завантаження FFmpeg {0}% + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.zh.resx b/TwitchDownloaderWPF/Translations/Strings.zh.resx index 1073660f..fe1a87c8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh.resx @@ -776,4 +776,13 @@ Downloading FFmpeg {0}% + + Copy ID to clipboard + + + Copy URL to clipboard + + + Open in browser + \ No newline at end of file diff --git a/TwitchDownloaderWPF/TwitchTasks/TaskData.cs b/TwitchDownloaderWPF/TwitchTasks/TaskData.cs index 29f89b0b..5d2c8872 100644 --- a/TwitchDownloaderWPF/TwitchTasks/TaskData.cs +++ b/TwitchDownloaderWPF/TwitchTasks/TaskData.cs @@ -28,7 +28,7 @@ public string LengthFormatted return $"{time.Minutes:D2}:{time.Seconds:D2}"; } - return $"{time.Seconds:D2}s"; + return $"{time.Seconds:D1}s"; } } } diff --git a/TwitchDownloaderWPF/WindowMassDownload.xaml b/TwitchDownloaderWPF/WindowMassDownload.xaml index 8be36e6b..53cf01f3 100644 --- a/TwitchDownloaderWPF/WindowMassDownload.xaml +++ b/TwitchDownloaderWPF/WindowMassDownload.xaml @@ -5,6 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:TwitchDownloaderWPF" xmlns:behave="clr-namespace:TwitchDownloaderWPF.Behaviors" + xmlns:fa="http://schemas.fontawesome.com/icons/" xmlns:lex="http://wpflocalizeextension.codeplex.com" lex:LocalizeDictionary.DesignCulture="" lex:ResxLocalizationProvider.DefaultAssembly="TwitchDownloaderWPF" @@ -52,7 +53,26 @@ - + + + + + + + + + + + + + + + + + + + + diff --git a/TwitchDownloaderWPF/WindowMassDownload.xaml.cs b/TwitchDownloaderWPF/WindowMassDownload.xaml.cs index 02424b58..7c6e9514 100644 --- a/TwitchDownloaderWPF/WindowMassDownload.xaml.cs +++ b/TwitchDownloaderWPF/WindowMassDownload.xaml.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using System.Windows; @@ -160,7 +161,7 @@ private async Task UpdateList() if (StatusImage != null) StatusImage.Visibility = Visibility.Hidden; } - private void Border_MouseUp(object sender, MouseButtonEventArgs e) + private void Border_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (sender is not Border border) return; if (border.DataContext is not TaskData taskData) return; @@ -271,5 +272,43 @@ private async void ComboVideoCount_SelectionChanged(object sender, SelectionChan cursorIndex = -1; await UpdateList(); } + + private void MenuItemCopyVideoID_OnClick(object sender, RoutedEventArgs e) + { + if (sender is not MenuItem { DataContext: TaskData taskData }) return; + + var id = taskData.Id; + Clipboard.SetText(id); + + e.Handled = true; + } + + private void MenuItemCopyVideoUrl_OnClick(object sender, RoutedEventArgs e) + { + if (sender is not MenuItem { DataContext: TaskData taskData }) return; + + var id = taskData.Id; + var url = id.All(char.IsDigit) + ? $"https://twitch.tv/videos/{id}" + : $"https://clips.twitch.tv/{id}"; + + Clipboard.SetText(url); + + e.Handled = true; + } + + private void MenuItemOpenInBrowser_OnClick(object sender, RoutedEventArgs e) + { + if (sender is not MenuItem { DataContext: TaskData taskData }) return; + + var id = taskData.Id; + var url = id.All(char.IsDigit) + ? $"https://twitch.tv/videos/{id}" + : $"https://clips.twitch.tv/{id}"; + + Process.Start(new ProcessStartInfo(url) { UseShellExecute = true }); + + e.Handled = true; + } } }