Feature MB Startup - Move Library Refresh and Validation to a Service

 
45 supporters

I know this is fundamental shift in the design of MB and is not a trivial task. But, from my own experience with MB, it would be a welcome change with everyday use.

Please let me explain.

  • I am not proposing that a metadata viewer/editor be added.
  • I am not proposing that the library refresh be removed altogether.
  • I am not proposing that a new database implementation be added to MB.

What I AM asking is that you separate the metadata full refresh and library validation from the Media Browser UI at startup and move it to it’s own console app that can be scheduled to run in the background.

Clone the current logic just as it is, decouple it from the UI and move it to a new app. An option to the config file could be added with the default being that MB behaves exactly how it does now. Manual refreshes via the keyboard or remote should not change in behavior or functionality, only the initial startup refresh should be cloned/moved. File and Directory watchers should still behave as they do now as well.

Essentially, with this new option enabled Media Browser will only be reading from the cache, leaving all back-end processing such as validation and imagecache generation to the new app. I'm sure there are many “enthusiasts” here that would disagree that this change is even needed. I think the discussion on CacheAllImagesInMemory hints that it is acceptable to require fairly beefy hardware to use MB comfortably. I respectfully disagree. Personally, I believe that simply moving the Full refresh and validation to a service will allow MB to be very very fast on moderate hardware and maybe even solve some problems with cache corruption.

Let the UI portion of MB do what it does EXTREMELY well…display my media. And, leave all the heavy lifting to a console app.

-Sinjen

 
votes newest oldest
 
  • Created:about 3 years ago

Yerp, this has actually been approved for a while :) I just need some time to get to do it.

 
 
  • Created:about 3 years ago

While I agree that this is a good design goal (and moving to a service will open up a lot of other possibilities), I don’t believe it will achieve any increased performance given the same hardware.

Sam, please correct me and explain if I'm wrong about that…

 
  • You are correct, I believe. I don’t think the external service will perform any better on the same hardware for the initial build/rebuild process. But, the result will most certainly be a perceived increase in performance since the GUI portion will no longer suffer from what goes on in the backend. Because the service will always be running, it will no longer have to “catch up” with the changes. The GUI portion of MB will only be reading data, not trying to build stuff. You can even allow the user to prioritize the processes letting them decide what’s more important, a faster MB interface, or more accurate metadata. – sinjen about 3 years ago
  • It actually will help performance significantly, since we can offload all heavy lifting to the service and not keep on running stuff every time a user clicks the “Media Browser” tile. Additionally we will be able to spin up the library on startup, so when, eventually, the user click on the tile it will instantly come up. – sam about 3 years ago
  • Okay, assuming the service is always running, and it has it’s own way of determining when it needs to refresh, I agree. But, we need a way to manage when the service is and isn’t running… – ebr about 3 years ago
  • Yep, which is why you wouldn’t actually rip out any of the current functionality. If = False, then the old functionality runs. If the MBlibrarysvc.exe is not running, again fall back to the old functionality. – sinjen about 3 years ago
  • Hmm, I must have enclosed that pseudo value in my previous comment in symbols, or maybe it was the equals sign, oops. Anyway, it should have displayed If the UseLibraryService config option is set to False, then the old…etc. – sinjen about 3 years ago
  • show 1 more comment
 
  • Created:about 3 years ago

To me, this is the #1 feature that would make the biggest impact. Media Browser has always been a bit laggy with my folder of thousands of media. Having it as a service will make a dramatic difference.

 
  • Do you have any data to back this up? have you tried a prototype UI that doesn’t do a refresh for example (can we try that ourselves somehow)? – flynn about 3 years ago
  • i use vanilla as the theme. one of the issues is that when i start media browser, i need to wait a few seconds before i can enter into the movies or tv folder, otherwise mediabrowser closes. i am assuming this wait time is loading time. – mrimagineer almost 3 years ago
 
  • Created:about 3 years ago

This is THE EXACT feature I've been wishing for since, well, the very moment I started using MediaBrowser. You got my “Wish-Star”.

 
 
  • Created:almost 3 years ago

This would be a welcomed addition. I have recently upgraded to a 64 bit system and 8gb of ram to host the cache on a ram drive. But once built I had to navigate through the entire library to get it to populate (at considerable time).

Obviously the system would take the same amount of time/resources to do this either way, but it would be nice to have an automated way to force everything to re-load.

Thumbs up.

 
 
  • Created:almost 3 years ago

Somehow I missed this post. Might just have to pull a wish for this one!

 
 
  • Created:almost 3 years ago

i think this is a Pretty Big Deal.

 
  • You're right, it is. Both from a user’s and development perspective… – ebr almost 3 years ago
 
  • Created:almost 3 years ago

I've just been pondering over the possibility of something, just out of personal interest really. Would it be possible for me to disable the collection refresh code in a personal build off of the trunk? I haven’t looked at the code and I'm in work right now but I'd like to see just how quick it would be without the media management side of things.

My idea would be to run the trunk, get my caches all sorted and then uninstall and install my custom trunk, which should just use what I have in the caches? I realise this is a niche request but I'm interested to see the benefits if it is indeed possible.

 
  • The current version of MB only runs the validation once per day so you are basically already seeing the results of no refresh with each subsequent MB load. – ebr almost 3 years ago
  • so if i open MB, then close it after i receive the refresh messages, it shouldn’t give me the “refreshing library” messages again? – gr021857 almost 3 years ago
  • That’s right. – ebr almost 3 years ago
 
  • Created:almost 3 years ago

I make this my last wish.

When can we expect more info about how and when?

 
  • This is a lot of work that neither Sam nor I have the time for right now, unfortunately. – ebr almost 3 years ago
 
  • Created:over 2 years ago

Maybe this would be a good time to look at making this change with the next version?

 
 
  • Created:over 2 years ago

As a new user of Media Browser, I am kind of shocked that my video’s don’t appear right away. I'm moving from a PS3 based Media Center to a full blown HTPC. I am running an i5 750 with 4GB of ram, and a Solid State Harddrive (A bit over-blown for a HTPC, but I have other uses for it if needed).

I'm quite surprised that my 650GB worth of Television and Movies takes about 15 minutes to ‘fully’ be viewable after I open up media browser. This data is “right there” (local media data from MCM) and should be viewable very very soon after restart…

I deal with a lot of software at work that need to keep meta data in sync. The reality is, anything that “Pulls” has performance issues in some way. The only systems that really work well get a “Push” for the data saying it has changed. This is difficult (if not impossible) for some software to complete.

Ideally it would refresh a directory only when it sees the change date is different (I know this isn’t always reliable in all versions of windows, so that’s a show stopper)

If we could resolve this issue, then I think it’s near a perfect product. I have a few more days of evaluating it before I donate… but I think all the developers have done a great job so far.

 
  • takes about 15 minutes to ‘fully’ be viewable => I have 9TB of media and no overblown HTPC (t7200 cpu/4GB RAM), my media is viewable within a second or 10. – ehgeahrev over 2 years ago
  • Yeah I think you are being a little harsh here to be honest. Although I think we are all agreed that the validation process needs work it by no means a slouch. My 3TB loads immediately too and I am running a P4. There are some tweeks you can do to speed things up. I can only assume the validation is running everytime you start MB? If so change the “FullRefreshInterval” to a bigger number. You can also have “CacheAllImagesInMemory” enabled. Check this article for details on these and other setting. I would also like to advise that the caching does also take some time especially the images. These are only cached as you traverse your collection so it does appear sluggish at first. Once you have populated your cache though things should be good. – skynet600 over 2 years ago
  • “Viewable” vs “Refreshed” I guess I need to explain. I can open up Media Browser and see the shows in about 15 seconds… but the full dataset takes longer. If I'm after say “30 Rock” it’s fine since it’s first. But if I went for, say “Star Trek” the data refresh would not have finished and so the episode data would not be viewable. – Devanchya over 2 years ago
 
  • Created:over 2 years ago

Swapped a wish over for this… This would by far make MediaBrowser perfect for me…

Would be great if the WebService could hook into this instead of only running when media browser is running… Then the MediaBrowser-RC plugin would work without mediacenter needing to be running…

Definitely definitely will be leaving my wish on this one

 
 
  • Created:over 2 years ago

Sam just posted a wonderful little utility for performing a library refresh externally from Mediabrowser. You can find it here Oh no, my meta data refresh process is all stuck

-Sinjen

 
 
  • Created:over 2 years ago
  • Modified:over 2 years ago

Does anyone think this might be useful if created as an oData provider?

Open Data Protocol

If so, the mediabrowser library could power a lot more than just the MCML in MediaCenter. Perhaps even players for Mobile devices (smartphones, etc).

 
 
  • Created:over 2 years ago

I think this would be a great addition to the program as a whole, but I personally would probably have to disable it.

A fairly big chunk of my media is on an external drive. I only turn it on when using media browser, so I assume using this (i.e. having it rebuild when my external drive is turned off) would remove all the external drive’s items from the media browser cache, right?

 
  • Yep. If they are gone, it will remove them. – ebr over 2 years ago
  • So that I understand this correctly, this option is only useful for those that have their media always on? My Mediasmart server turns on from sleep as soon as my HTPC wakes up. I wonder how well this work in this setup. I guess I'll find out soon enough – andyd2k over 2 years ago
  • The service is running on your htpc too so it should be no different… – ebr over 2 years ago
 
  • Created:over 2 years ago

Noticed that this is updated to complete – I presume that is code complete??

Any idea when we can expected this wish to be released?

Thanks

 
  • soon. we're currently doing extensive beta testing. target date is dec 31st, but no guarantees – birkoff over 2 years ago
  • Great – looking forward to it. – chubby over 2 years ago
  • yeah, don’t get too tied to that 12/31 date… – ebr over 2 years ago
 
  • Created:over 2 years ago

Do I understand it right? One will have the choice to run library validation as a service on request (or scheduled)? Does this mean that if you have your media on a network share which is for whatever reason not online, and if you have this service set off, one could still enter MB and scroll through the media library because all is loaded from the local cache and no validation takes place, unless requested?

 
  • Kind of. In addition to the new service there is also a new option to turn off all auto validation inside the MB interface. So, you could achieve what you want by turning of auto validations. – ebr over 2 years ago
  • now you got me all excited! thank you so much! this is a big step forward. will be happy to donate (but not through paypal). – ehgeahrev over 2 years ago
 
  • Created:over 2 years ago

I def. need this new option. I think it will solve my current issue when loading MB. I wanted to show my support for MB and this fix, and donated yesterday.

I assume that this isn’t in the latest 2.2.9 release. When is the projected date?

Thanks for such a great program guys.

 
  • See http://community.mediabrowser.tv/ main page… Draco is the next build, which contains this feature if Im not mistaken… Release date has slipped a couple of times, but its a pretty major update… Current projected release date is on the 7th… – adgrimes over 2 years ago
  • As you can see on the CT front page, it’s currently listed as this Friday, January 7th. We're currently nearing the end of the beta testing phase, although I don’t know if it'll be done in time for Friday. Just stay tuned! – Riccardo over 2 years ago
  • I went ahead and downloaded the latest source code and built it. I'll let you know if it fixes my current issue. Thanks again. – Gunjan Datta over 2 years ago
  • All right, but just be aware that that code is probably changing by the hour as the developers approach the final 2.3.0 release… – Riccardo over 2 years ago
  • Nice feature. Do you need to reinstall everything or update MB? Which way is the best way ? – Saiyandt over 2 years ago
  • show 1 more comment
 
  • Created:over 2 years ago

Hi

Using Draco Beta and love this service … thanks :–)

I'm running MCE on a dedicated server directly connected (HDMI) to my flatscreen TV. This connection is using a account without password to make it MCE remote controll & family friendly. Draco was installed using this account.

When accessing my server (using remote desktop connection) I notied that Service tray icon can’t be seen nor configured!

Is there any way that service icon could be visable and accessable from any user/session?

 
  • Sorry, no. It needs to run in the context of a user that has the proper priviledges to access the library. That is one of the reasons we went from a true service to a tray app. – ebr over 2 years ago
  • Both accounts have administrator priviledges and full access to media library. Do “prober priviledges” mean the account that originally was used installing Media Browser? What about new updates? Which account will trigger installing a update? – Mittaa over 2 years ago
  • Make sure that when you RDP into the HTPC that you use the /ADMIN switch for mstsc.exe (create a new shortcut to the RDP client if you need to). This will connect you to the “console port” of the machine, which should be the currently logged in user. – sinjen over 2 years ago
  • Here’s a shot of one of my RDP shortcuts, if it helps. RDP Propertiessinjen over 2 years ago
 
  • Created:over 2 years ago

Mittaa,

You can easily set a password for the account that logs in and just have it auto-login upon startup.

Please have a look at this article for a how to. I do this on my dedicated HTPC’s and it works very very well.

Regards,

-Sinjen

 
 
  • Created:over 2 years ago

Sinjen,

I would like to make it a bit more clear :–)

The “MB” account is a dedicaded account used for accessing MCE using TV remote control only (no keyboard). When server starts my children/wife can log in without using a password. This session is nearly always running and can’t be accessed using RDP! This is how I want it to be and its working fine.

When I need to do anything else but using MCE, i'm used to run a second session using RDP and another account (password protected). In this way I don’t have to interupt my family if they are watching a movie. Unfortunately I can’t access and configure MB service from this “administrative” session.

OK no big deal … but it raise two questions:

  • Who triggers service/tray application startup? Is it on machine level (any user) or a destinct user?
  • I know that Extenders (like Xbox) can’t trigger automatic update, but what about different instances of MB? Is it the first running instance of MCE or will it only happen when a destinct user runs a instance of MCE? If it’s the first running instance of MB (any user) … this user would take ownership over the service!
 
 
  • Created:over 2 years ago
  • Modified:over 2 years ago

Who triggers service/tray application startup? Is it on machine level (any user) or a destinct user?

The first user who starts MB or the Configurator will cause the service app to load in that user’s session.

With your configuration, you will not be able to access (or run) the service app because it will be running in another user’s session and we restrict it to one instance for the whole machine. It would be no different than if, say, that user was running MS Word. You would not be able to see or interact with that instance of Word either. The difference here, is we won’t let you run it again in your user space.

 
 
  • Created:over 2 years ago
  • Modified:over 2 years ago

ebr,

OK I think i get it now :–)

Service tray icon can only be seen by the session that was run first. So two concurrent sessions (A and B) running on same machine would be no problem :–)

 
 
  • Created:over 2 years ago

So am I right in thinking that this service will run through the process which usually starts when you start MB before you actually start MB? I currently turn my HTPC on and go make a cup of tea, come back and go in to MB which then takes around a minute to load up. Would this service change to turn HTPC on, make cup of tea, go in to MB which loads straight away? Up until recently I was using a ramdrive to make the process quicker, if this saves me from having to set up the ramdrive again (the trial expired) then I'll gladly donate again :)

 
  • That’s pretty much it, yes. All the library and image refreshes can be scheduled to run without MB running, and when you start MB, the updated cache is there waiting. It’s currently defaulted to run every 24 hours at 2am. – Riccardo over 2 years ago
  • so it'll be like any other service where it can be changed to run at system start up? Excellent new feature, nice one :) – SpaceMunkey over 2 years ago
  • It’s more of a tray app than an actual Windows service. It launches at startup, but I don’t recall if it immediately begins a refresh or if the timing scheduler is the only thing that kicks it off right now. – Riccardo over 2 years ago
  • There were technical difficulties in using a true service. So, the new library refresh tray app was born. What that means is that your machine needs to be ON at whatever time you have set for the refresh to happen. Currently, the user still has to take care of that part, by either leaving the machine on, or scheduling your own event in the windows scheduler to wake up your machine prior to the MB tray app refresh time. The tray app does have a setting to put the machine back to sleep though. – sinjen over 2 years ago