scraping => api transition almost complete

This commit is contained in:
Robert McRackan 2019-11-04 14:16:57 -05:00
parent df889a60a4
commit 591d84e719
41 changed files with 995 additions and 2494 deletions

View file

@ -62,8 +62,7 @@ namespace DataLayer
string title,
string description,
int lengthInMinutes,
IEnumerable<Contributor> authors,
IEnumerable<Contributor> narrators)
IEnumerable<Contributor> authors)
{
// validate
ArgumentValidator.EnsureNotNull(audibleProductId, nameof(audibleProductId));
@ -88,7 +87,7 @@ namespace DataLayer
// assigns with biz logic
ReplaceAuthors(authors);
ReplaceNarrators(narrators);
//ReplaceNarrators(narrators);
// import previously saved tags
// do this immediately. any save occurs before reloading tags will overwrite persistent tags with new blank entries; all old persisted tags will be lost
@ -218,7 +217,6 @@ namespace DataLayer
// Are automatically loaded, and can only be tracked by a DbContext alongside their owner."
ArgumentValidator.EnsureNotNullOrWhiteSpace(url, nameof(url));
url = FileManager.FileUtility.RestoreDeclawed(url);
if (!_supplements.Any(s => url.EqualsInsensitive(url)))
_supplements.Add(new Supplement(this, url));

View file

@ -10,16 +10,18 @@ namespace DataLayer
public DateTime DateAdded { get; private set; }
/// <summary>For downloading AAX file</summary>
public string DownloadBookLink { get; private set; }
/// <summary>For downloading AAX file</summary>
public string DownloadBookLink { get; private set; }
private LibraryBook() { }
public LibraryBook(Book book, DateTime dateAdded, string downloadBookLink)
public LibraryBook(Book book, DateTime dateAdded
, string downloadBookLink = null
)
{
ArgumentValidator.EnsureNotNull(book, nameof(book));
Book = book;
DateAdded = dateAdded;
DownloadBookLink = downloadBookLink;
DownloadBookLink = downloadBookLink;
}
}
}

View file

@ -64,11 +64,11 @@ namespace DataLayer
var items = new List<string>();
if (OverallRating > 0)
items.Add($"Overall: {getStars(OverallRating)}");
items.Add($"Overall: {getStars(OverallRating)}");
if (PerformanceRating > 0)
items.Add($"Perform: {getStars(PerformanceRating)}");
if (StoryRating > 0)
items.Add($"Story: {getStars(StoryRating)}");
items.Add($"Story: {getStars(StoryRating)}");
return string.Join("\r\n", items);
}

View file

@ -11,7 +11,7 @@ namespace DataLayer
using var context = LibationContext.Create();
return context
.Library
.AsNoTracking()
//.AsNoTracking()
.GetLibrary()
.ToList();
}
@ -21,8 +21,8 @@ namespace DataLayer
using var context = LibationContext.Create();
return context
.Library
.AsNoTracking()
.GetLibraryBook(productId);
//.AsNoTracking()
.GetLibraryBook(productId);
}
/// <summary>This is still IQueryable. YOU MUST CALL ToList() YOURSELF</summary>