Improve finding audio file by ID
This commit is contained in:
parent
5219ad53e1
commit
bb05847b25
2 changed files with 15 additions and 1 deletions
|
|
@ -126,7 +126,16 @@ namespace LibationFileManager
|
|||
BookDirectoryFiles = new BackgroundFileSystem(BooksDirectory, "*.*", SearchOption.AllDirectories);
|
||||
|
||||
var regex = GetBookSearchRegex(productId);
|
||||
return BookDirectoryFiles.FindFiles(regex);
|
||||
|
||||
//Find all extant files matching the priductID
|
||||
//using both the file system and the file path cache
|
||||
return
|
||||
FilePathCache
|
||||
.GetFiles(productId)
|
||||
.Where(c => c.fileType == FileType.Audio && File.Exists(c.path))
|
||||
.Select(c => c.path)
|
||||
.Union(BookDirectoryFiles.FindFiles(regex))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void Refresh() => BookDirectoryFiles.RefreshFiles();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue