Skip to content

Commit

Permalink
Merge pull request shaked6540#241 from cristianst85/fix-spelling-errors
Browse files Browse the repository at this point in the history
Fixed some spelling errors throughout the solution
  • Loading branch information
shaked6540 authored Mar 11, 2024
2 parents b9b2589 + 2a99b88 commit cfa4539
Show file tree
Hide file tree
Showing 19 changed files with 107 additions and 107 deletions.
4 changes: 2 additions & 2 deletions YoutubePlaylistDownloader/ChangelogAllVersions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Sorry for the long wait, im only home at weekends :(

Version 1.7.3:
- Added Español translation
- Fixed a bug that caused the program to now show the correct amount of convertions being made
- Fixed a bug that caused the program to now show the correct amount of conversions being made


Version 1.7.2:
Expand All @@ -287,7 +287,7 @@ Version 1.7.2:


Version 1.7.1:
- Added the ability to limit file convertions count, so the program will not use 100% cpu.
- Added the ability to limit file conversions count, so the program will not use 100% cpu.
An explanation about this feature is available at the Help page.


Expand Down
36 changes: 18 additions & 18 deletions YoutubePlaylistDownloader/DownloadPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial class DownloadPage : UserControl, IDisposable, IDownload
private readonly bool silent;
private FixedQueue<double> downloadSpeeds;
private readonly Dictionary<IVideo, int> indexes = [];
private readonly List<Task> convertionTasks = [];
private readonly List<Task> conversionTasks = [];

public bool StillDownloading;

Expand Down Expand Up @@ -273,14 +273,14 @@ public async Task StartDownloadingWithConverting(PlaylistId? playlistId, Cancell
{
if (StartIndex > Videos.Count() - 1)
{
await GlobalConsts.ShowMessage($"{FindResource("NoVideosToDownload")}", $"{FindResource("ThereAreNoVidoesToDownload")}");
await GlobalConsts.ShowMessage($"{FindResource("NoVideosToDownload")}", $"{FindResource("ThereAreNoVideosToDownload")}");
StillDownloading = false;
GlobalConsts.LoadPage(GlobalConsts.MainPage.Load());
}

var client = GlobalConsts.YoutubeClient;
var convertingCount = 0;
convertionTasks.Clear();
conversionTasks.Clear();
for (var i = StartIndex; i <= EndIndex; i++)
{
var video = Videos.ElementAtOrDefault(i);
Expand Down Expand Up @@ -445,15 +445,15 @@ await Dispatcher.InvokeAsync(() =>
await GlobalConsts.Log(ex.ToString(), "DownloadPage with convert");
}
};
if (!GlobalConsts.settings.LimitConvertions)
if (!GlobalConsts.settings.LimitConversions)
{
ffmpeg.Start();
convertingCount++;
ffmpegList.Add(ffmpeg);
}
else
{
convertionTasks.Add(Task.Run(async () =>
conversionTasks.Add(Task.Run(async () =>
{
try
{
Expand All @@ -469,7 +469,7 @@ await Dispatcher.InvokeAsync(() =>
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "ConvertionLocker at StartDownloadingWithConverting at DownloadPage.xaml.cs");
await GlobalConsts.Log(ex.ToString(), "ConversionsLocker at StartDownloadingWithConverting at DownloadPage.xaml.cs");
}
}, token));
}
Expand Down Expand Up @@ -512,7 +512,7 @@ await Dispatcher.InvokeAsync(() =>
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "DownloadPage DownlaodWithConvert");
await GlobalConsts.Log(ex.ToString(), "DownloadPage DownloadWithConvert");
NotDownloaded.Add(new Tuple<IVideo, string>(video, ex.Message));
}
}
Expand All @@ -531,7 +531,7 @@ await GlobalConsts.ShowSelectableDialog($"{FindResource("CouldntDownload")}",
});
}

while (ffmpegList.Count > 0 || convertionTasks?.Count(x => !x.IsCompleted) > 0)
while (ffmpegList.Count > 0 || conversionTasks?.Count(x => !x.IsCompleted) > 0)
{
await Dispatcher.InvokeAsync(() =>
{
Expand Down Expand Up @@ -582,7 +582,7 @@ await Dispatcher.InvokeAsync(() =>
}
finally
{
await Task.WhenAll(convertionTasks);
await Task.WhenAll(conversionTasks);
StillDownloading = false;
Dispose();
}
Expand All @@ -592,14 +592,14 @@ public async Task StartDownloading(CancellationToken token)
{
if (StartIndex > Videos.Count() - 1)
{
await GlobalConsts.ShowMessage($"{FindResource("NoVideosToDownload")}", $"{FindResource("ThereAreNoVidoesToDownload")}");
await GlobalConsts.ShowMessage($"{FindResource("NoVideosToDownload")}", $"{FindResource("ThereAreNoVideosToDownload")}");
StillDownloading = false;
GlobalConsts.LoadPage(GlobalConsts.MainPage.Load());
}

var client = GlobalConsts.YoutubeClient;
var convertingCount = 0;
convertionTasks.Clear();
conversionTasks.Clear();
for (var i = StartIndex; i <= EndIndex; i++)
{
var video = Videos.ElementAtOrDefault(i);
Expand Down Expand Up @@ -787,15 +787,15 @@ await Dispatcher.InvokeAsync(() =>
}
};

if (!GlobalConsts.settings.LimitConvertions)
if (!GlobalConsts.settings.LimitConversions)
{
ffmpeg.Start();
convertingCount++;
ffmpegList.Add(ffmpeg);
}
else
{
convertionTasks.Add(Task.Run(async () =>
conversionTasks.Add(Task.Run(async () =>
{
try
{
Expand All @@ -811,7 +811,7 @@ await Dispatcher.InvokeAsync(() =>
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "ConvertionLocker at StartDownloading at DownloadPage.xaml.cs");
await GlobalConsts.Log(ex.ToString(), "ConversionsLocker at StartDownloading at DownloadPage.xaml.cs");
}
}, token));
}
Expand All @@ -826,7 +826,7 @@ await Dispatcher.InvokeAsync(() =>
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "DownloadPage DownlaodWithConvert");
await GlobalConsts.Log(ex.ToString(), "DownloadPage DownloadWithConvert");
NotDownloaded.Add(new Tuple<IVideo, string>(video, ex.Message));
}
}
Expand All @@ -845,7 +845,7 @@ await GlobalConsts.ShowSelectableDialog($"{FindResource("CouldntDownload")}",
});
}

while (ffmpegList.Count > 0 || convertionTasks?.Count(x => !x.IsCompleted) > 0)
while (ffmpegList.Count > 0 || conversionTasks?.Count(x => !x.IsCompleted) > 0)
{
await Dispatcher.InvokeAsync(() =>
{
Expand Down Expand Up @@ -886,7 +886,7 @@ await Dispatcher.InvokeAsync(() =>
CurrentDownloadProgressBarTextBlock.Visibility = Visibility.Collapsed;
});

await Task.WhenAll(convertionTasks);
await Task.WhenAll(conversionTasks);

if (GlobalConsts.DownloadSettings.OpenDestinationFolderWhenDone)
OpenFolder_Click(null, null);
Expand All @@ -902,7 +902,7 @@ private void Background_Exit(object sender, RoutedEventArgs e)
private void Update(int percent, IVideo video)
{
CurrentDownloadProgressBar.Value = percent;
HeadlineTextBlock.Text = (string)FindResource("CurrentlyDownlading") + video.Title;
HeadlineTextBlock.Text = (string)FindResource("CurrentlyDownloading") + video.Title;
CurrentDownloadProgressBarTextBlock.Text = $"{percent}%";
TotalDownloadsProgressBarTextBlock.Text = $"{DownloadedCount} {FindResource("Of")} {Maximum}";
DownloadedVideosProgressBar.Value = DownloadedCount;
Expand Down
6 changes: 3 additions & 3 deletions YoutubePlaylistDownloader/GlobalConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ static class GlobalConsts
private static DownloadSettings downloadSettings;
public static readonly string DownloadSettingsFilePath;
public static readonly ObservableCollection<QueuedDownload> Downloads;
private static SemaphoreSlim convertionLocker;
private static SemaphoreSlim conversionLocker;
public static Objects.Settings settings;

public static string OppositeTheme => settings.Theme == "Light" ? "Dark" : "Light";
public static YoutubeClient YoutubeClient => new();
public static SemaphoreSlim ConversionsLocker { get => convertionLocker; set => convertionLocker ??= value; }
public static SemaphoreSlim ConversionsLocker { get => conversionLocker; set => conversionLocker ??= value; }
public static DownloadSettings DownloadSettings
{
get
Expand Down Expand Up @@ -173,7 +173,7 @@ public static void LoadConsts()
try
{
settings = JsonConvert.DeserializeObject<Objects.Settings>(File.ReadAllText(ConfigFilePath));
ConversionsLocker = new SemaphoreSlim(settings.ActualConvertionsLimit, settings.MaximumConverstionsCount);
ConversionsLocker = new SemaphoreSlim(settings.ActualConversionsLimit, settings.MaximumConversionsCount);

LoadDownloadSettings();
}
Expand Down
4 changes: 2 additions & 2 deletions YoutubePlaylistDownloader/Help.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
</FlowDocument>
</RichTextBox>
</Controls:MetroTabItem>
<Controls:MetroTabItem Header="{DynamicResource FileConvertion}">
<Controls:MetroTabItem Header="{DynamicResource FileConversion}">
<RichTextBox MaxWidth="1200" Width="600" Margin="5,0,0,0" BorderThickness="0" Cursor="Arrow" IsReadOnly="True" IsReadOnlyCaretVisible="False" Height="Auto" >
<FlowDocument>
<Paragraph>
<Run FontSize="14" Text="{DynamicResource ConvertionsLimitingExplnation}" />
<Run FontSize="14" Text="{DynamicResource ConversionsLimitingExplanation}" />
</Paragraph>
</FlowDocument>
</RichTextBox>
Expand Down
8 changes: 4 additions & 4 deletions YoutubePlaylistDownloader/Languages/Deutsch.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<s:String x:Key="Description">Beschreibung: </s:String>
<s:String x:Key="Views">Aufrufe: </s:String>
<s:String x:Key="SaveDirectory">Videos speichern unter: </s:String>
<s:String x:Key="CurrentlyDownlading">Derzeit herunterladend: </s:String>
<s:String x:Key="CurrentlyDownloading">Derzeit herunterladend: </s:String>
<s:String x:Key="TotalProgress">Bis jetzt heruntergeladen: </s:String>
<s:String x:Key="AllDone">Fertig.</s:String>
<s:String x:Key="Canceling">Downloads werden abgebrochen, bitte warten Sie...</s:String>
Expand Down Expand Up @@ -74,7 +74,7 @@ Fehlermeldung: </s:String>
<s:String x:Key="UntilIndex">bis Video Nr. </s:String>
<s:String x:Key="LeaveEmptyOrZeroForUntilTheEnd">(lassen Sie dies leer oder geben Sie 0 ein, um alle Video bis zum Ende der Playlist herunterzuladen)</s:String>
<s:String x:Key="NoVideosToDownload">konnte keine Videos zum Herunterladen finden</s:String>
<s:String x:Key="ThereAreNoVidoesToDownload">Es gibt keine herunterladbaren Videos mit den von Ihnen angegebenen Parametern.</s:String>
<s:String x:Key="ThereAreNoVideosToDownload">Es gibt keine herunterladbaren Videos mit den von Ihnen angegebenen Parametern.</s:String>
<s:String x:Key="UpdateNow">jetzt aktualisieren</s:String>
<s:String x:Key="Subscriptions">Abonnements</s:String>
<s:String x:Key="AutomaticllyDownloadSubscriptions">Automatisch alle Videos dieser Kanäle herunterladen</s:String>
Expand Down Expand Up @@ -136,11 +136,11 @@ Timofey Dedov (Русский)
<s:String x:Key="LimitConverstions" >Maximale gleichzeitige Konvertierungen: </s:String>
<s:String x:Key="ValueChangeRequiresRestart">(aktivieren dieser Beschränkung erfordert
einen Neustart des Programmes)</s:String>
<s:String x:Key="ConvertionsLimitingExplnation">Jede Datei-Konvertierung benötigt etwa einen Kern.
<s:String x:Key="ConversionsLimitingExplanation">Jede Datei-Konvertierung benötigt etwa einen Kern.
Haben Sie eine CPU mit vier Kernen und beschränken Sie das Programm auf drei gleichzeitige Konvertierungen, so werden Sie im Task-Manager sehen, dass das Programm ungefähr 75% der CPU benutzt.
Ich empfehle, einen Kern weniger zu benutzen und dementsprechend eine gleichzeitige Konvetierung weniger einzustellen, als Ihre CPU-Kerne hat.
Beispiel: Hat Ihre CPU hat vier Kerne, so stellen Sie drei gleichzeitge Konvertierungen ein.</s:String>
<s:String x:Key="FileConvertion">Konvertierung</s:String>
<s:String x:Key="FileConversion">Konvertierung</s:String>
<s:String x:Key="General">Allgemein</s:String>
<s:String x:Key="SavePlaylistInUniqueDirectory">Jede Playlist in einem anderen Ordner speichern</s:String>
<s:String x:Key="Playlist">Playlist</s:String>
Expand Down
8 changes: 4 additions & 4 deletions YoutubePlaylistDownloader/Languages/English.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<s:String x:Key="Description">Description: </s:String>
<s:String x:Key="Views">Views: </s:String>
<s:String x:Key="SaveDirectory">Save videos to:</s:String>
<s:String x:Key="CurrentlyDownlading">Currently downloading: </s:String>
<s:String x:Key="CurrentlyDownloading">Currently downloading: </s:String>
<s:String x:Key="TotalProgress">Downloaded so far: </s:String>
<s:String x:Key="AllDone">All Done.</s:String>
<s:String x:Key="Canceling">Cancelling your downloads, please wait...</s:String>
Expand Down Expand Up @@ -75,7 +75,7 @@ Error message: </s:String>
<s:String x:Key="UntilIndex">until video number</s:String>
<s:String x:Key="LeaveEmptyOrZeroForUntilTheEnd">(leave this empty or enter 0 to download all videos until the end of the playlist)</s:String>
<s:String x:Key="NoVideosToDownload">Could not find videos to download</s:String>
<s:String x:Key="ThereAreNoVidoesToDownload">There are no videos to download with the parameters you specified</s:String>
<s:String x:Key="ThereAreNoVideosToDownload">There are no videos to download with the parameters you specified</s:String>
<s:String x:Key="UpdateNow">Update now</s:String>
<s:String x:Key="Subscriptions">Subscriptions</s:String>
<s:String x:Key="AutomaticllyDownloadSubscriptions">Automatically download new videos from these channels</s:String>
Expand Down Expand Up @@ -138,14 +138,14 @@ Timofey Dedov (Русский)
<s:String x:Key="LimitConverstions">Set the maximum concurrent file conversions to</s:String>
<s:String x:Key="ValueChangeRequiresRestart">(enabling the limit requires a
program restart to take effect)</s:String>
<s:String x:Key="ConvertionsLimitingExplnation">Every file conversion takes about one core completely. For example: if you have a 4
<s:String x:Key="ConversionsLimitingExplanation">Every file conversion takes about one core completely. For example: if you have a 4
cores CPU, limiting the program to 3 file conversions at a time will use 3 cores out of 4;
in Task Manager you will see that the program uses a little more than 75% CPU.

It is recommended to use one less core than what your CPU has. If your CPU has 4 cores,
use 3 cores by limiting the file conversion to 3, if you have 3 cores, use 2 cores by limiting
the file conversion to 2, etc.</s:String>
<s:String x:Key="FileConvertion">File Conversion</s:String>
<s:String x:Key="FileConversion">File Conversion</s:String>
<s:String x:Key="General">General</s:String>
<s:String x:Key="SavePlaylistInUniqueDirectory">Save every playlist in a different folder</s:String>
<s:String x:Key="Playlist">Playlist</s:String>
Expand Down
8 changes: 4 additions & 4 deletions YoutubePlaylistDownloader/Languages/Español.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<s:String x:Key="Description">Descripción: </s:String>
<s:String x:Key="Views">Vistas: </s:String>
<s:String x:Key="SaveDirectory">Guardar videos en: </s:String>
<s:String x:Key="CurrentlyDownlading">Actualmente descargando: </s:String>
<s:String x:Key="CurrentlyDownloading">Actualmente descargando: </s:String>
<s:String x:Key="TotalProgress">Descargados hasta ahora: </s:String>
<s:String x:Key="AllDone">Operación completada.</s:String>
<s:String x:Key="Canceling">Cancelando las descargas, por favor espere..</s:String>
Expand Down Expand Up @@ -74,7 +74,7 @@ Mensaje de error: </s:String>
<s:String x:Key="UntilIndex">hasta el video número </s:String>
<s:String x:Key="LeaveEmptyOrZeroForUntilTheEnd">(Deja este campo vacío o escribe 0 para descargar todos los videos de la lista de reproducción)</s:String>
<s:String x:Key="NoVideosToDownload">No se encontraron videos para descargar</s:String>
<s:String x:Key="ThereAreNoVidoesToDownload">No hay videos para descargar con los parametros especificados</s:String>
<s:String x:Key="ThereAreNoVideosToDownload">No hay videos para descargar con los parametros especificados</s:String>
<s:String x:Key="UpdateNow">Actualizar ahora</s:String>
<s:String x:Key="Subscriptions">Suscripciones</s:String>
<s:String x:Key="AutomaticllyDownloadSubscriptions">Descargar automáticamente los videos nuevos de estos canales</s:String>
Expand Down Expand Up @@ -136,10 +136,10 @@ Timofey Dedov (Русский)
<s:String x:Key="BulkDownload">Descarga masiva</s:String>
<s:String x:Key="LimitConverstions" >Establecer el máximo de conversiones al mismo tiempo a</s:String>
<s:String x:Key="ValueChangeRequiresRestart">(se necesita reiniciar la aplicación para que los cambios tengan efecto)</s:String>
<s:String x:Key="ConvertionsLimitingExplnation">Cada video convertido necesita un procesador completo.
<s:String x:Key="ConversionsLimitingExplanation">Cada video convertido necesita un procesador completo.
Por ejemplo: si tienes un CPU de 4 núcleos, limitar el programa a 3 conversiones simultaneas usará 3 de los 4 núcleos, en el administrador de tareas veras que la aplicación utiliza un poco mas del 75% del CPU.
Se recomienda utilizar 1 núcleo menos de los que tienes disponibles. Si tu computadora tiene 4 núcleos, usa 3 limitando la conversión a 3, si tienes 3 núcleos, usa 2 núcleos limitando la conversion a 2, etc..</s:String>
<s:String x:Key="FileConvertion">Conversión de videos</s:String>
<s:String x:Key="FileConversion">Conversión de videos</s:String>
<s:String x:Key="General">General</s:String>
<s:String x:Key="SavePlaylistInUniqueDirectory">Save every playlist in a different folder</s:String>
<s:String x:Key="Playlist">Playlist</s:String>
Expand Down
Loading

0 comments on commit cfa4539

Please sign in to comment.