SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-14-2015, 10:19 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Feature request: Scan video libraries only

In my Sage libraries I probably have tens of thousands of songs and tens of thousands of photos (I use the photo screensaver). I think I have maybe a couple of thousand of video shows - lots of kids' TV shows plus movies.

When I do a media library scan it takes something like 5-6 minutes. A few months ago I set Sage up on another server and I only had the video files installed and I was surprised to see that my media scans took a matter of seconds. This must mean the scans on my main server are bogged down by the photo and music files.

It would be great if you could only scan the video libraries (or scan separately for music/photos/videos/all) as that would make it much easier to get a new movie/show up in Sage by saving me 5 minutes of scan time. I doubt that I am the only one with this issue.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #2  
Old 10-14-2015, 10:41 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Think this would be an awesome feature... sort of lines up with the post I had a couple weeks ago, when I said that it would be possible to actually do a real import of media files as they are added. ie, Java 7 has the ability to "watch" the filesystem for changes, so it would be possible to notify sagetv to load a single video when it is added, instead of having it do a full scan.
Reply With Quote
  #3  
Old 10-14-2015, 11:12 AM
Monedeath Monedeath is offline
Sage Expert
 
Join Date: Sep 2009
Location: Idaho
Posts: 514
http://forums.sagetv.com/forums/show...0&postcount=48

Is the post/thread in question.

Yes it would be a nice feature to have in place.

Although staying generally on topic, I know someone who would like to split the pictures and music DB off from the wiz.bin entirely. So it would conceivably fall in the scope of that kind of project. But he's still busy chasing other non-Sage projects right now, and just starting to dip his toes into the proverbial coding waters involving Sage. I don't think that kind of undertaking would be something that could done without a LOT of work(weeks if not months worth), and I doubt there would be much gained. Thankfully I think it's low on his list of things he'd like to do to Sage once he does work his way over here.
Reply With Quote
  #4  
Old 10-14-2015, 11:49 AM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
SageTV does sleep periodically when it's doing library import scans so as to not overload the filesystem with requests and interfere with playback/recording from/to the disk. This is done in the sage.Seeker.controlImportCPUUsage() method. If you want to put a property in there which allows disabling that CPU throttling; go for it, I'll approve it.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #5  
Old 10-14-2015, 12:10 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Narflex View Post
SageTV does sleep periodically when it's doing library import scans so as to not overload the filesystem with requests and interfere with playback/recording from/to the disk. This is done in the sage.Seeker.controlImportCPUUsage() method. If you want to put a property in there which allows disabling that CPU throttling; go for it, I'll approve it.
HOw much effort (in your mind) would it be to notify SageTV to just scan an import a single file? (ie, if we had a process that notified sagetv of a new single file.. it can scan and load it, instead of doing a full scan)
Reply With Quote
  #6  
Old 10-14-2015, 03:53 PM
Monedeath Monedeath is offline
Sage Expert
 
Join Date: Sep 2009
Location: Idaho
Posts: 514
Quote:
Originally Posted by stuckless View Post
HOw much effort (in your mind) would it be to notify SageTV to just scan an import a single file? (ie, if we had a process that notified sagetv of a new single file.. it can scan and load it, instead of doing a full scan)
Or for that matter, a single import directory.
Reply With Quote
  #7  
Old 10-15-2015, 05:30 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by stuckless View Post
HOw much effort (in your mind) would it be to notify SageTV to just scan an import a single file? (ie, if we had a process that notified sagetv of a new single file.. it can scan and load it, instead of doing a full scan)
Well, I think there are calls to directly add an item to the database, but I'm not sure if this process itself will trigger 3rd party metadata searches.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #8  
Old 10-15-2015, 08:39 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
I still really like the idea of just monitoring the filesystem to get notified of file additions, rather than having to do rescans.
Reply With Quote
  #9  
Old 10-15-2015, 08:51 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by stanger89 View Post
I still really like the idea of just monitoring the filesystem to get notified of file additions, rather than having to do rescans.
I have looked at this very briefly, and while we could just do an Add like Fuzzy stated, I'd rather tell sagetv to do a normal scan with a "hint" where the hint is folder or file to limit the scope, and then have it do it's normal thing. The seeker code doesn't seem to be setup that way, from what I can tell, (again very quick look on my part), but, that's not to say we couldn't change it. The monitoring part is pretty easy (java 7).
Reply With Quote
  #10  
Old 10-15-2015, 09:13 AM
Monedeath Monedeath is offline
Sage Expert
 
Join Date: Sep 2009
Location: Idaho
Posts: 514
http://sagetv.com/api/sage/api/Media...a.lang.String)

Seems to be geared toward a targeted single file import. This probably is the API call mentioned previously.

Digging further it looks like "java/sage/MediaFile.java" is handling the import process, but at my (basic) level of knowledge, I'm going to bow out of the chase from here.

Last edited by Monedeath; 10-15-2015 at 09:18 AM. Reason: grammar correction
Reply With Quote
  #11  
Old 10-15-2015, 09:14 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stanger89 View Post
I still really like the idea of just monitoring the filesystem to get notified of file additions, rather than having to do rescans.
I've started with this using Java 7 api Stuckless posted it's pretty straightforward but for now is seems to be better fit as plugin vs core because of Java ver requirement
Reply With Quote
  #12  
Old 10-15-2015, 10:12 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Couldn't Sage 9 just require Java 7 or greater? Is there any reason to maintain backward compatibility to Java 6?
Reply With Quote
  #13  
Old 10-15-2015, 10:28 AM
Monedeath Monedeath is offline
Sage Expert
 
Join Date: Sep 2009
Location: Idaho
Posts: 514
Quote:
Originally Posted by stanger89 View Post
Couldn't Sage 9 just require Java 7 or greater? Is there any reason to maintain backward compatibility to Java 6?
Narflex specified Java 1.5 as the current minimum version when Sage went OS.

Putting conditional code into the core to take advantage of Java 1.7+ has been discussed, but consensus was that implementing as a plugin probably was a better route to pursue to keep the code in core from getting crazy with conditionals. I don't recall Narflex weighing into things one way or the other.
Reply With Quote
  #14  
Old 10-15-2015, 10:45 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
The release notes said "Java compliance level is now 1.5", but I've never read anything saying there was a desire to keep it there. It was mainly of note because the JVM on the extenders was 1.4 so extender code can't be built from the OS code.
Reply With Quote
  #15  
Old 10-15-2015, 11:14 AM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
I still use Java 1.6 at home...but it shouldn't be that hard for me to upgrade that (I have a unique system that's pretty difficult to update outside of the SageTV stuff generally though).

And I don't think this is a big problem to solve either. If the issue is how long it takes; that can easily be sped up by not doing the throttling under manual request.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #16  
Old 10-15-2015, 05:27 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Monedeath View Post
http://sagetv.com/api/sage/api/Media...a.lang.String)

Seems to be geared toward a targeted single file import. This probably is the API call mentioned previously.

Digging further it looks like "java/sage/MediaFile.java" is handling the import process, but at my (basic) level of knowledge, I'm going to bow out of the chase from here.
Yes, that would add a file to the wiz.bin, but it doesn't trigger any events when done, so phoenix would not run on the file, for instance. If we want to do a targetted scan, it might not be too difficult to make an overload for seeker's process to limit the search to a particular part, there are a few hangups though. The first thing it does is make a list of all files from the scan, and then it parses through them and handles each one (checking if it is in the database already, adding it if it is not, etc). That part would be easy to simply limit that list generation. However, there's also logic to remove files form the database that are NOT there anymore, and that is where things would get more complicated.

Perhaps something that may be even easier to speed up new additions, is when the list is generated, have it sorted by the file's timestamp, descending (currently, it's sorted alphabetically). This would get the newest additions first, and maybe get your new files in there quicker. There needs to still be some alphabetizing, however, as it is currently sorted alphabetically to ensure -0 files are processed before -1, -2, etc. on multisegment recordings.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request - Hide Video Folder alton987 Diamond 1 03-05-2011 07:14 AM
Feature Request: Online Video Enhancements skyeclad SageTV Beta Test Software 2 01-12-2008 09:59 AM
Request: Zoom feature in video playback and livetv. debennett2 SageTV Software 5 04-03-2007 06:37 AM
Feature request: Multi import libraries CarlG SageTV Customizations 2 04-11-2006 07:45 AM
XML file creation in Video Libraries question dvd_maniac SageTV Customizations 1 11-12-2005 08:37 AM


All times are GMT -6. The time now is 02:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.