Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear issues list (again) for 2023.9.0 #579

Merged
merged 14 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: DaPigGuy/flatpak-github-actions/flatpak-builder@master
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6.2
with:
bundle: org.nickvision.tubeconverter.flatpak
manifest-path: flatpak/org.nickvision.tubeconverter.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
with:
check_filenames: true
skip: cargo-sources.json,.git,*.svg,*.html,*.js,*.po,*.pot,*.page
ignore_words_list: gir
ignore_words_list: gir,te
13 changes: 8 additions & 5 deletions NickvisionTubeConverter.GNOME/Blueprints/add_download_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ Adw.Window _root {
visible: false;
}

Adw.ComboRow _subtitleRow {
title: _("Subtitle");
model: Gtk.StringList {
strings [C_("Subtitle", "None"), "VTT", "SRT"]
};
Adw.ActionRow _subtitleRow {
title: _("Download Subtitle");
activatable-widget: _subtitleSwitch;

[suffix]
Gtk.Switch _subtitleSwitch {
valign: center;
}
}
}

Expand Down
19 changes: 17 additions & 2 deletions NickvisionTubeConverter.GNOME/Blueprints/preferences_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ Adw.PreferencesWindow _root {

Adw.EntryRow _subtitleLangsRow {
title: _("Subtitle Languages (Comma-Separated)");
show-apply-button: true;

[prefix]
Gtk.Image {
Expand All @@ -270,7 +269,7 @@ Adw.PreferencesWindow _root {
maximum-size: 300;
child: Gtk.Label {
wrap: true;
label: _("Some sites use two-letter language codes, whereas others use three-letter. For example, \"en\" and \"eng\" are both used for English.\n\nPlease specify both two-letter and three-letter codes for your languages for the best results.");
label: _("Different sites can use different language code formats for the same language. You may encounter one of the following three types: two-letter, two-letter with region, or three-letter. For example, \"en\", \"en-US\" and \"eng\" are all used for English.\n\nPlease specify all valid codes for your languages for the best results.");
};
}
};
Expand Down Expand Up @@ -416,6 +415,22 @@ Adw.PreferencesWindow _root {
valign: center;
}
}

Adw.ActionRow {
title: _("Remove Source Data");
subtitle: _("Clear metadata fields containing the URL and other identifying information of the media source");
activatable-widget: _removeSourceDataSwitch;

[prefix]
Gtk.Image {
icon-name: "larger-brush-symbolic";
}

[suffix]
Gtk.Switch _removeSourceDataSwitch {
valign: center;
}
}
}

Adw.ActionRow {
Expand Down
8 changes: 5 additions & 3 deletions NickvisionTubeConverter.GNOME/Views/AddDownloadDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public partial class AddDownloadDialog : Adw.Window
[Gtk.Connect] private readonly Adw.ComboRow _fileTypeRow;
[Gtk.Connect] private readonly Adw.ComboRow _qualityRow;
[Gtk.Connect] private readonly Adw.ComboRow _audioLanguageRow;
[Gtk.Connect] private readonly Adw.ComboRow _subtitleRow;
[Gtk.Connect] private readonly Adw.ActionRow _subtitleRow;
[Gtk.Connect] private readonly Gtk.Switch _subtitleSwitch;
[Gtk.Connect] private readonly Adw.EntryRow _saveFolderRow;
[Gtk.Connect] private readonly Gtk.Button _selectSaveFolderButton;
[Gtk.Connect] private readonly Adw.ActionRow _openAdvancedRow;
Expand Down Expand Up @@ -232,6 +233,7 @@ private AddDownloadDialog(Gtk.Builder builder, AddDownloadDialogController contr
_saveFolderString = GLib.Functions.GetUserSpecialDir(GLib.UserDirectory.DirectoryDownload) ?? "";
}
_saveFolderRow.SetText(Path.GetFileName(_saveFolderString) ?? "");
_subtitleSwitch.SetActive(_controller.PreviousSubtitleState);
_speedLimitRow.SetSubtitle($"{_("{0:f1} KiB/s", _controller.CurrentSpeedLimit)} {_("(Configurable in preferences)")}");
}

Expand Down Expand Up @@ -588,11 +590,11 @@ private async void AddDownload(Gtk.Button sender, EventArgs e)
}
if(_keyringRow.GetSelected() == 0 || _keyringRow.GetSelected() == GTK_INVALID_LIST_POSITION || !_authRow.GetEnableExpansion())
{
_controller.PopulateDownloads(SelectedMediaFileType, quality, resolutionIndex, audioLanguage, (Subtitle)_subtitleRow.GetSelected(), _saveFolderString, _speedLimitSwitch.GetActive(), _splitChaptersSwitch.GetActive(), _cropThumbnailSwitch.GetActive(), timeframe, _usernameRow.GetText(), _passwordRow.GetText());
_controller.PopulateDownloads(SelectedMediaFileType, quality, resolutionIndex, audioLanguage, _subtitleSwitch.GetActive(), _saveFolderString, _speedLimitSwitch.GetActive(), _splitChaptersSwitch.GetActive(), _cropThumbnailSwitch.GetActive(), timeframe, _usernameRow.GetText(), _passwordRow.GetText());
}
else
{
await _controller.PopulateDownloadsAsync(SelectedMediaFileType, quality, resolutionIndex, audioLanguage, (Subtitle)_subtitleRow.GetSelected(), _saveFolderString, _speedLimitSwitch.GetActive(), _splitChaptersSwitch.GetActive(), _cropThumbnailSwitch.GetActive(), timeframe, ((int)_keyringRow.GetSelected()) - 1);
await _controller.PopulateDownloadsAsync(SelectedMediaFileType, quality, resolutionIndex, audioLanguage, _subtitleSwitch.GetActive(), _saveFolderString, _speedLimitSwitch.GetActive(), _splitChaptersSwitch.GetActive(), _cropThumbnailSwitch.GetActive(), timeframe, ((int)_keyringRow.GetSelected()) - 1);
}
OnDownload?.Invoke(this, EventArgs.Empty);
}
Expand Down
16 changes: 11 additions & 5 deletions NickvisionTubeConverter.GNOME/Views/PreferencesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class PreferencesDialog : Adw.PreferencesWindow
[Gtk.Connect] private readonly Gtk.Button _unsetCookiesFileButton;
[Gtk.Connect] private readonly Gtk.Switch _disallowConversionsSwitch;
[Gtk.Connect] private readonly Adw.ExpanderRow _embedMetadataRow;
[Gtk.Connect] private readonly Gtk.Switch _removeSourceDataSwitch;
[Gtk.Connect] private readonly Gtk.Switch _cropAudioThumbnailSwitch;
[Gtk.Connect] private readonly Gtk.Switch _embedChaptersSwitch;

Expand All @@ -65,7 +66,13 @@ private PreferencesDialog(Gtk.Builder builder, PreferencesViewController control
_ariaMaxConnectionsPerServerResetButton.OnClicked += (sender, e) => _ariaMaxConnectionsPerServerSpin.SetValue(16);
_ariaMinSplitSizeResetButton.OnClicked += (sender, e) => _ariaMinSplitSizeSpin.SetValue(20);
_sponsorBlockInfoButton.OnClicked += async (sender, e) => await LaunchSponsorBlockInfoAsync();
_subtitleLangsRow.OnApply += SubtitleLangsChanged;
_subtitleLangsRow.OnNotify += (sender, e) =>
{
if (e.Pspec.GetName() == "text")
{
SubtitleLangsChanged();
}
};
_chromeCookiesButton.OnClicked += async (sender, e) => await LaunchChromeCookiesExtensionAsync();
_firefoxCookiesButton.OnClicked += async (sender, e) => await LaunchFirefoxCookiesExtensionAsync();
_selectCookiesFileButton.OnClicked += async (sender, e) => await SelectCookiesFileAsync();
Expand Down Expand Up @@ -93,6 +100,7 @@ private PreferencesDialog(Gtk.Builder builder, PreferencesViewController control
}
_disallowConversionsSwitch.SetActive(_controller.DisallowConversions);
_embedMetadataRow.SetEnableExpansion(_controller.EmbedMetadata);
_removeSourceDataSwitch.SetActive(_controller.RemoveSourceData);
_cropAudioThumbnailSwitch.SetActive(_controller.CropAudioThumbnails);
_embedChaptersSwitch.SetActive(_controller.EmbedChapters);
}
Expand Down Expand Up @@ -128,6 +136,7 @@ private void Hide(Gtk.Widget sender, EventArgs e)
_controller.ProxyUrl = _proxyRow.GetText();
_controller.DisallowConversions = _disallowConversionsSwitch.GetActive();
_controller.EmbedMetadata = _embedMetadataRow.GetEnableExpansion();
_controller.RemoveSourceData = _removeSourceDataSwitch.GetActive();
_controller.CropAudioThumbnails = _cropAudioThumbnailSwitch.GetActive();
_controller.EmbedChapters = _embedChaptersSwitch.GetActive();
_controller.SaveConfiguration();
Expand Down Expand Up @@ -165,17 +174,14 @@ private async Task LaunchSponsorBlockInfoAsync()
/// <summary>
/// Occurs when the subtitle langs row is applied
/// </summary>
/// <param name="sender">Adw.EntryRow</param>
/// <param name="e">EventArgs</param>
private void SubtitleLangsChanged(Adw.EntryRow sender, EventArgs e)
private void SubtitleLangsChanged()
{
_subtitleLangsRow.SetTitle(_("Subtitle Languages (Comma-Separated)"));
_subtitleLangsRow.RemoveCssClass("error");
var valid = _controller.ValidateSubtitleLangs(_subtitleLangsRow.GetText());
if(valid)
{
_controller.SubtitleLangs = _subtitleLangsRow.GetText();
_controller.SaveConfiguration();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public class AddDownloadDialogController
/// </summary>
public MediaFileType PreviousMediaFileType => Configuration.Current.PreviousMediaFileType;
/// <summary>
/// The previously used subtitle downloading state
/// </summary>
public bool PreviousSubtitleState => Configuration.Current.PreviousSubtitleState;
/// <summary>
/// Whether or not to number titles
/// </summary>
public bool NumberTitles => Configuration.Current.NumberTitles;
Expand Down Expand Up @@ -247,15 +251,15 @@ public DownloadOptionsCheckStatus ValidateDownloadOptions(string saveFolder, boo
/// <param name="quality">The quality of the downloads</param>
/// <param name="resolution">The index of the video resolution if available</param>
/// <param name="audioLanguage">The audio language code</param>
/// <param name="subtitles">The subtitle format of the downloads</param>
/// <param name="subtitles">Whether or not to download the subtitles</param>
/// <param name="saveFolder">The save folder of the downloads</param>
/// <param name="limitSpeed">Whether or not to use speed limit</param>
/// <param name="splitChapters">Whether or not to split based on chapters</param>
/// <param name="cropThumbnail">Whether or not to crop the thumbnail</param>
/// <param name="timeframe">A Timeframe to restrict the timespan of the media download</param>
/// <param name="username">A username for the website (if available)</param>
/// <param name="password">A password for the website (if available)</param>
public void PopulateDownloads(MediaFileType mediaFileType, Quality quality, int? resolution, string? audioLanguage, Subtitle subtitles, string saveFolder, bool limitSpeed, bool splitChapters, bool cropThumbnail, Timeframe? timeframe, string? username, string? password)
public void PopulateDownloads(MediaFileType mediaFileType, Quality quality, int? resolution, string? audioLanguage, bool subtitles, string saveFolder, bool limitSpeed, bool splitChapters, bool cropThumbnail, Timeframe? timeframe, string? username, string? password)
{
Downloads.Clear();
foreach (var media in _mediaUrlInfo.MediaList)
Expand All @@ -274,6 +278,7 @@ public void PopulateDownloads(MediaFileType mediaFileType, Quality quality, int?
{
Configuration.Current.PreviousVideoResolution = _mediaUrlInfo.VideoResolutions[resolution.Value].ToString();
}
Configuration.Current.PreviousSubtitleState = subtitles;
Aura.Active.SaveConfig("config");
}

Expand All @@ -284,14 +289,14 @@ public void PopulateDownloads(MediaFileType mediaFileType, Quality quality, int?
/// <param name="quality">The quality of the downloads</param>
/// <param name="resolution">The index of the video resolution if available</param>
/// <param name="audioLanguage">The audio language code</param>
/// <param name="subtitles">The subtitle format of the downloads</param>
/// <param name="subtitles">Whether or not to download the subtitles</param>
/// <param name="saveFolder">The save folder of the downloads</param>
/// <param name="limitSpeed">Whether or not to use speed limit</param>
/// <param name="splitChapters">Whether or not to split based on chapters</param>
/// <param name="cropThumbnail">Whether or not to crop the thumbnail</param>
/// <param name="timeframe">A Timeframe to restrict the timespan of the media download</param>
/// <param name="credentialIndex">The index of the credential to use</param>
public async Task PopulateDownloadsAsync(MediaFileType mediaFileType, Quality quality, int? resolution, string? audioLanguage, Subtitle subtitles, string saveFolder, bool limitSpeed, bool splitChapters, bool cropThumbnail, Timeframe? timeframe, int credentialIndex)
public async Task PopulateDownloadsAsync(MediaFileType mediaFileType, Quality quality, int? resolution, string? audioLanguage, bool subtitles, string saveFolder, bool limitSpeed, bool splitChapters, bool cropThumbnail, Timeframe? timeframe, int credentialIndex)
{
if(_keyring != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class MainWindowController : IDisposable
/// <summary>
/// The DownloadOptions for a download
/// </summary>
public DownloadOptions DownloadOptions => new DownloadOptions(Configuration.Current.OverwriteExistingFiles, Configuration.Current.UseAria, Configuration.Current.AriaMaxConnectionsPerServer, Configuration.Current.AriaMinSplitSize, Configuration.Current.YouTubeSponsorBlock, Configuration.Current.SubtitleLangs, Configuration.Current.ProxyUrl, Configuration.Current.CookiesPath, Configuration.Current.EmbedMetadata, Configuration.Current.EmbedChapters);
public DownloadOptions DownloadOptions => new DownloadOptions(Configuration.Current.OverwriteExistingFiles, Configuration.Current.UseAria, Configuration.Current.AriaMaxConnectionsPerServer, Configuration.Current.AriaMinSplitSize, Configuration.Current.YouTubeSponsorBlock, Configuration.Current.SubtitleLangs, Configuration.Current.ProxyUrl, Configuration.Current.CookiesPath, Configuration.Current.EmbedMetadata, Configuration.Current.RemoveSourceData, Configuration.Current.EmbedChapters);
/// <summary>
/// Gets the DownloadHistory object
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal PreferencesViewController()
{
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Where(x => !string.IsNullOrEmpty(x.Name)).ToArray();
var codes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
codes.UnionWith(cultures.Select(x => x.TwoLetterISOLanguageName));
nlogozzo marked this conversation as resolved.
Show resolved Hide resolved
codes.UnionWith(cultures.Select(x => x.Name));
codes.UnionWith(cultures.Select(x => x.ThreeLetterISOLanguageName));
_supportedLangCodes = codes.ToList();
}
Expand Down Expand Up @@ -218,6 +218,17 @@ public bool CropAudioThumbnails
set => Configuration.Current.CropAudioThumbnails = value;
}

/// <summary>
/// Whether or not to remove data about media source from metadata
/// </summary>
/// <remarks>This includes comment, description, synopsis and purl fields</remarks>
public bool RemoveSourceData
{
get => Configuration.Current.RemoveSourceData;

set => Configuration.Current.RemoveSourceData = value;
}

/// <summary>
/// Whether or not to embed chapters in a download
/// </summary>
Expand Down
22 changes: 22 additions & 0 deletions NickvisionTubeConverter.Shared/Docs/html/C/converter.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Default: Off</p></div></div></div>
</div>
</dd>
<dt class="terms">Remove Source Data</dt>
<dd class="terms">
<p class="p">Only available if Embed Metadata is enabled.</p>
<p class="p">If enabled, Parabolic will clear metadata fields containing the URL and other identifying information of the media source.</p>
<p class="p">Fields that are cleared: <span class="code">comment</span>, <span class="code">description</span>, <span class="code">synopsis</span>, <span class="code">purl</span> and <span class="code">handler_name</span> in each stream.</p>
<div class="note note-advanced" title="Advanced">
<svg height="24" width="24" version="1.1">
<g>
<path class="yelp-svg-fill" d="m5.4473 12.572c-2.039 0.957-3.4473 3.019-3.4473 5.428v4h20v-4c0-2.406-1.406-4.466-3.441-5.424a8 8 0 0 1 -6.559 3.424 8 8 0 0 1 -6.5527 -3.428z"></path>
<path class="yelp-svg-fill" d="m12 3a5 5 0 0 0 -5 5 5 5 0 0 0 5 5 5 5 0 0 0 5 -5 5 5 0 0 0 -5 -5zm0 3a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"></path>
<path class="yelp-svg-fill" d="m15.312 6 3.688 1v2l-3.4688 1z"></path>
<path class="yelp-svg-fill" d="m14 11.312-1 3.688h-2l-1-3.469z"></path>
<path class="yelp-svg-fill" d="m10 4.6875 1-3.6875h2l1 3.4688z"></path>
<path class="yelp-svg-fill" d="m8.6875 10-3.6875-1v-2l3.4688-1z"></path>
<path class="yelp-svg-fill" d="m12.928 4.2435 3.3146-1.9003 1.4142 1.4142-1.7457 3.1599z"></path>
<path class="yelp-svg-fill" d="m15.757 8.9281 1.9003 3.3146-1.4142 1.4142-3.1599-1.7457z"></path>
<path class="yelp-svg-fill" d="m8.2435 7.0719-1.9004-3.3145 1.4143-1.4143 3.1596 1.7457z"></path>
<path class="yelp-svg-fill" d="m11.072 11.757-3.3146 1.9-1.4143-1.414 1.7457-3.1602z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Default: Off</p></div></div></div>
</div>
</dd>
<dt class="terms">Embed Chapters</dt>
<dd class="terms">
<p class="p">If enabled, Parabolic will tag a media with chapter information if available</p>
Expand Down
6 changes: 3 additions & 3 deletions NickvisionTubeConverter.Shared/Docs/html/C/downloader.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@
</dd>
<dt class="terms">Subtitles Languages</dt>
<dd class="terms">
<p class="p">A comma-separated list of two-letter and three-letter language codes to use when selecting languages of subtitles to download. Only applies when a valid <span class="code">Subtitle</span> format is selected in a download.</p>
<p class="p">A comma-separated list of two-letter, two-letter with region, and three-letter language codes to use when selecting languages of subtitles to download. Only applies when downloading a video with subtitles.</p>
<div class="note" title="Note">
<svg height="24" width="24" version="1.1">
<g>
<path class="yelp-svg-fill" d="m4 3h16c0.554 0 1 0.446 1 1v11h-6v6h-11c-0.554 0-1-0.446-1-1v-16c0-0.554 0.446-1 1-1z"></path>
<path class="yelp-svg-fill" d="m17 16h4l-5 5v-4c0-0.554 0.446-1 1-1z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Some sites use two-letter language codes, whereas others use three-letter. For example, <span class="code">en</span> and <span class="code">eng</span> are both used for English. Please specify both two-letter and three-letter codes for your languages for the best results.</p></div></div></div>
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Different sites can use different language code formats for the same language. You may encounter one of the following three types: two-letter, two-letter with region, or three-letter. For example, "en", "en-US" and "eng" are all used for English. Please specify all valid codes for your languages for the best results.</p></div></div></div>
</div>
<div class="note note-advanced" title="Advanced">
<svg height="24" width="24" version="1.1">
Expand All @@ -197,7 +197,7 @@
<path class="yelp-svg-fill" d="m8.2435 7.0719-1.9004-3.3145 1.4143-1.4143 3.1596 1.7457z"></path>
<path class="yelp-svg-fill" d="m11.072 11.757-3.3146 1.9-1.4143-1.414 1.7457-3.1602z"></path>
</g>
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Default: Your culture's two-letter and three-letter language code. For example, on an en-US system the default would be <span class="code">en,eng</span></p></div></div></div>
</svg><div class="inner"><div class="region"><div class="contents"><p class="p">Default: Your culture's language codes. For example, on an en-US system the default would be <span class="code">en,en-US,eng</span></p></div></div></div>
</div>
</dd>
<dt class="terms">Proxy URL</dt>
Expand Down
Loading