How to exclude HDR folders under "My Video " from DLNA?

/df

Well-Known Member
The thread title just about speaks for itself. I suppose someone would have mentioned if this were possible, with the built-in Humax DLNA. I'd like to remove CF [settings folders], for instance. Obviously other DLNA servers might be configurable in this way, but wouldn't support on-the fly decryption.
 
I think this will be a case of finding a trick - some combination of characters in the folder name that the DLNA indexer doesn't like, for example (although the consequence might be delinquent half-awake).
 
I think this will be a case of finding a trick -
The trick might involve using the builtin DLNA to perform the decryption but using another server for the remote access.
You could also investigate whether using symbolic links for folders hides them from DLNA
 
I think this will be a case of finding a trick - some combination of characters in the folder name that the DLNA indexer doesn't like, for example (although the consequence might be delinquent half-awake).
The question of non-ASCII characters in filenames was raised in a recent thread, although the actual DLNA behaviour at issue was not (so far) resolved.
The trick might involve using the builtin DLNA to perform the decryption but using another server for the remote access.
You could also investigate whether using symbolic links for folders hides them from DLNA
I'm not enthusiastic about running 2 servers but the link idea is certainly worth trying.

Another route might be if Humax had "based" the DLNA server on some known code whose indexing configuration was known, but it seems to be homegrown as I realised when I reminded myself about the DLNA database /mnt/hd2/dms_cds.db.

This database has what seem to be some interesting configuration tables as well as the indexed media tables tblPhysical, tblMedia, tblObject, tblResource. tblScanSetup appears to guide the indexing process but doesn't obviously provide a way to specify excluded folders.

But presumably if we know when the index is updated (inotify, perhaps), some SQL could delete unwanted items from some or all of the media tables. It looks like tblObject lists the namespace that is exported by the server, so maybe something like this would eliminate [ folders:
Code:
delete from tblObject where mediaID in (select mediaID from tblMedia where localURL LIKE '%/[%')
... if it doesn't cause unwanted side-effects and/or caching in the client or server doesn't defeat it.
 
The data base can be rebuilt so might be worth playing around
Indeed it might! At the third time lucky, we have a winner (where's the [marquee] tag when you need it?):
Code:
update tblObject set protection = 1 where title like '[%]%' ;
This seems to take effect as soon as the DLNA client refreshes.

But tragically, although the djmount DLNA filesystem plugin on Linux respects the flag, the DLNA client in the HD (and presumably HDR) Fox T2 doesn't.

I suppose the change may be overwritten on re-indexing (hasn't happened in the last several hours).

Some interesting SQL commands can be found in the output of strings -n 8 /usr/bin/humaxtv | grep tblObject. The analysis below of the tblObject table definition is based on that output, and the contents of my active DLNA database.
Code:
CREATE TABLE tblObject (
	objectID VARCHAR NOT NULL PRIMARY KEY ON CONFLICT REPLACE UNIQUE ON CONFLICT REPLACE , 
						/* 0 for the top folder (0), parentID\mediaID otherwise */
	cdsTitlePath VARCHAR NOT NULL, 		/* the full DLNA path text */
	mediaID INTEGER NOT NULL, 		/* 1 for the two top folders (0, My Contents), ID from tblMedia otherwise */
	parentID VARCHAR NOT NULL,  		/* objectID of parent, or -1 */
	restricted INTEGER NOT NULL,  		/* ? */
	childCount INTEGER NOT NULL,  		/* number of children */
	creator VARCHAR NOT NULL,  		/* the artist if set in metadata, or HUMAX */
	title VARCHAR NOT NULL,  		/* title if set in metadata, or final component of path */
	class VARCHAR NOT NULL,  		/* object. ... container, item.audioItem.musicTrack, item.videoItem.movie, etc */
	searchable INTEGER NOT NULL,  		/* always 1? controls whether object can be searched for? */
	searchClass VARCHAR NOT NULL,  		/* upnp:searchClass attribute, always 0? Initialised to 0 and not otherwise mentioned in humaxtv binary */
	createClass VARCHAR NOT NULL,  		/* 0 for media, object.container;object.item.imageItem;object.item.audioItem;object.item.videoItem for folders */
	writeStatus VARCHAR NOT NULL,  		/* always 0? Initialised to 0 and not otherwise mentioned in humaxtv binary */
	refID VARCHAR,  			/* always NULL */
	volatility INTEGER DEFAULT 0 NOT NULL,  /* 0 for media, 1 for folders, may sometimes be set to 2 */
	sfmType INTEGER DEFAULT 0 NOT NULL,  	/* 0 for media, 1 for folders */
	protection INTEGER DEFAULT 0,  		/* normally 0 until ... */
	itemType INTEGER DEFAULT 0 NOT NULL,  	/* 0 for media and the two top folders (0, My Contents), 1 for other folders */
	dlnaManaged INTEGER DEFAULT 0 NOT NULL 	/* dlna:dlnaManaged attribute: 0 for the two top folders (0, My Contents), 3 for other folders, 4 for media */
);
These columns are indexed:
  • cdsTitlePath
  • mediaID
  • volatility
  • itemType, childCount
  • parentID, title
  • parentID, class
 
Last edited:
The auto-unprotect package may well clear the protect flag in the dlna database

Looking at the list of fields dlnaManaged looks interesting - have you tried tweaking that setting
 
So, something that does work.

Change the table tblObject that's queried by the DLNA server to list the available resources into a view that excludes the unwanted items. This has to be done when the Humax settop binary isn't running, unless a way can be found to make it use this schema when it re-creates the DLNA database. Since views in sqlite3 are read-only, auxiliary triggers have to be defined.

Code:
begin transaction;
alter table tblObject rename to realTblObject;
create view tblObject as select * from realTblObject where title not like '[%' and cdsTitlePath not like '%\[%';
/* what to do when insert, update, delete are invoked for tblObject view ... */
create trigger tblObjectInsert instead of insert on tblObject 
begin
	insert into realTblObject values 
		(NEW.objectID, NEW.cdsTitlePath, NEW.mediaID, NEW.parentID, 
		NEW.restricted, NEW.childCount, NEW.creator, NEW.title, 
		NEW.class, NEW.searchable, NEW.searchClass, NEW.createClass, 
		NEW.writeStatus, NEW.refID, NEW.volatility, NEW.sfmType, 
		NEW.protection, NEW.itemType, NEW.dlnaManaged);
end;
create trigger tblObjectUpdate instead of update on tblObject 
begin
	update realTblObject set objectID = NEW.objectID, 
		cdsTitlePath = NEW.cdsTitlePath, mediaID = NEW.mediaID, 
		parentID = NEW.parentID, restricted = NEW.restricted, 
		childCount = NEW.childCount, creator = NEW.creator, 
		title = NEW.title, class = NEW.class, 
		searchable = NEW.searchable, searchClass = NEW.searchClass, 
		createClass = NEW.createClass, writeStatus = NEW.writeStatus, 
		refID = NEW.refID, volatility = NEW.volatility, 
		sfmType = NEW.sfmType, protection = NEW.protection, 
		itemType = NEW.itemType, dlnaManaged = NEW.dlnaManaged;
end;
create trigger tblObjectDelete instead of delete on tblObject 
begin
	delete from realTblObject where objectID = OLD.objectID;
end;
commit;
As sqlite3 appears to be statically linked, the general way to hack this functionality into the Humax settop binary with a forwarding DLL for /usr/lib/libsqlite3.so.0.8.6 won't work. Perhaps the system table sqlite_master can be given an insert trigger to subvert CREATE TABLE tblObject .... Or perhaps a hook library injected with LD_PRELOAD could patch the static library addresses to call the dynamic library (also creating some space for extra static data).

Currently the DLNA Reset function deletes the database so trashing this. It could have overwritten it with an empty DB instead, perhaps with hacks built-in. Indications are that the test used by the system to detect a valid database is SELECT * From tblObject limit 1;: if that fails (or returns nothing) the content tables are dropped and re-created. So it should be possible to make the reset less disruptive.

You might hope (I did) that appending order by title to the view definition would result in a sensible sorting of the content in the client display. But while the order is correct, the client Humax display starts refreshing continually. The sort order for the queries on tblObject that list the available content in batches is set up at runtime with (presumably) sqlite3_snprintf(), but the sort order is always A.class:
Code:
"SELECT A.objectID FROM tblObject A, tblMedia B WHERE parentID = '%q' AND A.mediaID = B.mediaID %s ORDER BY %s LIMIT %d OFFSET %d;"
 
Last edited:
Did anyone get a solution to this. I am finding that the mp4 files I am generating (via ffmpeg on the box) are causing humaxtv to freeze. This has been mentioned in numerous threads elsewhere and also came to the same conclusion if I could move these files into a folder which then wasn't indexed then it wouldn't keep trying to 'play' them. I've tried the [..] method but that doesn't help.

Thanks

Rodp
 
Briefly, no (at least not beyond what is written up above), but a solution to your issue could be to write such mp4 with some other extension and rename it once the process is complete.

It is known that an incomplete mp4 can hang the UI, at least. A playable mp4 should not hang the system -- unless the file is using bad sectors of the disk.

You could post more details of what you're doing and how it's failing in a new thread. Perhaps it's here?
 
Last edited:
Back
Top