Compare commits
No commits in common. "ae0dc548aec77fa08f9c923f0c2289430558f676" and "d89ca0a2ef0c52f5fee45969f54d8586fce3173f" have entirely different histories.
ae0dc548ae
...
d89ca0a2ef
@ -522,7 +522,7 @@ public class Server : GlobalBase
|
||||
response.AddHeader("Access-Control-Max-Age", "1728000");
|
||||
response.AppendHeader("Access-Control-Allow-Origin", "*");
|
||||
|
||||
if (content is not Stream)
|
||||
if (content is not FileStream stream)
|
||||
{
|
||||
response.ContentType = "application/json";
|
||||
try
|
||||
@ -537,25 +537,8 @@ public class Server : GlobalBase
|
||||
Log(e.ToString());
|
||||
}
|
||||
}
|
||||
else if(content is FileStream stream)
|
||||
else
|
||||
{
|
||||
string contentType = stream.Name.Split('.')[^1];
|
||||
switch (contentType.ToLower())
|
||||
{
|
||||
case "gif":
|
||||
response.ContentType = "image/gif";
|
||||
break;
|
||||
case "png":
|
||||
response.ContentType = "image/png";
|
||||
break;
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
response.ContentType = "image/jpeg";
|
||||
break;
|
||||
case "log":
|
||||
response.ContentType = "text/plain";
|
||||
break;
|
||||
}
|
||||
stream.CopyTo(response.OutputStream);
|
||||
response.OutputStream.Close();
|
||||
stream.Close();
|
||||
|
@ -37,7 +37,7 @@ public class TrangaSettings
|
||||
throw new ArgumentException("Download-location and working-directory paths can not be empty!");
|
||||
this.apiPortNumber = apiPortNumber ?? 6531;
|
||||
this.downloadLocation = downloadLocation ?? (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "/Manga" : Path.Join(Directory.GetCurrentDirectory(), "Downloads"));
|
||||
this.workingDirectory = workingDirectory ?? Path.Join(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "/usr/share" : Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "tranga-api");
|
||||
this.workingDirectory = workingDirectory ?? Path.Join(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "/var/lib" : Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "tranga-api");
|
||||
ExportSettings();
|
||||
}
|
||||
else
|
||||
|
@ -5,7 +5,6 @@ services:
|
||||
container_name: tranga-api
|
||||
volumes:
|
||||
- ./Manga:/Manga
|
||||
- ./settings:/usr/share/tranga-api
|
||||
ports:
|
||||
- "6531:6531"
|
||||
restart: unless-stopped
|
||||
|
Loading…
Reference in New Issue
Block a user