Maybe fix deadlock

This commit is contained in:
Mike Nolan 2022-10-16 11:02:17 -05:00
parent f96764fd10
commit 1473dace87
3 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@ namespace Tesses.YouTubeDownloader.Net6
TYTDCurrentDirectory currentDirectory=new TYTDCurrentDirectory(new HttpClient()); TYTDCurrentDirectory currentDirectory=new TYTDCurrentDirectory(new HttpClient());
TYTDServer server=new TYTDServer(currentDirectory); TYTDServer server=new TYTDServer(currentDirectory);
server.RootServer.Server=new StaticServer("WebSite"); server.RootServer.Server=new StaticServer("WebSite");
currentDirectory.CanDownload=false; currentDirectory.CanDownload=true;
HttpServerListener listener=new HttpServerListener(new System.Net.IPEndPoint(System.Net.IPAddress.Any,3252),server.InnerServer); HttpServerListener listener=new HttpServerListener(new System.Net.IPEndPoint(System.Net.IPAddress.Any,3252),server.InnerServer);
currentDirectory.StartLoop(); currentDirectory.StartLoop();
TYTDStorage.FFmpeg ="/usr/bin/ffmpeg"; TYTDStorage.FFmpeg ="/usr/bin/ffmpeg";

View File

@ -61,7 +61,7 @@ namespace Tesses.YouTubeDownloader
public bool FileExists(string path) public bool FileExists(string path)
{ {
return FileExistsAsync(path).GetAwaiter().GetResult(); return Task.Run(()=>FileExistsAsync(path)).GetAwaiter().GetResult();
} }
public virtual async IAsyncEnumerable<string> GetVideoIdsAsync() public virtual async IAsyncEnumerable<string> GetVideoIdsAsync()
@ -213,6 +213,7 @@ namespace Tesses.YouTubeDownloader
public virtual bool DownloadExists(string url) public virtual bool DownloadExists(string url)
{ {
string enc=$"FileInfo/{B64.Base64UrlEncodes(url)}.json"; string enc=$"FileInfo/{B64.Base64UrlEncodes(url)}.json";
return FileExists(enc); return FileExists(enc);
} }
public virtual bool PlaylistInfoExists(PlaylistId id) public virtual bool PlaylistInfoExists(PlaylistId id)
@ -245,7 +246,7 @@ namespace Tesses.YouTubeDownloader
public virtual bool DirectoryExists(string path) public virtual bool DirectoryExists(string path)
{ {
return DirectoryExistsAsync(path).GetAwaiter().GetResult(); return Task.Run(()=>DirectoryExistsAsync(path)).GetAwaiter().GetResult();
} }
public virtual IEnumerable<string> EnumerateFiles(string path) public virtual IEnumerable<string> EnumerateFiles(string path)

View File

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