@@ -57,18 +57,19 @@ export class OpenResourcesController {
5757 ) ;
5858 }
5959
60- // Parse hashtags from content
61- const hashtagNames = parseHashtags ( data . content ) ;
62- let tagIds : string [ ] = data . tag_ids || [ ] ;
63-
64- // If hashtags found, get or create tags and merge with provided tag_ids
65- if ( hashtagNames . length > 0 ) {
66- const hashtagIds = await this . tagService . getOrCreateTagsByNames (
67- apiKey . namespaceId ,
68- hashtagNames ,
69- ) ;
70- // Merge and deduplicate tag IDs
71- tagIds = Array . from ( new Set ( [ ...tagIds , ...hashtagIds ] ) ) ;
60+ // Optionally parse hashtags from content
61+ let tagIds : string [ ] | undefined = data . tag_ids ;
62+ if ( ! data . skip_parsing_tags_from_content ) {
63+ const hashtagNames = parseHashtags ( data . content ) ;
64+ // If hashtags found, get or create tags and merge with provided tag_ids
65+ if ( hashtagNames . length > 0 ) {
66+ const hashtagIds = await this . tagService . getOrCreateTagsByNames (
67+ apiKey . namespaceId ,
68+ hashtagNames ,
69+ ) ;
70+ // Merge and deduplicate tag IDs
71+ tagIds = Array . from ( new Set ( [ ...( tagIds || [ ] ) , ...hashtagIds ] ) ) ;
72+ }
7273 }
7374
7475 const createResourceDto = {
@@ -95,8 +96,8 @@ export class OpenResourcesController {
9596 { text : data . content } ,
9697 ) ;
9798 }
98- // Skip extract tags task if we already have tags from hashtags or user input
99- if ( isEmpty ( newResource . tagIds ) ) {
99+ // Skip extract tags task if user requested or we already have tags
100+ if ( ! data . skip_parsing_tags_from_content && isEmpty ( newResource . tagIds ) ) {
100101 await this . wizardTaskService . createExtractTagsTask (
101102 userId ,
102103 newResource . id ,
0 commit comments