Release Testing Day 3 (#1946)

* Removed extra trace messages as the people issue might have been resolved.

* When registering, disable button until form is valid. Allow non-email formatted emails, but not blank.

* Fixed opds not having http(s)://

* Added a new API to allow scanning all libraries from end point

* Moved Bookmarks directory to Media tab

* Fixed an edge case for finding next chapter when we had volume 1,2 etc but they had the same chapter number.

* Code cleanup
This commit is contained in:
Joe Milazzo 2023-04-29 07:49:00 -05:00 committed by GitHub
parent 119ea35b62
commit 4e0e3608aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 253 additions and 141 deletions

View file

@ -111,13 +111,21 @@ public class LibraryController : BaseApiController
return Ok(_directoryService.ListDirectory(path));
}
/// <summary>
/// Return all libraries in the Server
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult<IEnumerable<LibraryDto>>> GetLibraries()
{
return Ok(await _unitOfWork.LibraryRepository.GetLibraryDtosForUsernameAsync(User.GetUsername()));
}
/// <summary>
/// For a given library, generate the jump bar information
/// </summary>
/// <param name="libraryId"></param>
/// <returns></returns>
[HttpGet("jump-bar")]
public async Task<ActionResult<IEnumerable<JumpKeyDto>>> GetJumpBar(int libraryId)
{
@ -127,7 +135,11 @@ public class LibraryController : BaseApiController
return Ok(_unitOfWork.LibraryRepository.GetJumpBarAsync(libraryId));
}
/// <summary>
/// Grants a user account access to a Library
/// </summary>
/// <param name="updateLibraryForUserDto"></param>
/// <returns></returns>
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("grant-access")]
public async Task<ActionResult<MemberDto>> UpdateUserLibraries(UpdateLibraryForUserDto updateLibraryForUserDto)
@ -172,14 +184,34 @@ public class LibraryController : BaseApiController
return BadRequest("There was a critical issue. Please try again.");
}
/// <summary>
/// Scans a given library for file changes.
/// </summary>
/// <param name="libraryId"></param>
/// <param name="force">If true, will ignore any optimizations to avoid file I/O and will treat similar to a first scan</param>
/// <returns></returns>
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("scan")]
public ActionResult Scan(int libraryId, bool force = false)
{
if (libraryId <= 0) return BadRequest("Invalid libraryId");
_taskScheduler.ScanLibrary(libraryId, force);
return Ok();
}
/// <summary>
/// Scans a given library for file changes. If another scan task is in progress, will reschedule the invocation for 3 hours in future.
/// </summary>
/// <param name="force">If true, will ignore any optimizations to avoid file I/O and will treat similar to a first scan</param>
/// <returns></returns>
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("scan-all")]
public ActionResult ScanAll(bool force = false)
{
_taskScheduler.ScanLibraries(force);
return Ok();
}
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("refresh-metadata")]
public ActionResult RefreshMetadata(int libraryId, bool force = true)

View file

@ -156,6 +156,10 @@ public class ServerController : BaseApiController
return Ok();
}
/// <summary>
/// Downloads all the log files via a zip
/// </summary>
/// <returns></returns>
[HttpGet("logs")]
public ActionResult GetLogs()
{
@ -180,6 +184,10 @@ public class ServerController : BaseApiController
return Ok(await _versionUpdaterService.CheckForUpdate());
}
/// <summary>
/// Pull the Changelog for Kavita from Github and display
/// </summary>
/// <returns></returns>
[HttpGet("changelog")]
public async Task<ActionResult<IEnumerable<UpdateNotificationDto>>> GetChangelog()
{
@ -198,6 +206,10 @@ public class ServerController : BaseApiController
return Ok(await _accountService.CheckIfAccessible(Request));
}
/// <summary>
/// Returns a list of reoccurring jobs. Scheduled ad-hoc jobs will not be returned.
/// </summary>
/// <returns></returns>
[HttpGet("jobs")]
public ActionResult<IEnumerable<JobDto>> GetJobs()
{
@ -212,6 +224,7 @@ public class ServerController : BaseApiController
});
return Ok(recurringJobs);
}
}