sqlite db file should live in LibationFiles dir, not in app dir

This commit is contained in:
Robert McRackan 2019-12-09 14:44:46 -05:00
parent 65dc273e12
commit bcc237c693
17 changed files with 150 additions and 120 deletions

View file

@ -1,4 +1,5 @@
using DataLayer;
using System.IO;
using DataLayer;
using LibationSearchEngine;
namespace ApplicationServices
@ -7,18 +8,18 @@ namespace ApplicationServices
{
public static void FullReIndex()
{
var engine = new SearchEngine();
var engine = new SearchEngine(DbContexts.GetContext());
engine.CreateNewIndex();
}
public static SearchResultSet Search(string searchString)
{
var engine = new SearchEngine();
var engine = new SearchEngine(DbContexts.GetContext());
try
{
return engine.Search(searchString);
}
catch (System.IO.FileNotFoundException)
catch (FileNotFoundException)
{
FullReIndex();
return engine.Search(searchString);
@ -27,12 +28,12 @@ namespace ApplicationServices
public static void UpdateBookTags(Book book)
{
var engine = new SearchEngine();
var engine = new SearchEngine(DbContexts.GetContext());
try
{
engine.UpdateTags(book.AudibleProductId, book.UserDefinedItem.Tags);
}
catch (System.IO.FileNotFoundException)
catch (FileNotFoundException)
{
FullReIndex();
engine.UpdateTags(book.AudibleProductId, book.UserDefinedItem.Tags);