mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Method, Variable, Class Renames in Readarr.Api
This commit is contained in:
@@ -105,7 +105,7 @@ namespace NzbDrone.Core.AuthorStats
|
||||
public void Handle(BookEditedEvent message)
|
||||
{
|
||||
_cache.Remove("AllAuthors");
|
||||
_cache.Remove(message.Album.AuthorId.ToString());
|
||||
_cache.Remove(message.Book.AuthorId.ToString());
|
||||
}
|
||||
|
||||
[EventHandleOrder(EventHandleOrder.First)]
|
||||
|
||||
@@ -4,12 +4,12 @@ namespace NzbDrone.Core.Books.Events
|
||||
{
|
||||
public class BookEditedEvent : IEvent
|
||||
{
|
||||
public Book Album { get; private set; }
|
||||
public Book Book { get; private set; }
|
||||
public Book OldAlbum { get; private set; }
|
||||
|
||||
public BookEditedEvent(Book book, Book oldAlbum)
|
||||
{
|
||||
Album = book;
|
||||
Book = book;
|
||||
OldAlbum = oldAlbum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace NzbDrone.Core.Configuration
|
||||
return _repository.Get(key.ToLower()) != null;
|
||||
}
|
||||
|
||||
public bool AutoUnmonitorPreviouslyDownloadedTracks
|
||||
public bool AutoUnmonitorPreviouslyDownloadedBooks
|
||||
{
|
||||
get { return GetValueBoolean("AutoUnmonitorPreviouslyDownloadedTracks"); }
|
||||
set { SetValue("AutoUnmonitorPreviouslyDownloadedTracks", value); }
|
||||
@@ -158,7 +158,7 @@ namespace NzbDrone.Core.Configuration
|
||||
set { SetValue("RemoveFailedDownloads", value); }
|
||||
}
|
||||
|
||||
public bool CreateEmptyArtistFolders
|
||||
public bool CreateEmptyAuthorFolders
|
||||
{
|
||||
get { return GetValueBoolean("CreateEmptyArtistFolders", false); }
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace NzbDrone.Core.Configuration
|
||||
bool RemoveFailedDownloads { get; set; }
|
||||
|
||||
//Media Management
|
||||
bool AutoUnmonitorPreviouslyDownloadedTracks { get; set; }
|
||||
bool AutoUnmonitorPreviouslyDownloadedBooks { get; set; }
|
||||
string RecycleBin { get; set; }
|
||||
int RecycleBinCleanupDays { get; set; }
|
||||
ProperDownloadTypes DownloadPropersAndRepacks { get; set; }
|
||||
bool CreateEmptyArtistFolders { get; set; }
|
||||
bool CreateEmptyAuthorFolders { get; set; }
|
||||
bool DeleteEmptyFolders { get; set; }
|
||||
FileDateType FileDate { get; set; }
|
||||
bool SkipFreeSpaceCheckWhenImporting { get; set; }
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteBook subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
if (!_configService.AutoUnmonitorPreviouslyDownloadedTracks)
|
||||
if (!_configService.AutoUnmonitorPreviouslyDownloadedBooks)
|
||||
{
|
||||
return Decision.Accept();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||
return false;
|
||||
}
|
||||
|
||||
return new[] { HistoryEventType.DownloadImported, HistoryEventType.TrackFileImported }.Contains(lastHistoryItem.EventType);
|
||||
return new[] { HistoryEventType.DownloadImported, HistoryEventType.BookFileImported }.Contains(lastHistoryItem.EventType);
|
||||
});
|
||||
|
||||
return allAlbumsImportedInHistory;
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||
}
|
||||
|
||||
// Since DownloadComplete is a new event type, we can't assume it exists for old downloads
|
||||
if (history.EventType == HistoryEventType.TrackFileImported)
|
||||
if (history.EventType == HistoryEventType.BookFileImported)
|
||||
{
|
||||
return DateTime.UtcNow.Subtract(history.Date).TotalSeconds < 60 ? TrackedDownloadState.Importing : TrackedDownloadState.Imported;
|
||||
}
|
||||
|
||||
@@ -32,14 +32,14 @@ namespace NzbDrone.Core.History
|
||||
{
|
||||
Unknown = 0,
|
||||
Grabbed = 1,
|
||||
ArtistFolderImported = 2,
|
||||
TrackFileImported = 3,
|
||||
AuthorFolderImported = 2,
|
||||
BookFileImported = 3,
|
||||
DownloadFailed = 4,
|
||||
TrackFileDeleted = 5,
|
||||
TrackFileRenamed = 6,
|
||||
BookFileDeleted = 5,
|
||||
BookFileRenamed = 6,
|
||||
BookImportIncomplete = 7,
|
||||
DownloadImported = 8,
|
||||
TrackFileRetagged = 9,
|
||||
BookFileRetagged = 9,
|
||||
DownloadIgnored = 10
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace NzbDrone.Core.History
|
||||
|
||||
public List<History> FindDownloadHistory(int idAuthorId, QualityModel quality)
|
||||
{
|
||||
var allowed = new[] { HistoryEventType.Grabbed, HistoryEventType.DownloadFailed, HistoryEventType.TrackFileImported };
|
||||
var allowed = new[] { HistoryEventType.Grabbed, HistoryEventType.DownloadFailed, HistoryEventType.BookFileImported };
|
||||
|
||||
return Query(h => h.AuthorId == idAuthorId &&
|
||||
h.Quality == quality &&
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace NzbDrone.Core.History
|
||||
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.TrackFileImported,
|
||||
EventType = HistoryEventType.BookFileImported,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.BookInfo.Quality,
|
||||
SourceTitle = message.ImportedBook.SceneName ?? Path.GetFileNameWithoutExtension(message.BookInfo.Path),
|
||||
@@ -289,7 +289,7 @@ namespace NzbDrone.Core.History
|
||||
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.TrackFileDeleted,
|
||||
EventType = HistoryEventType.BookFileDeleted,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.BookFile.Quality,
|
||||
SourceTitle = message.BookFile.Path,
|
||||
@@ -309,7 +309,7 @@ namespace NzbDrone.Core.History
|
||||
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.TrackFileRenamed,
|
||||
EventType = HistoryEventType.BookFileRenamed,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.BookFile.Quality,
|
||||
SourceTitle = message.OriginalPath,
|
||||
@@ -329,7 +329,7 @@ namespace NzbDrone.Core.History
|
||||
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.TrackFileRetagged,
|
||||
EventType = HistoryEventType.BookFileRetagged,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.BookFile.Quality,
|
||||
SourceTitle = path,
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace NzbDrone.Core.IndexerSearch
|
||||
|
||||
public void Execute(AuthorSearchCommand message)
|
||||
{
|
||||
var decisions = _nzbSearchService.ArtistSearch(message.AuthorId, false, message.Trigger == CommandTrigger.Manual, false);
|
||||
var decisions = _nzbSearchService.AuthorSearch(message.AuthorId, false, message.Trigger == CommandTrigger.Manual, false);
|
||||
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
||||
|
||||
_logger.ProgressInfo("Author search completed. {0} reports downloaded.", processed.Grabbed.Count);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace NzbDrone.Core.IndexerSearch
|
||||
foreach (var book in books)
|
||||
{
|
||||
List<DownloadDecision> decisions;
|
||||
decisions = _nzbSearchService.AlbumSearch(book.Id, false, userInvokedSearch, false);
|
||||
decisions = _nzbSearchService.BookSearch(book.Id, false, userInvokedSearch, false);
|
||||
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
||||
|
||||
downloadedCount += processed.Grabbed.Count;
|
||||
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.IndexerSearch
|
||||
foreach (var bookId in message.BookIds)
|
||||
{
|
||||
var decisions =
|
||||
_nzbSearchService.AlbumSearch(bookId, false, message.Trigger == CommandTrigger.Manual, false);
|
||||
_nzbSearchService.BookSearch(bookId, false, message.Trigger == CommandTrigger.Manual, false);
|
||||
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
||||
|
||||
_logger.ProgressInfo("Book search completed. {0} reports downloaded.", processed.Grabbed.Count);
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace NzbDrone.Core.IndexerSearch
|
||||
{
|
||||
public interface ISearchForNzb
|
||||
{
|
||||
List<DownloadDecision> AlbumSearch(int bookId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch);
|
||||
List<DownloadDecision> ArtistSearch(int authorId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch);
|
||||
List<DownloadDecision> BookSearch(int bookId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch);
|
||||
List<DownloadDecision> AuthorSearch(int authorId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch);
|
||||
}
|
||||
|
||||
public class NzbSearchService : ISearchForNzb
|
||||
@@ -41,13 +41,13 @@ namespace NzbDrone.Core.IndexerSearch
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public List<DownloadDecision> AlbumSearch(int bookId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch)
|
||||
public List<DownloadDecision> BookSearch(int bookId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch)
|
||||
{
|
||||
var book = _bookService.GetBook(bookId);
|
||||
return AlbumSearch(book, missingOnly, userInvokedSearch, interactiveSearch);
|
||||
}
|
||||
|
||||
public List<DownloadDecision> ArtistSearch(int authorId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch)
|
||||
public List<DownloadDecision> AuthorSearch(int authorId, bool missingOnly, bool userInvokedSearch, bool interactiveSearch)
|
||||
{
|
||||
var author = _authorService.GetAuthor(authorId);
|
||||
return ArtistSearch(author, missingOnly, userInvokedSearch, interactiveSearch);
|
||||
|
||||
@@ -15,13 +15,13 @@ using NzbDrone.Core.Organizer;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles
|
||||
{
|
||||
public interface IRenameTrackFileService
|
||||
public interface IRenameBookFileService
|
||||
{
|
||||
List<RenameBookFilePreview> GetRenamePreviews(int authorId);
|
||||
List<RenameBookFilePreview> GetRenamePreviews(int authorId, int bookId);
|
||||
}
|
||||
|
||||
public class RenameBookFileService : IRenameTrackFileService, IExecute<RenameFilesCommand>, IExecute<RenameAuthorCommand>
|
||||
public class RenameBookFileService : IRenameBookFileService, IExecute<RenameFilesCommand>, IExecute<RenameAuthorCommand>
|
||||
{
|
||||
private readonly IAuthorService _authorService;
|
||||
private readonly IMediaFileService _mediaFileService;
|
||||
|
||||
+2
-2
@@ -3,11 +3,11 @@ using NzbDrone.Core.Books;
|
||||
|
||||
namespace NzbDrone.Core.Validation.Paths
|
||||
{
|
||||
public class ArtistExistsValidator : PropertyValidator
|
||||
public class AuthorExistsValidator : PropertyValidator
|
||||
{
|
||||
private readonly IAuthorService _authorService;
|
||||
|
||||
public ArtistExistsValidator(IAuthorService authorService)
|
||||
public AuthorExistsValidator(IAuthorService authorService)
|
||||
: base("This author has already been added.")
|
||||
{
|
||||
_authorService = authorService;
|
||||
Reference in New Issue
Block a user