|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#61
|
||||
|
||||
@jaminben
Do you have a local community college or equivalent nearby? I know here they offer continuing education classes that include an intro to programming course. The language doesn't really matter. What is important is learning the fundamentals, which hold true regardless of language. If you are serious about learning the basics of programming I think taking a course would be a great investment of your time and (hopefully not too much) money. Unless you are very motivated and disciplined there is no substitute for live instruction and interaction. Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
#62
|
|||
|
|||
Quote:
I think I'm almost there now with regards to removing the single recorded shows. I just need to work out how to look inside each "Key" to see how many episodes are available. See screenshot of my latest code. Maybe I'm not but it feels like I'm understanding it better. I couldn't work out before how the loop would know how many shows I had but I figured that out Screensot details, on the left is the "Airing" list which shows all shows. At the bottom is the "Keys" and above that is the total number of "Keys" or grouped shows including the single recorded ones.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 04-29-2009 at 01:40 AM. |
#63
|
||||
|
||||
The structure of your loop looks right, but the body needs some work. I understand that this code isn't meant to be complete, but what you have in the body doesn't make much sense.
Code:
FilteredKeys = GetElement(GroupByMethod(Keys, "GetShowEpisode"), null) But whatever this line does or doesn't do is moot, because you then wipe it out in very the next line: Code:
FilteredKeys = Keys What you really want to be doing in the body of the loop (i.e. the code that gets executed once per key) is to call GetSubgroup() to get the subset of files corresponding to that key, measure the size of that subset, and branch on the result to either include or exclude the subgroup in a filtered map built up by the loop.
__________________
-- Greg |
#64
|
|||
|
|||
Yeah, the structure of the filtering code is completly wrong and is what I just got up to. I know it looks simple to you but to me its a massive improvement as I finally understand how the loop works and thnk I know how the filtering is going to work, its just getting it to work. Another few days of reading and trying things should get this finished. The extra tips you have given is pushing me in the right direction
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#65
|
|||
|
|||
Ok, So I'm still trying to make this filter work and do having it working but in the wrong place i.e after the event has already happened. Looking at my screenshot you can see that I'm able to view which grouped recordings have single files and which have multiple files. This all works via the "GroupedFiles" and the table component "AiringList" code. I can see what I need to do but dont understand how I can bring an alternative table component into the filter before it gets to the Airing code. I was under the impression that java_util_Map_keySet would be the answer, but it doesn't appear so.
Ignore the actual filter code as that just doesn't work and is my way of testing. I'm assuming once I get the correct code it will only display the false results of Code:
Size(GetShowTitle(GetElement(GetSubgroup(GroupedFiles, AiringList), 1))) >= 2 I keep thinking that what I've done to make it work in the incorrect place is overkill and that all I really need is Code:
Size(GetShowTitle(GetSubgroup(GroupedFiles, Keys), 1))) >= 2 Am I getting close or does it need more reseach? Cheers Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#66
|
||||
|
||||
Your loop still isn't doing anything at all & probably simply exits the first time through.
Inside the loop, you need to:
Try doing things 1 at a time on each line & use debug logging to help see what result you are getting at each step. Add a debug log statement that simply shows you what the current value of 'i' is too, so you can see in the log how many times your loop is running. You are combining several calls on a single line, which would be OK except that some of the nested calls aren't returning what you think they are & thus the whole statement fails. There are many ways to "do something if the size is or isn't what you want". You could use the java_util_Map_remove() call to remove the subgroup you don't want, as I mentioned in one of my earlier posts. (there are other solutions, but I'll leave it at one for now.) - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#67
|
|||
|
|||
Quote:
My problem is that I don't know what to put in the GetSubGroup boxes under the BeforeMenuLoad hook. As you can see I have it working outside this hook and within the actual menu via the table component. Grouping - the map to get the value from Key - the key to use for retrieving the value Grouping in my case would be Keys and Key would be GetShowTitle? I've had to type this reply very quickly before my broadband goes down for another two hours Unless I'm really lucky and leaving my router off for two hours has somehow fixed it
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 05-01-2009 at 10:58 AM. |
#68
|
||||
|
||||
Quote:
But the real question is, why are you trying to call GetShowTitle() at all at this point? You've already grouped by title in a previous call. Your Keys array contains all the titles; GetSubgroup() retrieves a set of files with the same title. Surely it's the size of that subgroup you want to measure. Wrapping that result in a call to GetShowTitle() throws away the subgroup and leaves you with the actual text of the show title (which is simply the key you used to get the subgroup in the first place). How is the length of that text string relevant to your calculation? As Andy said, you really need to break this expression down into its component calls and print out the result of each call to make sure you understand exactly what's going on at each step of the process.
__________________
-- Greg |
#69
|
|||
|
|||
I didn't want to do this but after trying for the last 6 days and at least 5 hours a day could someone please tell me what I need to use for this to work.
What widgets do I need to complete this list.
I dont want the data\values just a list of whats going to work, please.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#70
|
||||
|
||||
Inside the loop, use code something like this (I haven't tested it to verify the exact syntax):
Code:
i=0 <- Init loop counter if i < Size(Keys) <- Is index still within size of list of Keys? true <- Yes, it is CurKey = GetElement(Keys,i) <- Get the current key in the list, at index number 'i' CurSubgroup = GetSubgroup(GroupedFiles,CurKey) <- get the subgroup for the key if Size(CurSubgroup) <= 1 <- Is the current subgroup too small to bother with? java_util_Map_remove(GroupedFiles,CurKey) <- Yes, it is, so remove the key from the grouping. i = i + 1 <- Note the indentation here; always increment counter regardless of subgroup size reference to if i < Size(Keys) <- jump back to start of loop else <- Not really needed - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#71
|
|||
|
|||
I think I'm going to cry
It still doesn't work, I'm pretty sure I understand what its doing but how do I link back to the Table? I've tried all sorts of links and also removing the code from the BeforeMenuLoad hook resulting in one big code tree. One last little gift then I promise you wont hear from me for another few hours
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#72
|
|||
|
|||
Where are you setting Airinglist? If I follow you, you wnat to set Airinglist to the Hash of GroupedFiles. If you don't mind posting the xml file and can explain what you want it to do, I can take a look if you want another pair of eyes to go over it....
Thanks, Jeff |
#73
|
|||
|
|||
Quote:
Please find attached a zip file containing the export. Cheers Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#74
|
|||
|
|||
Not sure if this was you were looking for it to do or not... Let me know if this is not what you were trying to get it to do...
Thanks, Jeff |
#75
|
||||
|
||||
Part of your confusion is that you're using the variable name AiringList to mean two different things, neither of which is a list of Airings.
In the first case, you have AiringList feeding the Table widget. But you don't want a list of Airings here, you want a map of Airings grouped by title. That's what we just went to all that trouble to compute. So don't use AiringList here; use GroupedFiles to feed the table. In the second case, you've named your TableComponent AiringList. This is not the same AiringList as before; it's a new variable that just happens to have the same name (which is bad practice, in case that's not obvious). And again, it's not a list of Airings; it's the group key from your GroupedFiles map. Since you grouped by title, the key is a String containing the show title. So name it something that indicates that (like Key or Title or whatever). But be aware that if you change this variable name, you'll also need to change the use of it feeding the Text widget. Make those changes and you can get rid of the AiringList variable altogether, because it's not doing anything for you.
__________________
-- Greg |
#76
|
|||
|
|||
Quote:
Thanks but you get the same results that I do when I place the "AiringList = GroupedFiles" above the java_util_Map_remove(GroupedFiles,CurKey) widget. A list of shows but it doesn't remove the single recordings.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#77
|
|||
|
|||
It does show the list but it doesn't remove the single recordings. I'm not sure if Andy has put a deliberate mistake into the mix to try and make sure I understand it. Maybe I'm trying too hard and need to step back a little.
The screen shot shows the code as you suggested. Quote:
I see why its not removing the single recordings, its reading the "GroupedFiles" from further up the tree. You can see this by removing the filter altogether (see screenshot). So I must need to reference something after the filtering has taken place.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 05-01-2009 at 05:37 PM. |
#78
|
||||
|
||||
Quote:
If the filtering code doesn't seem to be doing what you expect, insert some calls to DebugLog() in your loop to print out the intermediate results and see what's happening line by line.
__________________
-- Greg |
#79
|
|||
|
|||
Quote:
Quote:
Thanks for everyones help tonight, I've learnt lots.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#80
|
|||
|
|||
Looks like I cracked the case... The main issue was that the return variable for the java_util_keySet returns a set and not an array. You have to convert the set to an array and then you can use GetElement on it. GetElement does not seem to work on sets... I have attached the copy that I have working...
Thanks, Jeff |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Studio and SageMC Questions | bama | SageMC Custom Interface | 4 | 07-26-2008 01:11 PM |
Silly Newbie Question: Starting Studio | willetin | SageTV Studio | 2 | 01-05-2008 08:21 AM |
Studio Newbie Question | mightyt | SageTV Studio | 4 | 01-30-2006 01:52 AM |
Some questions about the upcoming Studio. | ToxMox | SageTV Customizations | 26 | 06-08-2004 09:00 AM |