|
SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Initiate Media Scan script?
Is there a script/exe to initiate a scan of import folders by executing it?
I just bought ANYDVD for blu rays and set it as an import path. I can get anydvd to launch a script/program on media change and want that to initiate an import folder scan. I don't want to set the auto interval to like 1 minute or anything as I don't watch that many blu rays yet. |
#2
|
|||
|
|||
If you have installed the Sage Scripting Framework, then the following small python script will do it.
Code:
from sagex.api import Global Global.RunLibraryImportScan(False) |
#3
|
|||
|
|||
Apologies but not being a java coder Im not sure where to put everything and how. I have the framework downloaded but not sure where to put the files. I assume the script you supplied goes in the scripts folder but how do I initiate it?
Thanks again. |
#4
|
||||
|
||||
I think there's a sendmessage utility. I don't remember if there's a command to initiate a scan, but if so you could use sendmessage to send the rescan command.
|
#5
|
||||
|
||||
No, there's no scan command. The scripting framework thing may be the only currently available method.
__________________
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 |
#6
|
|||
|
|||
Quote:
You can put the files for the scripting framework anywhere. They connect remotely to sage, so it doesn't matter where they are. (Which reminds me, you have to have the Sage Remote APIs plugin installed on the server.) Then you can call the script using the command Code:
java -jar ssf.jar scripts/yourScript.py A better rundown of all of this is at the wiki page that I originally linked to. If it works for you, you can run the script by hand and then watch on your TV for the "Library Scan in Progress" icon to appear in the sage interface. I do all of this on my own machine, so I can verify that it works as intended. (I'm using DirMon to trigger the script whenever I add files to a directory, but otherwise it is exactly what you are trying to do.) |
#7
|
|||
|
|||
Thanks, the script works great. Unfortunately it seems Anydvd isnt launching it I will play with that more later but thanks for the help!
|
#8
|
|||
|
|||
So... second question.... Can I alter things like import folders with a similar script? When the CD is removed but the drive letter is shown as an import folder it can't scan it so it just leaves the last disk on my media list.
|
#9
|
|||
|
|||
Quote:
|
#10
|
|||
|
|||
Ok well I got the add path working fine but the remove path is not.
Curiously the Add command passes a string but the remove wants a file object. I tried just passing a string but got a type cast error (c# verbiage sorry) This is the script as I wrote it: Code:
from sagex.api import Global from sagex.api import Configuration Configuration.RemoveVideoLibraryImportPath(java.io.File("f:\\")) Global.RunLibraryImportScan(False) This code yields the following result: Code:
Error Launching Class: sagex.ScriptRunner java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at ScriptingFrameworkLauncher.main(ScriptingFrameworkLauncher.java:122) Caused by: javax.script.ScriptException: Traceback (innermost last): File "<unknown>", line 3, in ? NameError: java at com.sun.script.jython.JythonScriptEngine.evalCode(JythonScriptEngine. java:292) at com.sun.script.jython.JythonScriptEngine.eval(JythonScriptEngine.java :170) at com.sun.script.jython.JythonScriptEngine.eval(JythonScriptEngine.java :175) at javax.script.AbstractScriptEngine.eval(Unknown Source) at sagex.ScriptRunner.main(ScriptRunner.java:46) ... 5 more Caused by: Traceback (innermost last): File "<unknown>", line 3, in ? NameError: java at org.python.core.Py.NameError(Unknown Source) at org.python.core.PyFrame.getglobal(Unknown Source) at org.python.core.PyFrame.getname(Unknown Source) at org.python.pycode._pyx0.f$0(<unknown>:3) at org.python.pycode._pyx0.call_function(<unknown>) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyCode.call(Unknown Source) at org.python.core.Py.runCode(Unknown Source) at com.sun.script.jython.JythonScriptEngine.evalCode(JythonScriptEngine. java:289) ... 9 more |
#11
|
|||
|
|||
Anyone? any ideas how to use the remove function correctly?
Thanks in advance. |
#12
|
|||
|
|||
This is pretty old and maybe nobody needs this but I will answer my own question.
AnyDVD never panned out the way I wanted it to so I stopped looking at this not too long after making my alst post. I ran in to the need to get this working today and realized my mistake from above in that the remove line argument needed to be instantiated correctly as a "file" type variable and then the variable needed to be passed to the remove call. so the remove script looks like this: from sagex.api import Global from sagex.api import Configuration from java.io import File IDir = File("//server/share/subfolder") Configuration.RemoveLibraryImportPath(IDir) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Satellite Channel Scan Error: Can't do C-Band and Ku-Band Providers in the same scan | Kiwi_Tim | Hardware Support | 0 | 09-16-2009 05:19 AM |
Scan for Media New Beta | nyplayer | SageTV Beta Test Software | 5 | 05-30-2009 03:24 PM |
What Is Currently Recording Script | joe123 | SageTV Customizations | 18 | 02-05-2007 09:40 PM |
init script | n8willis | SageTV Linux | 7 | 01-15-2007 03:33 PM |