Fixed tags module not dealing with empty releases or tags, added origin tag column to chapter tag table.
This commit is contained in:
@@ -117,7 +117,7 @@ async function getEntityTags(releases) {
|
||||
function buildReleaseTagAssociations(releases, tagIdsBySlug, entityTagIdsByEntityId, type) {
|
||||
const tagAssociations = releases
|
||||
.map((release) => {
|
||||
const entityTagIds = entityTagIdsByEntityId[release.entity?.id].map(tag => ({ id: tag.id, origin: tag.name })) || [];
|
||||
const entityTagIds = entityTagIdsByEntityId[release.entity?.id]?.map(tag => ({ id: tag.id, origin: tag.name })) || [];
|
||||
const releaseTags = release.tags?.filter(Boolean) || [];
|
||||
|
||||
const releaseTagsWithIds = releaseTags.every(tag => typeof tag === 'number')
|
||||
@@ -147,6 +147,10 @@ function buildReleaseTagAssociations(releases, tagIdsBySlug, entityTagIdsByEntit
|
||||
}
|
||||
|
||||
async function associateReleaseTags(releases, type = 'release') {
|
||||
if (releases.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const tagIdsBySlug = await matchReleaseTags(releases);
|
||||
const EntityTagIdsByEntityId = await getEntityTags(releases);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user