mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
bugfixes and improvements
This commit is contained in:
@@ -264,10 +264,12 @@ class FredyPipelineExecutioner {
|
||||
listings
|
||||
// this should never filter some listings out, because the normalize function should always extract all fields.
|
||||
.filter((item) => requiredKeys.every((key) => key in item))
|
||||
// Drop listings missing a required identifying field *before* the provider
|
||||
// filter runs, so provider filter functions never have to defend against a
|
||||
// null id/link/title.
|
||||
.filter((item) => requireValues.every((key) => item[key] != null))
|
||||
// TODO: move blacklist filter to this file, so it will handle for all providers in same way.
|
||||
.filter(this._providerConfig.filter)
|
||||
// filter out listings that are missing required fields
|
||||
.filter((item) => requireValues.every((key) => item[key] != null))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -322,9 +324,9 @@ class FredyPipelineExecutioner {
|
||||
*/
|
||||
_findNew(listings) {
|
||||
logger.debug(`Checking ${listings.length} listings for new entries (Provider: '${this._providerId}')`);
|
||||
const hashes = getKnownListingHashesForJobAndProvider(this._jobKey, this._providerId) || [];
|
||||
const knownHashes = new Set(getKnownListingHashesForJobAndProvider(this._jobKey, this._providerId) || []);
|
||||
|
||||
const newListings = listings.filter((o) => !hashes.includes(o.id));
|
||||
const newListings = listings.filter((o) => !knownHashes.has(o.id));
|
||||
if (newListings.length === 0) {
|
||||
throw new NoNewListingsWarning();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user