}
/**
+ * Check if a FileInfo is considered for extraction
+ *
+ * @param info a FileInfo
+ * @return true if file should be extracted, false otherwise
+ */
+ public static bool is_eligible (FileInfo info) {
+ return info.get_content_type ().has_prefix ("image/") ||
+ info.get_content_type ().has_prefix ("video/") ||
+ info.get_content_type ().has_prefix ("audio/") ||
+ info.get_content_type () == "application/ogg" ||
+ info.get_content_type () == "application/xml" ||
+ info.get_content_type () == "text/xml" ||
+ info.get_content_type () == "text/plain";
+ }
+
+ /**
* Put a file on queue for meta-data extraction
*
* @param file the file to investigate
FileQueryInfoFlags.NONE,
this.cancellable);
if (info.get_file_type () == FileType.DIRECTORY ||
- info.get_content_type ().has_prefix ("image/") ||
- info.get_content_type ().has_prefix ("video/") ||
- info.get_content_type ().has_prefix ("audio/") ||
- info.get_content_type () == "application/ogg" ||
- info.get_content_type () == "application/xml" ||
- info.get_content_type () == "text/xml" ||
- info.get_content_type () == "text/plain") {
+ Harvester.is_eligible (info)) {
string id;
try {
MediaContainer parent_container = null;
} else {
// Check if the file needs to be harvested at all either because
// it is denied by filter or it hasn't updated
- if (info.get_content_type ().has_prefix ("image/") ||
- info.get_content_type ().has_prefix ("video/") ||
- info.get_content_type ().has_prefix ("audio/") ||
- info.get_content_type () == "application/ogg" ||
- info.get_content_type () == "application/xml" ||
- info.get_content_type () == "text/xml" ||
- info.get_content_type () == "text/plain") {
+ if (Harvester.is_eligible (info)) {
return this.push_if_changed_or_unknown (file, info);
}