Skip to content

Instantly share code, notes, and snippets.

@sasrai
Last active April 24, 2016 04:54
Show Gist options
  • Save sasrai/4b1a55ec54e0574057611978c60bc764 to your computer and use it in GitHub Desktop.
Save sasrai/4b1a55ec54e0574057611978c60bc764 to your computer and use it in GitHub Desktop.
mediatomb patch
--- a/src/common.h 2013-12-25 08:59:59.000000000 +0900
+++ b/src/common.h 2016-04-23 00:30:24.825939688 +0900
@@ -225,6 +225,7 @@
#define DEFAULT_ALIVE_INTERVAL 1800 // seconds
#define DEFAULT_BOOKMARK_FILE "mediatomb.html"
#define DEFAULT_IGNORE_UNKNOWN_EXTENSIONS NO
+#define DEFAULT_DISABLED_IGNORE_LOG_EXTENSIONS YES
#define DEFAULT_CASE_SENSITIVE_EXTENSION_MAPPINGS NO
#define DEFAULT_IMPORT_SCRIPT "import.js"
#define DEFAULT_DVD_SCRIPT "import-dvd.js"
--- a/src/config_manager.cc 2016-04-24 13:37:05.000000000 +0900
+++ b/src/config_manager.cc 2016-04-23 00:33:39.604174022 +0900
@@ -582,6 +582,7 @@
Ref<Element> mappings(new Element(_("mappings")));
Ref<Element> ext2mt(new Element(_("extension-mimetype")));
ext2mt->setAttribute(_("ignore-unknown"), _(DEFAULT_IGNORE_UNKNOWN_EXTENSIONS));
+ ext2mt->setAttribute(_("disabled-ignore-log"), _(DEFAULT_DISABLED_IGNORE_LOG_EXTENSIONS));
ext2mt->appendElementChild(map_from_to(_("mp3"), _("audio/mpeg")));
ext2mt->appendElementChild(map_from_to(_("ogx"), _("application/ogg")));
ext2mt->appendElementChild(map_from_to(_("ogv"), _("video/ogg")));
@@ -1309,12 +1310,23 @@
if (!validateYesNo(temp))
throw _Exception(_("Error in config file: incorrect parameter for "
- "<extension-mimetype ignore-unknown=\"\" /> attribute"));
+ "<extension-mimetype ignore-unknown=\"\" disabled-ignore-log=\"\" /> attribute"));
NEW_BOOL_OPTION(temp == "yes" ? true : false);
SET_BOOL_OPTION(CFG_IMPORT_MAPPINGS_IGNORE_UNKNOWN_EXTENSIONS);
temp = getOption(
+ _("/import/mappings/extension-mimetype/attribute::disabled-ignore-log"),
+ _(DEFAULT_DISABLED_IGNORE_LOG_EXTENSIONS));
+
+ if (!validateYesNo(temp))
+ throw _Exception(_("Error in config file: incorrect parameter for "
+ "<extension-mimetype ignore-unknown=\"\" disabled-ignore-log=\"\" /> attribute"));
+
+ NEW_BOOL_OPTION(temp == "yes" ? true : false);
+ SET_BOOL_OPTION(CFG_IMPORT_MAPPINGS_DISABLED_IGNORE_LOG_EXTENSIONS);
+
+ temp = getOption(
_("/import/mappings/extension-mimetype/attribute::case-sensitive"),
_(DEFAULT_CASE_SENSITIVE_EXTENSION_MAPPINGS));
--- a/src/config_manager.h 2013-12-25 08:59:59.000000000 +0900
+++ b/src/config_manager.h 2016-04-23 00:34:08.279914042 +0900
@@ -146,6 +146,7 @@
CFG_IMPORT_AUTOSCAN_INOTIFY_LIST,
#endif
CFG_IMPORT_MAPPINGS_IGNORE_UNKNOWN_EXTENSIONS,
+ CFG_IMPORT_MAPPINGS_DISABLED_IGNORE_LOG_EXTENSIONS,
CFG_IMPORT_MAPPINGS_EXTENSION_TO_MIMETYPE_CASE_SENSITIVE,
CFG_IMPORT_MAPPINGS_EXTENSION_TO_MIMETYPE_LIST,
CFG_IMPORT_MAPPINGS_MIMETYPE_TO_UPNP_CLASS_LIST,
--- a/src/content_manager.cc 2016-04-24 13:37:05.000000000 +0900
+++ b/src/content_manager.cc 2016-04-23 00:50:20.151086272 +0900
@@ -989,6 +989,9 @@
/* scans the given directory and adds everything recursively */
void ContentManager::addRecursive(String path, bool hidden, Ref<GenericTask> task)
{
+ Ref<ConfigManager> cm = ConfigManager::getInstance();
+ bool disabled_ignore_log_extensions = cm->getBoolOption(CFG_IMPORT_MAPPINGS_DISABLED_IGNORE_LOG_EXTENSIONS);
+
if (hidden == false)
{
log_debug("Checking path %s\n", path.c_str());
@@ -1046,8 +1049,10 @@
if (obj == nil) // object ignored
{
+ if (!disabled_ignore_log_extensions) {
log_warning("file ignored: %s\n", newPath.c_str());
}
else
{
//obj->setParentID(parentID);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment