protect against disappeared videos
[booh] / lib / booh / booh-lib.rb
index b79a1d3b7147230ef03a59bbc96c71d305f7ea62..e2dc096d6f4de140726a520d48463055369b23a8 100644 (file)
@@ -329,4 +329,12 @@ module Booh
         type = find_subalbum_info_type(xmldir)
         return from_utf8(xmldir.attributes["#{type}-captionfile"]), xmldir.attributes["#{type}-caption"]
     end
+
+    def file_size(path)
+        begin
+            return File.size(path)
+        rescue
+            return -1
+        end
+    end
 end