diff --git a/app/logical/upload_service.rb b/app/logical/upload_service.rb index 237963bb4..c3e769985 100644 --- a/app/logical/upload_service.rb +++ b/app/logical/upload_service.rb @@ -304,11 +304,7 @@ class UploadService end def start!(uploader_id) - if source.present? - if !Utils.is_downloadable?(source) - return - end - + if Utils.is_downloadable?(source) CurrentUser.as_system do if Post.tag_match("source:#{source}").exists? return diff --git a/app/models/post.rb b/app/models/post.rb index a4b56dc88..218f8df62 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -40,6 +40,7 @@ class Post < ApplicationRecord after_commit :remove_iqdb_async, :on => :destroy after_commit :update_iqdb_async, :on => :create after_commit :notify_pubsub + after_create {|rec| rec.uploader.increment!(:post_upload_count)} belongs_to :updater, :class_name => "User", optional: true # this is handled in versions belongs_to :approver, class_name: "User", optional: true diff --git a/app/models/upload.rb b/app/models/upload.rb index ca4f1b2be..7f2b46b39 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -63,7 +63,6 @@ class Upload < ApplicationRecord validates :file_ext, format: { with: /jpg|gif|png|swf|webm|mp4|zip/ }, allow_nil: true validates_with Validator serialize :context, JSON - after_create {|rec| rec.uploader.increment!(:post_upload_count)} def initialize_attributes self.uploader_id = CurrentUser.user.id