What's new

minidlna directories

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rxu

Occasional Visitor
Just dug into the web interface code to understand why DM's Download2 directory is not visible in directory explorer tree which is getting triggered by text field onclick. Thus, you're unable to choose it as a minidlna server directory.

I've found out that it's filtered by intention (mediaserver.asp code):
Code:
function get_tree_items(treeitems){
	document.aidiskForm.test_flag.value = 0;
	this.isLoading = 1;
	var array_temp = new Array();
	var array_temp_split = new Array();
	for(var j=0;j<treeitems.length;j++){ // To hide folder 'Download2' & 'asusware'
		array_temp_split[j] = treeitems[j].split("#");
		if( array_temp_split[j][0].match(/^Download2$/) || array_temp_split[j][0].match(/^asusware$/)	){
			continue;					
		}
		
		array_temp.push(treeitems[j]);
	}
	this.Items = array_temp;	
	if(this.Items && this.Items.length >= 0){
		BuildTree();
	}	
}

That is weird because Download2/Complete directory obviously can contain mediafiles (videos). Also, you can't list subdirectories.

RMerlin, could you please think about getting rid of this restriction (as far as I imagine this doesn't require hard changes)?

Regards.
 
I suspect this is a leftover from that piece of code being copy/pasted from elsewhere. I'll take a closer look.
 
RMerlin
Thanks for fixing this issue.
Also, can the code be updated to allow multiple media_dir lines to be saved in minidlna config file? This means a possibility to allow multiple minidlna directories selection.
 
RMerlin
Thanks for fixing this issue.
Also, can the code be updated to allow multiple media_dir lines to be saved in minidlna config file? This means a possibility to allow multiple minidlna directories selection.

Not in any simple way. You will need to experiment with custom configs for this (minidlna.conf.add).
 
When you make no media server directory in the list via webUI, it reports "No data in table", while the actual value of media_dir in config file is set to /tmp/mnt in this case which means it's scanning the entire disc.

I guess, the cause of that is this code https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/www/mediaserver.asp#L182

Code:
function initial_dir_status(data){
	if(data != "" && data.length != 2){		
		get_layer_items("0");
		eval("var default_dir=" + data);
	}
	else if( (_dms_dir == "/tmp/mnt" && data == "") || data == ""){
		$("noUSB").style.display = "";
		disk_flag=1;
	}
}

or this (I'm not sure) https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/www/mediaserver.asp#L661
Code:
document.getElementById("PATH").value = "/tmp/mnt";

The problem here is when you add custom configuration with minidlna.conf.add and you need the added media_dir in it to be the only, you get /tmp/mnt along with a custom directory.
 
Last edited:
The problem here is when you add custom configuration with minidlna.conf.add and you need the added media_dir in it to be the only, you get /tmp/mnt along with a custom directory.

Use a postconf script instead. It can manipulate existing config entries, so you can remove or modify them.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top