free_space is storage service dependent

This commit is contained in:
James Smith committed 2024-07-04 13:30:54 +01:00
1 parent ada43bd3c4
commit e2aaa2ecc2
1 file changed
+7 -2
+7 -2
View File
@@ -49,8 +49,13 @@ class Library < ApplicationRecord
end
def free_space
stat = Sys::Filesystem.stat(path)
stat.bytes_available
case storage_service
when "filesystem"
stat = Sys::Filesystem.stat(path)
stat.bytes_available
else
raise "Invalid storage service: #{storage_service}"
end
end
def storage_key