mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
FEATURE: new rake task to clean up uploads & thumbnails
This commit is contained in:
parent
5d91a4ef0c
commit
652cc3efba
8 changed files with 76 additions and 39 deletions
|
@ -8,9 +8,6 @@ module FileStore
|
|||
def store_optimized_image(file, optimized_image)
|
||||
end
|
||||
|
||||
def store_avatar(file, avatar, size)
|
||||
end
|
||||
|
||||
def remove_upload(upload)
|
||||
end
|
||||
|
||||
|
|
|
@ -14,11 +14,6 @@ module FileStore
|
|||
store_file(file, path)
|
||||
end
|
||||
|
||||
def store_avatar(file, avatar, size)
|
||||
path = get_path_for_avatar(file, avatar, size)
|
||||
store_file(file, path)
|
||||
end
|
||||
|
||||
def remove_upload(upload)
|
||||
remove_file(upload.url)
|
||||
end
|
||||
|
@ -80,10 +75,6 @@ module FileStore
|
|||
"#{relative_base_url}/_optimized/#{optimized_image.sha1[0..2]}/#{optimized_image.sha1[3..5]}/#{filename}"
|
||||
end
|
||||
|
||||
def get_path_for_avatar(file, avatar, size)
|
||||
relative_avatar_template(avatar).gsub("{size}", size.to_s)
|
||||
end
|
||||
|
||||
def relative_avatar_template(avatar)
|
||||
File.join(
|
||||
relative_base_url,
|
||||
|
|
|
@ -20,11 +20,6 @@ module FileStore
|
|||
store_file(file, path)
|
||||
end
|
||||
|
||||
def store_avatar(file, avatar, size)
|
||||
path = get_path_for_avatar(file, avatar, size)
|
||||
store_file(file, path)
|
||||
end
|
||||
|
||||
def remove_upload(upload)
|
||||
remove_file(upload.url)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue