mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
* Removed directives, ensured we delete bookmarks and reading list items when chapters are deleted. * Added parsing support for "Kimi no Koto ga Daidaidaidaidaisuki na 100-nin no Kanojo Chapter 11-10"
36 lines
923 B
C#
36 lines
923 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using API.Interfaces.Repositories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Data.Repositories
|
|
{
|
|
public class FileRepository : IFileRepository
|
|
{
|
|
private readonly DataContext _dbContext;
|
|
|
|
public FileRepository(DataContext context)
|
|
{
|
|
_dbContext = context;
|
|
}
|
|
|
|
public async Task<IEnumerable<string>> GetFileExtensions()
|
|
{
|
|
var fileExtensions = await _dbContext.MangaFile
|
|
.AsNoTracking()
|
|
.Select(x => x.FilePath.ToLower())
|
|
.Distinct()
|
|
.ToArrayAsync();
|
|
|
|
var uniqueFileTypes = fileExtensions
|
|
.Select(Path.GetExtension)
|
|
.Where(x => x is not null)
|
|
.Distinct();
|
|
|
|
return uniqueFileTypes;
|
|
}
|
|
}
|
|
}
|