Feature/image rework cleanup (#589)

* Added volume migrations. Added parser case for "Chapter 63 - The Promise Made for 520 Cenz.cbr"

* Added some info statements for when full library scans occur. For image apis, return the name of the file to aid in caching.

* When managing users, show the current logged in user at the top of the list. Added a message when no libraries have been setup but you are trying to add a user to a library.
This commit is contained in:
Joseph Milazzo 2021-09-22 06:00:14 -07:00 committed by GitHub
parent fb5866133a
commit a872165747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 10 deletions

View file

@ -1,4 +1,6 @@
using System.IO;
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using API.Extensions;
using API.Interfaces;
@ -34,7 +36,7 @@ namespace API.Controllers
var format = Path.GetExtension(path).Replace(".", "");
Response.AddCacheHeader(path);
return PhysicalFile(path, "image/" + format);
return PhysicalFile(path, "image/" + format, Path.GetFileName(path));
}
/// <summary>
@ -50,7 +52,7 @@ namespace API.Controllers
var format = Path.GetExtension(path).Replace(".", "");
Response.AddCacheHeader(path);
return PhysicalFile(path, "image/" + format);
return PhysicalFile(path, "image/" + format, Path.GetFileName(path));
}
/// <summary>
@ -66,7 +68,7 @@ namespace API.Controllers
var format = Path.GetExtension(path).Replace(".", "");
Response.AddCacheHeader(path);
return PhysicalFile(path, "image/" + format);
return PhysicalFile(path, "image/" + format, Path.GetFileName(path));
}
/// <summary>
@ -82,7 +84,7 @@ namespace API.Controllers
var format = Path.GetExtension(path).Replace(".", "");
Response.AddCacheHeader(path);
return PhysicalFile(path, "image/" + format);
return PhysicalFile(path, "image/" + format, Path.GetFileName(path));
}
}
}

View file

@ -54,7 +54,7 @@ namespace API.Controllers
if (string.IsNullOrEmpty(path) || !System.IO.File.Exists(path)) return BadRequest($"No such image for page {page}");
var format = Path.GetExtension(path).Replace(".", "");
return PhysicalFile(path, "image/" + format);
return PhysicalFile(path, "image/" + format, Path.GetFileName(path));
}
catch (Exception)
{