Might be the reason why Media Compiling is so slow

Why does the wdtv create uniondb.cas files, which are basically copies of all the other wdtv.cas2 files?  In my setup it appears the WDTV is trying to update three different databases on different shares with the media information it collects for each file.

I have my media shared over the network like this:

  • \SERVER-1\Done
  • \SERVER-1\New
  • \SERVER-2\DVDs
  • \SERVER-2\Music
  • \SERVER-2\Shows
  • \SERVER-2\TV Shows

In each of those shares is a .wdtv folder with a wdtv.cas2 file in it.  In addiiton to that there is a uniondb.cas files in each of these directories:

  • \SERVER-1\New.wdtv\uniondb.cas_0090a9c05c4f 
  • \SERVER-2\Music.wdtv\uniondb.cas_0090a9c05c4f

I used SQLite Manager to compare the wdtv.cas2 and the uniondb files.  They appear to contain the same information and have the same database structure.

This could be part of the problem with compiling large libraries.  Ignoring any threading that might be going on the WDTV is opening at least four connections for every file it processes.

  • Media file it’s collecting information from
  • the wdtv.cas2 file for that share
  • The uniondb on server1
  • The uniondb on server2

Another disadvantage of this is the wdtv eats up about 3 times as much hard drive space since 2 addittional copies are being made.

I’m posting this here instead of the issues section, because I’d like some input on it before I report it as an issue.

As far as I know the smp creates only 1 uniondatabase-file. It puts it on the first share  it connects to. If you put a usb-thumb in the smp the uniondatabase will always be on the thumb and never on the other (network-) shares.

The reason that you have a uniondatabase on each network-share is that apparantly it is not always the same share it connects to first (one of the uniondbases is the old one, not the current one - if you know what I mean).

You can check this by deleting the library-files manually and then rebuild it: after that there will be only one uniondatabasefile.

1 Like

That would make sense since they’re on different server’s.  They’ve both probably been off at diferent times.  I think it’s still a reason that the media compiling takes so long.  Even if it’s only supposed to make one uniondb file, that’s still twice the work.

There’s probably some room for optimization here.  Some possible solutions might be:

1)  The ability to use a thumb drive plugged directly into the WDTV and have it not create the wdtv.cas2 files at all.

2)  Have it track the availability of shares/drives and place the uniondb on that share or drive.  Then there’s no need for the wdtv.cas2 files.

3)  Do away with the uniondb file, but then you’d probably lose any features that allow you search across all your media.

Option #1 would also have the benefit of reducing the number of network calls, and removing the need to have write access to network shares.  Sounds like a win/win to me.

I don’t have any unionDB files on my NAS boxes…

you only get the uniondb-file when you use the smp’s build in media-library.

@impdust. Still compliling … there’s something wrong but don’t ask me what, the smp-software has quite a lot of bugs. With the latetst firmware I have had this several times. Clear the media-library in the Settings-menu to start rebuilding …

What works for me is:

 when I go to bed I always suspend my NAS-computers (sleepmode), so what I do is:

  • first shut down the smp completely ( redbutton press longer than 5 seconds)

  • after that I put the network-share-computers/NAS to sleep.

-The next day when I want to watch a movie the first thing I do is to wake up the network-share computers.

-after that I start the smp (when you do it the other way around the smp - when in media-library mode (!) - probably never gives you access to your network-shares and you will have to restart it  -may be even shut it down completely)

The downside of shutting down the smp is that when you restart it will do a total rescan of the network shares, which takes a bit longer than starting from stand-by mode.

DrVerwoerd wrote:

you only get the uniondb-file when you use the smp’s build in media-library.

Yeah, I know that.   :wink:    I am using the media library.

All I have is the wdtv.cas2 file and a “no_check_content_[mac address]” from each of my three WDTVs.

As a test I placed a video file on a thumb drive and plugged it into the WDTV.

As DrVerwoerd stated.  It created a uniondb file on the thumb drive.  After the compiling was done I checked the three uniondb files and the only one updated during the process was the one on the thumb drive.

I’m not sure why TonyPh12345 doesn’t have any uniondb’s.

Obviously keeping two separate databases updated is going to take longer and slow down the media compiling, but it might be a necessary evil to provide the media library experience and prevent having to recreate the entire media library if the one holding the uniondb gets removed.

Thanks for the comments on this.

Watch the time stamp on the union file.  See if it ever changes.