Ignore destination sources with found matches on search retry
This commit is contained in:
@@ -801,7 +801,9 @@ export class MigrationManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const searchPromises = MigrationManager.getDestinationSourceIds(entry.sourceId).map((destSourceId) =>
|
const searchPromises = MigrationManager.getDestinationSourceIds(entry.sourceId)
|
||||||
|
.filter((destSourceId) => !entry.destSourceIdToSearchState[destSourceId])
|
||||||
|
.map((destSourceId) =>
|
||||||
MigrationManager.getParallelSourceQueue()(async () => {
|
MigrationManager.getParallelSourceQueue()(async () => {
|
||||||
if (signal.aborted) {
|
if (signal.aborted) {
|
||||||
return null;
|
return null;
|
||||||
@@ -880,7 +882,8 @@ export class MigrationManager {
|
|||||||
draftMatchEntry?.latestChapterNumber ?? Number.MIN_SAFE_INTEGER;
|
draftMatchEntry?.latestChapterNumber ?? Number.MIN_SAFE_INTEGER;
|
||||||
|
|
||||||
const hasNewerChapterVsEntry = latestChapterNumber > entryLatestChapterNumber;
|
const hasNewerChapterVsEntry = latestChapterNumber > entryLatestChapterNumber;
|
||||||
const hasNewerChapterVsSelectedMatch = latestChapterNumber > selectedMatchLatestChapterNumber;
|
const hasNewerChapterVsSelectedMatch =
|
||||||
|
latestChapterNumber > selectedMatchLatestChapterNumber;
|
||||||
const hasNewerChapter = hasNewerChapterVsEntry && hasNewerChapterVsSelectedMatch;
|
const hasNewerChapter = hasNewerChapterVsEntry && hasNewerChapterVsSelectedMatch;
|
||||||
|
|
||||||
const hasSameLatestChapterAsSelectedMatch =
|
const hasSameLatestChapterAsSelectedMatch =
|
||||||
@@ -901,7 +904,8 @@ export class MigrationManager {
|
|||||||
!draftMatchEntry);
|
!draftMatchEntry);
|
||||||
|
|
||||||
const isPreferredMatch =
|
const isPreferredMatch =
|
||||||
!ignoreOutdatedMatch && (isPreferredSourcePriorityMatch || isPreferredChapterNumberMatch);
|
!ignoreOutdatedMatch &&
|
||||||
|
(isPreferredSourcePriorityMatch || isPreferredChapterNumberMatch);
|
||||||
if (isPreferredMatch) {
|
if (isPreferredMatch) {
|
||||||
draftEntry.selectedMatchMangaId = bestMatch.id;
|
draftEntry.selectedMatchMangaId = bestMatch.id;
|
||||||
draftEntry.selectedMatchSourceId = destSourceId;
|
draftEntry.selectedMatchSourceId = destSourceId;
|
||||||
|
|||||||
Reference in New Issue
Block a user