SageTV Community  

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

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 04-25-2009, 01:40 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by jaminben View Post
Thanks Mike, that makes sense....sort of I haven't gotten as far as adding the link for the following menu so I'll leave that alone for now.

I've noticed some discrepencies in my code which isn't allowing me to view recorded TV as well as imported TV shows Back to the drawing board I guess.
When you filter by "IsLibraryFile", it filters out all non-archived TV recordings.
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #22  
Old 04-25-2009, 02:20 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I've removed that, now its showing all the correct shows but it also displays the single recordings. I'm just trying to work out how to filter out the single shows but as usual its proving to be a little bit tricky It never rains does it, only pours All good fun though
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #23  
Old 04-25-2009, 03:17 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Nope I'm stuck with filtering out single recordings. The stupid thing is I've created a simple button which allows the sorting of media files into three groups (newest, title & category) but I can't figure out how to filter out the single recordings.

I'm trying to use:

Code:
Size(GetShowEpisode(RecordedFiles)) > 1

or

Size(GetShowTitle(RecordedFiles)) > 0
My thinking is that if more than one recording exists (> 1) then only display those shows. This didn't work so I moved onto to:

Code:
RecordedFiles = FilterByBoolMethod(RecordedFiles, Size(GetShowTitle(RecordedFiles)) > 1, true)
Same thinking power but that didn't work

Got any clues?

__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #24  
Old 04-25-2009, 03:41 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Do you have a variable set up and set a value for recordedfiles?

Quote:
Originally Posted by jaminben View Post
Nope I'm stuck with filtering out single recordings. The stupid thing is I've created a simple button which allows the sorting of media files into three groups (newest, title & category) but I can't figure out how to filter out the single recordings.

I'm trying to use:

Code:
Size(GetShowEpisode(RecordedFiles)) > 1

or

Size(GetShowTitle(RecordedFiles)) > 0
My thinking is that if more than one recording exists (> 1) then only display those shows. This didn't work so I moved onto to:

Code:
RecordedFiles = FilterByBoolMethod(RecordedFiles, Size(GetShowTitle(RecordedFiles)) > 1, true)
Same thinking power but that didn't work

Got any clues?

Reply With Quote
  #25  
Old 04-25-2009, 03:59 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by PLUCKYHD View Post
Do you have a variable set up and set a value for recordedfiles?
I do

I think I understand why its not working but I can't quite get my head around an answer.
Attached Images
File Type: jpg Filter single Recordings.jpg (119.9 KB, 125 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #26  
Old 04-25-2009, 04:27 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
I don't think you can use FilterByBoolMethod() like that. I don't think the filter method can be an expression.
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #27  
Old 04-25-2009, 04:51 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by MeInMaui View Post
This is a case where I'd define an attribute in the next menu with the name and value set to Airing. This will allow it to accept the passed value without resetting it to some particular value. You could also leave Airing undefined in the next menu and rely on the AddStaticContext() call to define it, but I tend to confuse myself if I do that.
My practice in such situations is to name the menu as if it were a function with formal parameters. I.e. a menu that expects a static context called Airing would be named something like MyMenu(Airing), so that it's clear both at the point of reference and within the body of the menu what static arguments need to be passed in.
__________________
-- Greg
Reply With Quote
  #28  
Old 04-25-2009, 04:53 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by MeInMaui View Post
I don't think you can use FilterByBoolMethod() like that. I don't think the filter method can be an expression.
Correct. The method argument must be a String naming a SageTV API method or a fully-qualified Java function.
__________________
-- Greg
Reply With Quote
  #29  
Old 04-25-2009, 04:57 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
My practice in such situations is to name the menu as if it were a function with formal parameters. I.e. a menu that expects a static context called Airing would be named something like MyMenu(Airing), so that it's clear both at the point of reference and within the body of the menu what static arguments need to be passed in.
I like that a lot. Thanks for the pointer, Greg.

Ben,

If you haven't done so already, I highly recommend that you enable the debug console. You have to change a registry setting to do it, so the easiest way is probably to use babgvant's registry settings utility (I think it's in there). This will open a console window with a real time display of the debug log output. This is VERY helpful. It would have shown you right away that there was a problem with your FilterByBoolMethod() call.

Aloha,
Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #30  
Old 04-25-2009, 05:21 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by GKusnick View Post
My practice in such situations is to name the menu as if it were a function with formal parameters. I.e. a menu that expects a static context called Airing would be named something like MyMenu(Airing), so that it's clear both at the point of reference and within the body of the menu what static arguments need to be passed in.
hmmm, I need to think about this for awhile as I'm not 100% sure what you mean.

Quote:
Originally Posted by MeInMaui View Post
If you haven't done so already, I highly recommend that you enable the debug console. You have to change a registry setting to do it, so the easiest way is probably to use babgvant's registry settings utility (I think it's in there). This will open a console window with a real time display of the debug log output. This is VERY helpful. It would have shown you right away that there was a problem with your FilterByBoolMethod() call.
I have now, very handy indeed
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #31  
Old 04-25-2009, 06:16 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by jaminben View Post
hmmm, I need to think about this for awhile as I'm not 100% sure what you mean.
Basically I'm saying that the name of a menu is like a code comment. You can put any information in there you like that you might find helpful. For me, the most helpful information includes a list of the AddStaticContext arguments the menu is expecting, so those dependencies are made explicit in the code both at the point of definition and the point of use.

I try to do the same thing, by the way, with code snippets shared by reference, prefixing each one with a comment widget listing (as far as practical) the variable contexts it's expecting to be set up for it, and linking references to the comment rather than to the subsequent code.

Widget code doesn't have the notion of true subroutines with formal parameter lists, but I try to structure my code as much as possible as if it did.
__________________
-- Greg
Reply With Quote
  #32  
Old 04-26-2009, 06:16 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by GKusnick View Post
Basically I'm saying that the name of a menu is like a code comment. You can put any information in there you like that you might find helpful. For me, the most helpful information includes a list of the AddStaticContext arguments the menu is expecting, so those dependencies are made explicit in the code both at the point of definition and the point of use.
I see what you mean but where I don't understand is the listing of all arguments in the menu. Do you simply mean the menu title has a really long name? (as long as the amount of AddStaticContext arguments there are).

Quote:
Originally Posted by GKusnick View Post
Widget code doesn't have the notion of true subroutines with formal parameter lists, but I try to structure my code as much as possible as if it did.
I try to lay my code out in what I would call a simple list so that I can come back to it later if needed and remember what's what.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #33  
Old 04-26-2009, 09:35 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I still can't figure out how to filter out the single recordings and be left with all the grouped recordings. I keep looking at the Recorded TV menu for ideas but nothings working.

Anyone fancy throwing me a bone to get me on the right track?

I've attached my code image so you can see where I'm at, which is the same place from 24 hours ago
Attached Images
File Type: jpg Anyone.jpg (96.4 KB, 130 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #34  
Old 04-26-2009, 11:37 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by jaminben View Post
Do you simply mean the menu title has a really long name? (as long as the amount of AddStaticContext arguments there are).
Yes, I mean putting the argument names in parentheses with commas in between, e.g.

Code:
Menu Name (arg1, arg2, arg3)
much like you see for function definitions in the API docs. In programmer-talk that's called an argument list.
__________________
-- Greg
Reply With Quote
  #35  
Old 04-27-2009, 09:16 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I'm still trying to filter out single recordings and I'm now starting to think that its just not possible Can anyone confirm that you cannot do this so I can move on and forget about trying to make this work.
If the worst comes to the worst I'll just remove TV recordings and make it work via imported media or achived shows, not ideal but better than nothing.

I've also attached an image of my menu which I've cut down to its basic form to try and make it simpler.
Attached Images
File Type: jpg Simplified Menu.jpg (108.3 KB, 118 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #36  
Old 04-27-2009, 09:26 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
I'm really not clear on what you are trying to filter, but if the filtering isn't possible via API calls, then you would have to filter within a loop to get rid of the elements you don't want.

- 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.
Reply With Quote
  #37  
Old 04-27-2009, 09:35 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by Opus4 View Post
I'm really not clear on what you are trying to filter, but if the filtering isn't possible via API calls, then you would have to filter within a loop to get rid of the elements you don't want.

- Andy
I looked at loops but that kept confusing me No surprises there then, No surprises there then, No surprises there then, No surprises there then etc. Sorry bad joke.

What I'm try to do is create a new menu that only displays TV Series, no movies and no single recordings. I'm working on the basis that if a recording has more than one show/episode available then it could be classed as a TV Series.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #38  
Old 04-27-2009, 10:59 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Seems like filtering via API calls ought to be possible, although I don't have a code example handy to illustrate. You'd need to apply the filtering after you've done the grouping, using a method that tests the size of the group and excludes groups with size == 1. But I'm not super-familiar with exactly how FilterByMethod() works on Maps, so it would probably take some trial and error to figure that out.

By the way, why are you using GroupByArrayMethod() instead of plain old GroupByMethod()? GroupByArrayMethod() is for grouping on multiple keys, which is overkill for what you're trying to do (i.e. group by title). Plus GetShowTitle() doesn't return an array or list, as called for in the GroupByArrayMethod() docs, so I'm not sure it would even work with GroupByArrayMethod().
__________________
-- Greg
Reply With Quote
  #39  
Old 04-27-2009, 11:43 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by GKusnick View Post
Seems like filtering via API calls ought to be possible, although I don't have a code example handy to illustrate. You'd need to apply the filtering after you've done the grouping, using a method that tests the size of the group and excludes groups with size == 1. But I'm not super-familiar with exactly how FilterByMethod() works on Maps, so it would probably take some trial and error to figure that out.
Thats what I've been trying to do ( size == 1 ) but I placed that in an attribute widget. I'll play with this some more if you think its the right way to go but not in an attribute widget

Quote:
Originally Posted by GKusnick View Post
By the way, why are you using GroupByArrayMethod() instead of plain old GroupByMethod()? GroupByArrayMethod() is for grouping on multiple keys, which is overkill for what you're trying to do (i.e. group by title). Plus GetShowTitle() doesn't return an array or list, as called for in the GroupByArrayMethod() docs, so I'm not sure it would even work with GroupByArrayMethod().
I used GroupByArrayMethod() as that was the example I found in the SageMC code, but due to my inexpirence I guess I got it wrong. I'll change it over to GroupByMethod(). It does work as far as I can see (see previous sceenshots), maybe it works for now but later on in the development of the import it'll stop working when I start adding other code we'll see. The real time debug log thingy doesn't show any errors so I'm hopefull its working ok.
Anyway size == 1 has given me some ideas to work on
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #40  
Old 04-27-2009, 01:38 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Ok so this is really confusing me

If I place a Size >=2 inbetween an Airing attribute and the actual filtering code to take out all groups which hold 1 or less recordings it will only work on the grouped result as a whole and not the individual cells.

I can test this by changing the Size >= 2 to Size >=100 so nothing will appear on the screen as I dont have more than 100 TV series to group. Reduce it to >= 10 and they all appear again because I have more than 10 TV series to group.

So thinking logically I need to filter whats inside those cells and not the group as a whole. How can I filter whats already been shown on screen via the table? I've added the Size >=2 to the table but it still works on the same princple and displays everything.

I've attached another screenshot of the latest code.

I also assume I can use >= 2 as it works when I change the value manually.
Attached Images
File Type: jpg Simplified Menu 1.jpg (189.5 KB, 129 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
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
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


All times are GMT -6. The time now is 04:25 AM.


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