Skip to content

Commit

Permalink
feat(harmonizer): run guessTypesForRelease always after merging types
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Jul 3, 2024
1 parent e019ddb commit 58b222f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion harmonizer/merge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { immutableReleaseProperties, immutableTrackProperties } from './properties.ts';
import { mergeTypes } from './release_types.ts';
import { guessTypesForRelease, mergeTypes } from './release_types.ts';
import { cloneInto, copyTo, filterErrorEntries, isFilled, uniqueMappedValues } from '@/utils/record.ts';
import { similarNames } from '@/utils/similarity.ts';
import { trackCountSummary } from '@/utils/tracklist.ts';
Expand Down Expand Up @@ -128,6 +128,7 @@ export function mergeRelease(
// Merge release group types
if (sourceRelease.types) {
mergedRelease.types = mergeTypes(mergedRelease.types || [], sourceRelease.types);
guessTypesForRelease(mergedRelease);
}

// combine availabilities
Expand Down
2 changes: 0 additions & 2 deletions providers/Bandcamp/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {
Label,
LinkType,
} from '@/harmonizer/types.ts';
import { guessTypesForRelease } from '@/harmonizer/release_types.ts';
import { type CacheEntry, MetadataProvider, ReleaseLookup } from '@/providers/base.ts';
import { DurationPrecision, FeatureQuality, FeatureQualityMap } from '@/providers/features.ts';
import { parseISODateTime } from '@/utils/date.ts';
Expand Down Expand Up @@ -309,7 +308,6 @@ export class BandcampReleaseLookup extends ReleaseLookup<BandcampProvider, Relea
});
}

guessTypesForRelease(release);
return release;
}

Expand Down
2 changes: 0 additions & 2 deletions providers/iTunes/mod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { availableRegions } from './regions.ts';
import { type CacheEntry, MetadataApiProvider, ReleaseApiLookup } from '@/providers/base.ts';
import { DurationPrecision, FeatureQuality, FeatureQualityMap } from '@/providers/features.ts';
import { guessTypesForRelease } from '@/harmonizer/release_types.ts';
import { parseISODateTime, PartialDate } from '@/utils/date.ts';
import { isEqualGTIN, isValidGTIN } from '@/utils/gtin.ts';

Expand Down Expand Up @@ -190,7 +189,6 @@ export class iTunesReleaseLookup extends ReleaseApiLookup<iTunesProvider, Releas
info: this.generateReleaseInfo(),
};

guessTypesForRelease(release);
return release;
}

Expand Down

0 comments on commit 58b222f

Please sign in to comment.