|
SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
SJQv4: Design Discussion
Since I was introduced to the Sage v7 beta, I've been thinking about how to update SJQ to take advantage of the many new features of Sage v7. The biggest feature being the event model. After struggling for some time with too many features and not enough time to implement them all, I've finally come up with something I'm ready to proceed with.
The link below is a very high level overview of my plan for SJQv4. I encourage current users to at least read the "goals" section and comment on it. You'll notice there are a lot of changes in how SJQ will work if I proceed with this plan. For those not wanting to read that document, here's an executive summary of the key goals and changes in SJQv4: Key Goals:
Key Changes:
I encourage interested users to read at least the "goals" section in the document below, especially the section about the "removal" of client configs. This is a very different way to queue and run jobs vs. SJQv3 and older, but I feel this design aligns itself better with the new Sage v7 event model. http://links.battams.ca/sjq4design There is no ETA for betas, but I plan to start coding within the next few weeks. Once I get going, I don't expect it will take more than a month or so to get a functional beta in the plugin repository. I am looking for an STVi developer to join me, if someone's interested. I would really like to add STV integration for SJQv4, but I am not the person to do it. Looking forward to user feedback on this...
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#2
|
|||
|
|||
Quote:
Breezed through the goals and I like the direction you are taking especially Quote:
|
#3
|
|||
|
|||
This looks great.
I have one question regarding the language support. Will you allow the use of multiple language in a config file or will it have to be declared at the top and you stick with it throughout the config? What I'm getting at is I have a concern that since you are moving to support for multiple languages that when a new user that has no programming experience and asks for help, he gets a batch script to do one tasks from one person and later on when he needs to tweak something else is given some java or php code to do something else. I see a scenario where a user could be become very confused and does a lot of copy/paste and never quite grasps what they are actually doing. |
#4
|
|||
|
|||
Quote:
Return code 0: Client accepted the task and completed it successfully Return code >0: Client accepted the task and its execution failed Return code -1: The client rejects the task, push it back on the queue for future assignment NOTE: Above return values aren't finalized yet, just an example of the idea. So COMSKIP might map to comskip.exe. Doing so means you don't want to do any constraint checking on this task. If the server assigns this task to this client, it will always just run comskip.exe and return the result. And maybe your "ARCHIVE" task maps to "java -jar archiver.jar" and archiver.jar is a custom Java program that you wrote (or someone else in the community wrote and made available) and does a bunch of checks against the Sage API (is the file older than 60 days, is it not currently being used, are there 0 clients connected, etc.) before moving the recording to your NAS. If the constraints aren't met then it returns -1 and the task client tells the server we can't do this task right now so put it back on the queue. If the constraints are met then it proceeds with the task (move the recording and rescan the media library). So users aren't actually ever going to copy/paste raw code. They may copy jars or exes or scripts that do tasks of interest, but should rarely have to actually look at them. The key is that the exe being triggered by the task client is now responsible for deciding if this task should be run immediately instead of rulesets and client configs being used for all of these checks. The power in this decision is that much more expressive, powerful languages can be used to do this scripting. And of more interest to me, I no longer have to maintain the ugliness of the "scripting" language that was used in SJQv3. Quote:
Code:
java -jar archiver.jar -noclients=true -minage=60days -destfolder="D:/archived/tv" -src=%SJQ_FILE% Hopefully this makes sense?
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#5
|
||||
|
||||
Slugger,
I quickly read over the specs and see where you are going. I like the general direction. I enjoyed our collaboration on SRE and would also volunteer to do some Studio work on this. Tom
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
|||
|
|||
Quote:
Basically, at the very least I just want users to be able to set their job lists for favourites, etc. Basically, a new option to the favorites editor in the stv. Also, add a job list to manual recordings as well. I'd love to add a task queue viewer as well. And if you want to get fancy, a task queue editor (clear, stop, kill jobs from the stv as well). I'll be providing the API, I just need someone to put the UI elements in the STV. I think tmiranda and I did quite well with the same formula for SRE (I provided a high level API and he brought it to life in the STV).
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#7
|
|||
|
|||
Excellent! I'll definitely be in touch with you (and Plucky) when I have more details. I'll probably throw my ideas out there and you guys can tell me what is and isn't possible via the STVi.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#8
|
|||
|
|||
Quote:
This could either be accomplished with a set of return values indicating the timespan of the next check. Or another option, which could add flexibility for other situations, is for the server to expose an API (maybe even through the event system) for rescheduling a task. So the client would reschedule the task and return success. I realize your return values were just an example, but they sparked this idea for me. |
#9
|
|||
|
|||
Quote:
Just a counter thought: Perhaps the archiver.jar task is a cron scheduled task that just runs every day looking for new recordings that meet the age criteria and then adds them to the queue and then you don't use the age criteria flag to finally archive them. This way jobs aren't retried for 60 days, but only until all the clients disconnect, etc.? Quote:
1) What if you decide you actually want 30 day archiving? That old job is hidden until 60 days. I'd still have to show it in the queue so you'd remember to delete. 2) A new client might be added before the 60 days is up that doesn't have the 60 day constraint attached to it so the server still needs to check in with that server. I think the best thing to do is retry for 60 days. Alternatively, tasks with this kind of long term delay should probably not queue up when the fav starts recording, but instead use a cron job to poll for recordings that match the criteria and queue them up at that time. (These ideas are great, keep them coming. This is why I want to discuss things before I dive in and start coding.)
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#10
|
||||
|
||||
Read over the doc and I like the way you're thinking. I'll have to read it over a few more times to really wrap my head around it, but here are a few quick use cases that I didn't see addressed:
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink) |
#11
|
|||
|
|||
Quote:
The other way, which I wanted to avoid, but I don't think I can, will be to provide a manual task loader. Either through the web UI or maybe as a cmd line tool. You provide the job id and the object id (i.e. MediaFile:123456) and it'll get added to the queue. Obviously, I'm going to have to provide some way to inject jobs into the queue outside the event listener mechanism. Making this available via the STV will be very useful as well, I'd think. Quote:
My bigger vision would be that someone (perhaps me) creates a generic "run_in_order.exe" program that accepts a series of exes to run in order, ensuring that nothing runs unless all the others before it succeed. So you might map your "COMSKIP_N_COMPRESS" task id in SJQv4 to this exe: Code:
run_in_order.exe %SJQ_FILE% comskip.exe mediashrink.exe As you can see, one of my main goals in this version is to remove the "brains" from the SJQ code and put them into the user's scripts/exes. Two reasons: 1) Maintenance and 2) Trying to cover everyone's wants and needs is too much for one person. Instead, I'll focus on providing a distributed, multi-threaded job queue and let the community come up with the controlling logic through various scripts and programs. Even if I write a lot of these helper scripts, I'd rather write helper jars for people than try to constantly change/enhance the SJQ scripting language, especially when it's not something I particularly enjoy anyway. Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#12
|
|||
|
|||
Quote:
|
#13
|
|||
|
|||
Quote:
Keep thinking of issues/scenarios b/c, trust me, I definitely haven't thought of them all and this is why I'm starting this discussion now before I start coding.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#14
|
||||
|
||||
On the UI Mod discussion, I can definately see a need to be able to add a task to the queue for a given object, or group of objects. Perhaps if the Tasks themselves could be tagged with a UI_Friendly_Name property. If that tag exists, then that task will be created as a button on the options menu for media file(s). My first example would be a 'Send to Phone' task that could, for instance, compress a file, and put the results in a 'sync' folder for next device sync.
__________________
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 |
#15
|
|||
|
|||
Quote:
Your idea is just as good except that I'd imagine would be a lot more difficult to provide in the STV. But either way, I'm really looking forward to integrating something into the STV this time around.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#16
|
|||
|
|||
As I think about your desire to reduce future maintenance requirements I was wondering if you had thought about making use of one of the several open source job schedulers out there. They generally have clients already written and people who are interested in maintaining that part of the project. This would allow you to concentrate on the Sage interface and the unique logic required to prioritize operations for processing shows. Also, they tend to focus on robust job completion in cluster environments so we'd have a ready made mechanism for managing job failures.
Down side is that they have a bit of a learning curve and may be a bit heavy for this type of work. But it might be worth looking into. |
#17
|
|||
|
|||
Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#18
|
|||
|
|||
I run sjq under linux, and the one little nit that bothers me is that I need to restart the client manually each time I restart sage. If I restart sage without restarting sjqc, the new incarnation of sage never connects to the existing sjqc. Some sort of more robust sage-sjqc connection would be nice.
|
#19
|
|||
|
|||
Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#20
|
|||
|
|||
Reference scripting language perferences?
So I'm well underway with the coding of the new SJQv4 engine. I've got the new task client talking with the new server engine and vice versa. Tasks can be added to the queue and tasks are assigned to free clients, blah, blah, blah. It's all PoC/pre-alpha at this point, but it's coming a long quite nicely. My original estimates of a month or so are probably way off, it's going to be longer before betas are made public (the free hours to code this just aren't as plentiful as I was expecting).
Anyway, I'm starting to think about how people are actually going to write those custom conditions. Helper programs that I (or others) may provide will never be able to cover every conceivable scenario. For those special cases, users are going to have to write scripts themselves to do those checks and tests. Though any program/script/exe in any language can be run by the task clients (assuming you have the proper runtime environment installed on your system), I can't possibly provide a reference environment for them all. So it's time to speak up! Here's exactly what you're deciding on: For lots of users, they'll simply say they want to run comskip.exe for task id 'COMSKIP'. They don't have any conditions, etc., they just want to run it. Great, tell the (new v4) task client that COMSKIP id maps to comskip.exe and you're done. Other users are going to want to ignore comskipping certain channels and maybe delay running when clients/extenders are connected to the server. For these common/popular conditions, there will likely be a helper program available so you'll just map 'COMSKIP' to "intelliskip.exe" where intellitskip.exe is a program contributed by someone in the community that takes a bunch of command line args, etc. and will do the checks for you. This is also an easy case. Now, what we're talking about here is the final scenario: You only want to run comskip on shows with specific titles, on specific channels, on specific days and you only run if there are no clients connected and there is no recording scheduled to start for at least the next 3 hours. Obviously, that's a pretty unique/custom set of circumstances you want to test for. It's very unlikely that someone else in the community will have a helper program that can deal with all of those requirements. So you need to write you're own tester. If you can program then you can write a Java program, C#, etc. to do this and then map 'COMSKIP' to your new exe and that will work fine. But if you're not a programmer, you need a reference platform - a skeleton, if you will. And that's what I hope to provide. Basically, I'd have a skeleton of a script where there's a single function that does the prechecks as desired and if those pass then it proceeds to launch your exe (comskip.exe, in this example). All you'd have to do is replace the exe to call and fill in your test block with the conditions you want to check for. There is but one requirement: the reference platform must be a scripting language. Why? Obviously people with this need for custom tests aren't going to have C/C++ compilers or JDKs installed and you don't want to have to require a recompile of the skeleton for each change. I want the user to be able to make their change, save it as a new script, then map their task id to the script and then forget about it. I'm stuck deciding between PHP and Perl. My main reasons for these two are:
With no feedback on the issue, I'm most likely to proceed with PHP5. This means users (who require the reference/skeleton scripting support) will need to install PHP5 on all systems that run a task client.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DST discussion | mikejaner | SageTV Software | 53 | 03-18-2010 07:08 PM |
EPG discussion | korben_dallas | General Discussion | 1 | 12-14-2004 05:30 PM |