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
4 changed files with 16 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue