mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Adjusted code to account for folders within directory. Now cover image always gets the first image.
This commit is contained in:
parent
7bf04dcdac
commit
6b4617bab3
@ -12,7 +12,7 @@ namespace API.Tests.Services
|
||||
[Theory]
|
||||
[InlineData("v10.cbz", "v10.expected.jpg")]
|
||||
[InlineData("v10 - with folder.cbz", "v10 - with folder.expected.jpg")]
|
||||
//[InlineData("v10 - nested folder.cbz", "v10 - nested folder.expected.jpg")]
|
||||
[InlineData("v10 - nested folder.cbz", "v10 - nested folder.expected.jpg")]
|
||||
public void GetCoverImageTest(string inputFile, string expectedOutputFile)
|
||||
{
|
||||
var testDirectory = Path.Join(Directory.GetCurrentDirectory(), "../../../Services/Test Data/ImageProvider");
|
||||
|
7
API/Entities/AppUserProgress.cs
Normal file
7
API/Entities/AppUserProgress.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace API.Entities
|
||||
{
|
||||
public class AppUserProgress
|
||||
{
|
||||
|
||||
}
|
||||
}
|
7
API/Entities/MangaFormat.cs
Normal file
7
API/Entities/MangaFormat.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace API.Entities
|
||||
{
|
||||
public enum MangaFormat
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -26,18 +26,13 @@ namespace API.IO
|
||||
|
||||
|
||||
var folder = archive.Entries.SingleOrDefault(x => Path.GetFileNameWithoutExtension(x.Name).ToLower() == "folder");
|
||||
var entry = archive.Entries.OrderBy(x => x.FullName).ToList()[0];
|
||||
var entry = archive.Entries.Where(x => Path.HasExtension(x.FullName)).OrderBy(x => x.FullName).ToList()[0];
|
||||
|
||||
if (folder != null)
|
||||
{
|
||||
entry = folder;
|
||||
}
|
||||
|
||||
if (entry.FullName.EndsWith(Path.PathSeparator))
|
||||
{
|
||||
// TODO: Implement nested directory support
|
||||
}
|
||||
|
||||
if (createThumbnail)
|
||||
{
|
||||
try
|
||||
|
Loading…
x
Reference in New Issue
Block a user