From dd920b3ffc778e26606fac968d02d31ea6a6585b Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 2 May 2017 19:57:44 -0500 Subject: [PATCH] post replacement: disallow unhandled cases. --- app/models/post.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/models/post.rb b/app/models/post.rb index 9de7bbc0b..71135d769 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1403,6 +1403,21 @@ class Post < ActiveRecord::Base end def replace!(url) + # TODO for posts with notes we need to rescale the notes if the dimensions change. + if notes.size > 0 + raise NotImplementedError.new("Replacing images with notes not yet supported.") + end + + # TODO for ugoiras we need to replace the frame data. + if is_ugoira? + raise NotImplementedError.new("Replacing ugoira images not yet supported.") + end + + # TODO images hosted on s3 need to be deleted from s3 instead of the local filesystem. + if Danbooru.config.use_s3_proxy?(self) + raise NotImplementedError.new("Replacing S3 hosted images not yet supported.") + end + transaction do upload = Upload.create!(source: url, rating: self.rating, tag_string: self.tag_string) upload.process_upload