Simplify Folder Watcher (#1484)
* Refactored Library Watcher to use Hangfire under the hood. * Support .kavitaignore at root level. * Refactored a lot of the library watching code to process faster and handle when FileSystemWatcher runs out of internal buffer space. It's still not perfect, but good enough for basic use. * Make folder watching as experimental and default it to off by default. * Revert #1479 * Tweaked the messaging for OPDS to remove a note about download role. Moved some code closer to where it's used. * Cleaned up how the events widget reports * Fixed a null issue when deleting series in the UI * Cleaned up some debug code * Added more information for when we skip a scan * Cleaned up some logging messages in CoverGen tasks * More log message tweaks * Added some debug to help identify a rare issue * Fixed a bug where save bookmarks as webp could get reset to false when saving other server settings * Updated some documentation on library watcher. * Make LibraryWatcher fire every 5 mins
This commit is contained in:
parent
b64ed6df8d
commit
b07aaf1eb5
19 changed files with 187 additions and 259 deletions
|
@ -337,35 +337,42 @@ namespace API.SignalR
|
|||
/// Represents a file being scanned by Kavita for processing and grouping
|
||||
/// </summary>
|
||||
/// <remarks>Does not have a progress as it's unknown how many files there are. Instead sends -1 to represent indeterminate</remarks>
|
||||
/// <param name="filename"></param>
|
||||
/// <param name="folderPath"></param>
|
||||
/// <param name="libraryName"></param>
|
||||
/// <param name="eventType"></param>
|
||||
/// <returns></returns>
|
||||
public static SignalRMessage FileScanProgressEvent(string filename, string libraryName, string eventType)
|
||||
public static SignalRMessage FileScanProgressEvent(string folderPath, string libraryName, string eventType)
|
||||
{
|
||||
return new SignalRMessage()
|
||||
{
|
||||
Name = FileScanProgress,
|
||||
Title = $"Scanning {libraryName}",
|
||||
SubTitle = Path.GetFileName(filename),
|
||||
SubTitle = folderPath,
|
||||
EventType = eventType,
|
||||
Progress = ProgressType.Indeterminate,
|
||||
Body = new
|
||||
{
|
||||
Title = $"Scanning {libraryName}",
|
||||
Subtitle = filename,
|
||||
Filename = filename,
|
||||
Subtitle = folderPath,
|
||||
Filename = folderPath,
|
||||
EventTime = DateTime.Now,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This informs the UI with details about what is being processed by the Scanner
|
||||
/// </summary>
|
||||
/// <param name="libraryName"></param>
|
||||
/// <param name="eventType"></param>
|
||||
/// <param name="seriesName"></param>
|
||||
/// <returns></returns>
|
||||
public static SignalRMessage LibraryScanProgressEvent(string libraryName, string eventType, string seriesName = "")
|
||||
{
|
||||
return new SignalRMessage()
|
||||
{
|
||||
Name = ScanProgress,
|
||||
Title = $"Scanning {libraryName}",
|
||||
Title = $"Processing {seriesName}",
|
||||
SubTitle = seriesName,
|
||||
EventType = eventType,
|
||||
Progress = ProgressType.Indeterminate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue