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
  #1  
Old 02-14-2009, 09:56 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
My import conflicts with another - help!

I created an import that adds a BeforeMenuLoad hook with some custom code to one of the existing menus. I found that another import also adds a BeforeMenuLoad hook to this menu with its own custom code. The problem is if I install both imports, I end up with two BeforeMenuLoad hooks in the same menu and only the first one gets executed. I think it would be OK if I could somehow merge the two hooks.

I am creating my import using the STVi generation tool built-in to Studio. Does anyone know how I can resolve this conflict?
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #2  
Old 02-14-2009, 10:12 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
This is a known drawback with the built-in STVI generator, which simply re-creates all the widgets you created, including any Hook widgets. It's not smart about noticing that two STVIs have created the same hook. (There's a similar issue with the Global Theme widget.)

Before the built-in generator existed, I wrote an STVI generator that's smarter about shared hooks, but it's not quite as automatic as the built-in tool. You can find it in my Studio Tools package. Note, though, that this won't help with conflicts generated by STVIs imported after yours unless they too use my generator.
__________________
-- Greg
Reply With Quote
  #3  
Old 02-14-2009, 10:16 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I suppose another option, now that I think about it, would be to write a post-processor that walks the widget tree looking for duplicate hooks and merging them. You'd have to manually insert a call to this post-processor into your STVI after generating it. To my knowledge, however, nobody has yet written such a post-processor.
__________________
-- Greg
Reply With Quote
  #4  
Old 02-16-2009, 05:17 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
I came up with my own work-around. In case anyone is interested, here is what I did.
We will call the Import I wrote "Import A" and the import I am having conflicts with "Import B".

Step 1, I created an STV by importing Import B into the Stock STV and saved it.
Step 2, I imported Import B into the STV I was using as my development platform.
Step 3, I corrected the conflict in my development STV.
Step 4, I used the Studio tool to find differences and create STVi by comparing my development STV to the STV created in Step 1 (instead of comparing to the Stock STV).

I then tested my import code on both the stock STV and on an STV that had Import B loaded into it, and it worked correctly in both cases.
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #5  
Old 02-16-2009, 10:43 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Because I'm not using the automatic STVi generation, I could have "Import B" check to see if "Import A" has already been imported and link appropriately. It would mean that if "Import A" was going to be imported, it would have to be imported before "Import B", instead of after, like it currently is.

On a side note, maybe we need to create a thread listing the required order of installation of imports. I don't know of any imports that have dependencies on other imports, but there seems to be a few that require others to be imported either before or after them.

John
Reply With Quote
  #6  
Old 02-17-2009, 09:13 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by Tiki View Post
I then tested my import code on both the stock STV and on an STV that had Import B loaded into it, and it worked correctly in both cases.
I'm skeptical of this. I did a similar experiment just now, creating two simple STVIs that add BeforeMenuLoad hooks to an existing menu. My method was as follows:

1. Import B into the stock STV and let it create its hook. Call the result Stock+B.
2. Import A on top of that and let it create a duplicate hook. Call the result Stock+B+A.
3. Move the code from under A's hook to B's hook and delete A's hook. Call this Stock+B+A'.
4. Compare Stock+B+A' to Stock+B to generate A'.stvi.
5. Import A'.stvi into Stock+B. It works, as expected.
6. Import A'.stvi into straight Stock. It does not work (nor would I expect it to). The hook does not get created, and A's code that should have gone under the hook is simply left to dangle.

So unless I'm misunderstanding your method, you might want to double-check your results to make sure it's really doing what you think it's doing.
__________________
-- Greg
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
STV Import: MovieTimes Movie Listings Import v0.57 Beta aperry SageTV Customizations 670 10-02-2010 12:07 AM
STV Import: SageMC Enhancements (incuding Import Folder Fix in 6.2.x) twieder SageMC Custom Interface 59 05-06-2008 01:42 PM
STV Import: Multispeed Continuous FF/REW Import for SageMC MeInMaui SageMC Custom Interface 20 12-16-2007 04:27 AM
conflicts in v2 samson SageTV Beta Test Software 6 03-13-2004 11:38 AM


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


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