Fixed some things

This commit is contained in:
Mike Nolan 2022-06-15 03:04:26 -05:00
parent 0a67162acb
commit 49ac494969
5 changed files with 43 additions and 21 deletions

View File

@ -54,6 +54,6 @@ namespace Tesses.YouTubeDownloader
Task<bool> DownloadVideoOnlyAsync(SavedVideo video,CancellationToken token,IProgress<double> progress,bool report=true);
Task MoveLegacyStreams(SavedVideo video,BestStreams streams);
void StartLoop(CancellationToken token=default(CancellationToken));
}
}

View File

@ -85,19 +85,35 @@ namespace Tesses.YouTubeDownloader
public override async IAsyncEnumerable<string> EnumerateDirectoriesAsync(string path)
{
if(string.IsNullOrWhiteSpace(path))
{
foreach(var item in Directory.EnumerateDirectories(Environment.CurrentDirectory))
{
yield return await Task.FromResult(Path.GetFileName(item));
}
}else{
foreach(var dir in Directory.EnumerateDirectories(path))
{
yield return await Task.FromResult(Path.GetFileName(dir));
}
}
}
public override async IAsyncEnumerable<string> EnumerateFilesAsync(string path)
{
if(string.IsNullOrWhiteSpace(path))
{
foreach(var item in Directory.EnumerateFiles(Environment.CurrentDirectory))
{
yield return await Task.FromResult(Path.GetFileName(item));
}
}else{
foreach(var file in Directory.EnumerateFiles(path))
{
yield return await Task.FromResult(Path.GetFileName(file));
}
}
}
public override async Task<bool> FileExistsAsync(string path)
{
@ -217,19 +233,35 @@ namespace Tesses.YouTubeDownloader
public override async IAsyncEnumerable<string> EnumerateDirectoriesAsync(string path)
{
if(string.IsNullOrWhiteSpace(path))
{
foreach(var item in Directory.EnumerateDirectories(_path))
{
yield return await Task.FromResult(Path.GetFileName(item));
}
}else{
foreach(var dir in Directory.EnumerateDirectories(GetPath(path)))
{
yield return await Task.FromResult(Path.GetFileName(dir));
}
}
}
public override async IAsyncEnumerable<string> EnumerateFilesAsync(string path)
{
if(string.IsNullOrWhiteSpace(path))
{
foreach(var item in Directory.EnumerateFiles(_path))
{
yield return await Task.FromResult(Path.GetFileName(item));
}
}else{
foreach(var file in Directory.EnumerateFiles(GetPath(path)))
{
yield return await Task.FromResult(Path.GetFileName(file));
}
}
}
public override async Task<bool> FileExistsAsync(string path)
{

View File

@ -573,6 +573,13 @@ namespace Tesses.YouTubeDownloader
e.Unsubscribe(id);
});
}
public void StartLoop(CancellationToken token = default)
{
StorageAsStorage((e)=>{
e.StartLoop(token);
});
}
}
public class DownloaderMigration

View File

@ -7,9 +7,9 @@
<PackageId>Tesses.YouTubeDownloader</PackageId>
<Author>Mike Nolan</Author>
<Company>Tesses</Company>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0</AssemblyVersion>
<FileVersion>1.1.0</FileVersion>
<Version>1.1.1</Version>
<AssemblyVersion>1.1.1</AssemblyVersion>
<FileVersion>1.1.1</FileVersion>
<Description>A YouTube Downloader</Description>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

View File

@ -1,17 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tesses.YouTubeDownloader", "Tesses.YouTubeDownloader.csproj", "{77B23470-768E-4927-8F09-20357D2E8032}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{77B23470-768E-4927-8F09-20357D2E8032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77B23470-768E-4927-8F09-20357D2E8032}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77B23470-768E-4927-8F09-20357D2E8032}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77B23470-768E-4927-8F09-20357D2E8032}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal