| 
				
				
					
				
				
				 | 
			
			 | 
			@@ -44,13 +44,16 @@ namespace :nico do | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			        new_tags = datum['tags'].map { |tag| "nico:#{ tag }" }.sort | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			        if current_tags != new_tags | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          post.tags.destroy(post.tags.where(name: current_tags)) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          tags_to_add = [] | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          new_tags.each do |name| | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			            post.tags << Tag.find_or_initialize_by(name:) do |tag| | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			              tag.category = 'nico' | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			            tag = Tag.find_or_initialize_by(name:) do |t| | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			              t.category = 'nico' | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			            end | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			            tags_to_add.concat([tag] + tag.linked_tags) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          end | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          post.tags << Tag.tagme if post.tags.size < 20 && post.tags.none?(Tag.tagme) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          post.tags << Tag.bot if post.tags.none?(Tag.bot) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          tags_to_add << Tag.tagme if post.tags.size < 20 | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          tags_to_add << Tag.bot | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			          post.tags.concat(tags_to_add).uniq! | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			        end | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      end | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			    end | 
		
		
	
	
		
			
				| 
				
					
				
				
				
				 | 
			
			 | 
			
  |