Refactored GetCoverImage to a static class and unit tested it. Enhanced the method by defaulting to folder.jpg file if exists, else takes first entry.
This commit is contained in:
parent
451d459473
commit
7f5a1d0518
12 changed files with 92 additions and 27 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace API.Parser
|
||||
|
|
@ -226,5 +227,12 @@ namespace API.Parser
|
|||
{
|
||||
return title.TrimStart(new[] { '0' });
|
||||
}
|
||||
|
||||
public static bool IsArchive(string filePath)
|
||||
{
|
||||
var fileInfo = new FileInfo(filePath);
|
||||
|
||||
return MangaFileExtensions.Contains(fileInfo.Extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue