Method, Variable, Class Renames in Readarr.Core

Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
Qstick
2020-05-12 22:48:46 -04:00
parent 56aedcc467
commit 8547af9fae
572 changed files with 6584 additions and 6597 deletions
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.Music;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.MetadataSource
{
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.Music;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.MetadataSource
{
public interface IProvideBookInfo
{
Tuple<string, Book, List<AuthorMetadata>> GetBookInfo(string id);
HashSet<string> GetChangedAlbums(DateTime startTime);
HashSet<string> GetChangedBooks(DateTime startTime);
}
}
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using NzbDrone.Core.Music;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.MetadataSource
{
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using NzbDrone.Core.Music;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.MetadataSource
{
public interface ISearchForNewBook
{
List<Book> SearchForNewBook(string title, string artist);
List<Book> SearchForNewBook(string title, string author);
List<Book> SearchByIsbn(string isbn);
List<Book> SearchByAsin(string asin);
List<Book> SearchByGoodreadsId(int goodreadsId);
@@ -2,11 +2,11 @@ using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Music;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.MetadataSource
{
public class SearchArtistComparer : IComparer<Author>
public class SearchAuthorComparer : IComparer<Author>
{
private static readonly Regex RegexCleanPunctuation = new Regex("[-._:]", RegexOptions.Compiled);
private static readonly Regex RegexCleanCountryYearPostfix = new Regex(@"(?<=.+)( \([A-Z]{2}\)| \(\d{4}\)| \([A-Z]{2}\) \(\d{4}\))$", RegexOptions.Compiled);
@@ -17,7 +17,7 @@ namespace NzbDrone.Core.MetadataSource
private readonly string _searchQueryWithoutYear;
private int? _year;
public SearchArtistComparer(string searchQuery)
public SearchAuthorComparer(string searchQuery)
{
SearchQuery = searchQuery;
@@ -6,9 +6,9 @@ using NLog;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.Books;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Music;
namespace NzbDrone.Core.MetadataSource.SkyHook
{
@@ -16,22 +16,22 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly IArtistService _authorService;
private readonly IAlbumService _bookService;
private readonly IAuthorService _authorService;
private readonly IBookService _bookService;
private readonly IMetadataRequestBuilder _requestBuilder;
private readonly ICached<HashSet<string>> _cache;
public SkyHookProxy(IHttpClient httpClient,
IMetadataRequestBuilder requestBuilder,
IArtistService authorService,
IAlbumService albumService,
IAuthorService authorService,
IBookService bookService,
Logger logger,
ICacheManager cacheManager)
{
_httpClient = httpClient;
_requestBuilder = requestBuilder;
_authorService = authorService;
_bookService = albumService;
_bookService = bookService;
_cache = cacheManager.GetCache<HashSet<string>>(GetType());
_logger = logger;
}
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{
if (httpResponse.StatusCode == HttpStatusCode.NotFound)
{
throw new ArtistNotFoundException(foreignAuthorId);
throw new AuthorNotFoundException(foreignAuthorId);
}
else if (httpResponse.StatusCode == HttpStatusCode.BadRequest)
{
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
return MapAuthor(httpResponse.Resource);
}
public HashSet<string> GetChangedAlbums(DateTime startTime)
public HashSet<string> GetChangedBooks(DateTime startTime)
{
return _cache.Get("ChangedAlbums", () => GetChangedAlbumsUncached(startTime), TimeSpan.FromMinutes(30));
}
@@ -100,7 +100,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{
if (httpResponse.StatusCode == HttpStatusCode.NotFound)
{
throw new AlbumNotFoundException(foreignBookId);
throw new BookNotFoundException(foreignBookId);
}
else if (httpResponse.StatusCode == HttpStatusCode.BadRequest)
{
@@ -129,7 +129,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
return books.Select(x => x.Author.Value).ToList();
}
public List<Book> SearchForNewBook(string title, string artist)
public List<Book> SearchForNewBook(string title, string author)
{
try
{
@@ -168,9 +168,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
}
var q = title.ToLower().Trim();
if (artist != null)
if (author != null)
{
q += " " + artist;
q += " " + author;
}
var httpRequest = _requestBuilder.GetRequestBuilder().Create()
@@ -276,7 +276,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
var result = new Author
{
Metadata = metadata,
CleanName = Parser.Parser.CleanArtistName(metadata.Name),
CleanName = Parser.Parser.CleanAuthorName(metadata.Name),
SortName = Parser.Parser.NormalizeTitle(metadata.Name),
Books = books,
Series = series
@@ -380,7 +380,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
Title = resource.Title.CleanSpaces(),
Language = resource.Language,
Publisher = resource.Publisher,
CleanTitle = Parser.Parser.CleanArtistName(resource.Title),
CleanTitle = Parser.Parser.CleanAuthorName(resource.Title),
Overview = resource.Description,
ReleaseDate = resource.ReleaseDate,
Ratings = new Ratings { Votes = resource.RatingCount, Value = (decimal)resource.AverageRating }
@@ -428,7 +428,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
author = new Author
{
CleanName = Parser.Parser.CleanArtistName(authorMetadata.Name),
CleanName = Parser.Parser.CleanAuthorName(authorMetadata.Name),
Metadata = authorMetadata
};
}