Kodi Community Forum
[Closed] TvTunes Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [Closed] TvTunes Addon (/showthread.php?tid=83925)



RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - meridius - 2013-09-11

Hi mate not on the computer at the moment but had a quick go and found out somthing

i think you could recreate it.

this is how you might not be seeing the problem as i could not recreate it to as i could not understand why untill i played a littile.

set loop playback to OFF
Quit xbmc and reload it
the problem is not there as i tried this it will only play the theme once which it should. if you then change the loop playback to On but do not quit xbmc it now plays the theme looped which it should but if you then set the loop playback to OFF and dont reset xbmc it still repeats the theme a couple of times. but when you quit xbmc and reload it the themes playback once.

it has somthing to do with the changing settings it screws it up a littile thats untill you leave the setting on the one you want and quit xbmc and reload it and what ever option you have works

hope this helps if not i can stil send a debug log


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - ronie - 2013-09-11

(2013-09-11, 21:11)meridius Wrote: hope this helps if not i can stil send a debug log

nope, still can't reproduce it.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - robwebset - 2013-09-12

Hi Ronie,

First off I would like to thank you for the TvTunes addon - it certainly adds something to XBMC.

I was messing about with it a little and noticed that if you were browsing TV Series, having a look at the information for each (i.e. loading up the info screen from the TV Series list) then there was no theme music played in the backgroud as you read details about the TV show, cast etc.

I hope you don't mind, but I have done a bit of investigation and think I may have the changes that will allow this to be implemented.

The changes are highlighted as follows (from tvtunes_backend.py)

Quote: def run( self ):
try:
isStartedDueToInfoScreen = False
while not self._stop: # the code
if not xbmc.getCondVisibility( "Window.IsVisible(10025)"): self.stop() #destroy threading

if xbmc.getCondVisibility( "Window.IsVisible(12003)") and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
isStartedDueToInfoScreen = True


if isStartedDueToInfoScreen or xbmc.getCondVisibility( "Container.Content(Seasons)" ) or xbmc.getCondVisibility( "Container.Content(Episodes)" ) and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
if self.enable_custom_path == "true":
tvshow = xbmc.getInfoLabel( "ListItem.TVShowTitle" ).replace(":","")
tvshow = normalize_string( tvshow )
self.newpath = os.path.join(self.custom_path, tvshow).decode("utf-8")
elif xbmc.getCondVisibility( "Window.IsVisible(12003)") and xbmc.getInfoLabel( "container.folderpath" ) == "videodb://2/2/":
self.newpath = xbmc.getInfoLabel( "ListItem.FilenameAndPath" )

else:
self.newpath = xbmc.getInfoLabel( "ListItem.Path" )
if not self.newpath == self.oldpath and not self.newpath == "" and not self.newpath == "videodb://2/2/":
log( "### old path: %s" % self.oldpath )
log( "### new path: %s" % self.newpath )
self.oldpath = self.newpath
if not xbmc.Player().isPlaying() : self.start_playing()
else: log( "### player already playing" )

if xbmc.getInfoLabel( "Window(10025).Property(TvTunesIsAlive)" ) == "true" and not xbmc.Player().isPlaying():
log( "### playing ends" )
if self.loud: self.raise_volume()
xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')

if (xbmc.getCondVisibility( "Container.Content(tvshows)" ) or xbmc.getCondVisibility( "Container.Content(movies)" ) ) and self.playpath and not xbmc.getCondVisibility( "Window.IsVisible(12003)" ):
isStartedDueToInfoScreen = False
log( "### reinit condition" )
self.newpath = ""
self.oldpath = ""
self.playpath = ""
log( "### stop playing" )
if __addon__.getSetting("fade") == 'true':
self.fade_out()
else:
xbmc.Player().stop()
if self.loud: self.raise_volume()
xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')

The other advantage of this change is that it will supply one of the other features that I spotted was requested by a few people earlier in the thread - it will also play a theme if looking at info for a Movie (as long as they have manually added a theme.mp3 file there).

What do you think - is this something you would be willing to add to the addon?

Thanks

Rob
P.S. I can send you a copy of the file if that is easier (I couldn't find a way to have code formatting and highlighting together)


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - capfuturo - 2013-09-12

2 Thumbs up for this!!!!!
I totally support this patch from rob_webset. It is smart and would keep things consistent: themes for TV shows and movies handled by one add-on. Hope Ronie finds a positive gain from it.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - Deano316 - 2013-09-12

You got my vote Cool

Great work rob_webset. I couldn't be without movie tunes now, but I have to admit that everything may work smoother if the tunes are handled by a separate add-on. Full support given Wink Hope Ronie is ok with it being added.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - ronie - 2013-09-12

(2013-09-12, 16:50)rob_webset Wrote: Hi Ronie,

First off I would like to thank you for the TvTunes addon

don't thank me.. i didn't create this addon.
i'm merely maintaining it.. fixing the odd bug every once in a while.

as for adding new features, i don't feel i'm the one to ask.
personally, i'm not using tvtunes at all, so can't decide which functionality would be useful or not.


i've probably mentioned it before (a long time ago), but the offer still stands...
if anyone is willing to maintain the addon from now on, i'm all for it.
i'm sure it'll be in better hands with someone who's interested, unlike me, in adding new features.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - Rich.T. - 2013-09-12

(2013-09-12, 21:12)ronie Wrote:
(2013-09-12, 16:50)rob_webset Wrote: Hi Ronie,

First off I would like to thank you for the TvTunes addon

don't thank me.. i didn't create this addon.
i'm merely maintaining it.. fixing the odd bug every once in a while.

as for adding new features, i don't feel i'm the one to ask.
personally, i'm not using tvtunes at all, so can't decide which functionality would be useful or not.


i've probably mentioned it before (a long time ago), but the offer still stands...
if anyone is willing to maintain the addon from now on, i'm all for it.
i'm sure it'll be in better hands with someone who's interested, unlike me, in adding new features.

I just came over to chime in with another +1 for the feature suggestion when I saw your post.

Firstly; well done and thank you and for devoting some of your precious time to monitoring and maintaining this project, I'm sure that it is appreciated by everyone who has had cause to come here looking for support.

Secondly; who might be the one to ask about adding new features?

I'm pretty sure that rob_webset is already coming to terms with the idea of taking a leading role in the development of another, already existing project and all that entails. Can you give us any positive suggestions as to how we might might proceed in our efforts? I know it's an imposition, but if you could have a quick read through of this thread and comment back, it would be very much appreciated.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - ronie - 2013-09-12

(2013-09-12, 21:35)Rich.T. Wrote: Secondly; who might be the one to ask about adding new features?
ask the future maintainer (whoever that may be) of the addon ;-)
preferably someone with a bit of python skills and who's actually using tvtunes.
(2013-09-12, 21:35)Rich.T. Wrote: I'm pretty sure that rob_webset is already coming to terms with the idea of taking a leading role in the development of another, already existing project and all that entails. Can you give us any positive suggestions as to how we might might proceed in our efforts? I know it's an imposition, but if you could have a quick read through of this thread and comment back, it would be very much appreciated.

heh..only a 21 pages discussion?
think i'll pass ;-)


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - robwebset - 2013-09-13

I was on the way back from the pub when I remembered I forgot to post details of the changes needed to: DialogVideoInfo.xml

You will need to add the following to the top window section to get the theme to fire (If you don't add it then the code already added will not cause any problems - it just will not start the theme playing!)

Code:
<onload condition="Skin.HasSetting(ActivateTvTunes) + System.HasAddon(script.tvtunes)">XBMC.RunScript(script.tvtunes,backend=True&amp;loop=False)</onload>

Hi Ronie, thanks for your comments.

I notice that the addon is currently in your subversion repository - would you require some-one to move it to a different repository or are you willing to let some-one else commit to this section? I'm happy to make the change, and maybe capfuturo, Deano316 and Rich.T. would be kind enough to perform a verification exercise that it is still working and they are also happy with everything? (Or if you would rather apply the patch as it is in your repository - then I'm sure we could all verify the change?)

Please can you let me know how you feel it best to preceed.

Thanks

Rob


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - Legion455 - 2013-09-13

This is really a nice addition,... playing the theme from the Movie/TV Index!!! thanks again!

I just tried to make the necessary edits to the py file,... and the other addition to DialogVideoInfo,... and am getting a script failed message. Sad (on both TV and Movie indexes)

I'll double check what I changed,... probably a mis-edit on my part.

thanks again for working on this!
Legion


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - nickr - 2013-09-13

(2013-09-12, 16:50)rob_webset Wrote: Hi Ronie,

First off I would like to thank you for the TvTunes addon - it certainly adds something to XBMC.

I was messing about with it a little and noticed that if you were browsing TV Series, having a look at the information for each (i.e. loading up the info screen from the TV Series list) then there was no theme music played in the backgroud as you read details about the TV show, cast etc.

I hope you don't mind, but I have done a bit of investigation and think I may have the changes that will allow this to be implemented.

The changes are highlighted as follows (from tvtunes_backend.py)

Quote: def run( self ):
try:
isStartedDueToInfoScreen = False
while not self._stop: # the code
if not xbmc.getCondVisibility( "Window.IsVisible(10025)"): self.stop() #destroy threading

if xbmc.getCondVisibility( "Window.IsVisible(12003)") and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
isStartedDueToInfoScreen = True


if isStartedDueToInfoScreen or xbmc.getCondVisibility( "Container.Content(Seasons)" ) or xbmc.getCondVisibility( "Container.Content(Episodes)" ) and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
if self.enable_custom_path == "true":
tvshow = xbmc.getInfoLabel( "ListItem.TVShowTitle" ).replace(":","")
tvshow = normalize_string( tvshow )
self.newpath = os.path.join(self.custom_path, tvshow).decode("utf-8")
elif xbmc.getCondVisibility( "Window.IsVisible(12003)") and xbmc.getInfoLabel( "container.folderpath" ) == "videodb://2/2/":
self.newpath = xbmc.getInfoLabel( "ListItem.FilenameAndPath" )

else:
self.newpath = xbmc.getInfoLabel( "ListItem.Path" )
if not self.newpath == self.oldpath and not self.newpath == "" and not self.newpath == "videodb://2/2/":
log( "### old path: %s" % self.oldpath )
log( "### new path: %s" % self.newpath )
self.oldpath = self.newpath
if not xbmc.Player().isPlaying() : self.start_playing()
else: log( "### player already playing" )

if xbmc.getInfoLabel( "Window(10025).Property(TvTunesIsAlive)" ) == "true" and not xbmc.Player().isPlaying():
log( "### playing ends" )
if self.loud: self.raise_volume()
xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')

if (xbmc.getCondVisibility( "Container.Content(tvshows)" ) or xbmc.getCondVisibility( "Container.Content(movies)" ) ) and self.playpath and not xbmc.getCondVisibility( "Window.IsVisible(12003)" ):
isStartedDueToInfoScreen = False
log( "### reinit condition" )
self.newpath = ""
self.oldpath = ""
self.playpath = ""
log( "### stop playing" )
if __addon__.getSetting("fade") == 'true':
self.fade_out()
else:
xbmc.Player().stop()
if self.loud: self.raise_volume()
xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')

The other advantage of this change is that it will supply one of the other features that I spotted was requested by a few people earlier in the thread - it will also play a theme if looking at info for a Movie (as long as they have manually added a theme.mp3 file there).

What do you think - is this something you would be willing to add to the addon?

Thanks

Rob
P.S. I can send you a copy of the file if that is easier (I couldn't find a way to have code formatting and highlighting together)
How about a patch file?


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - Legion455 - 2013-09-13

I couldn't find any errors to my changes in the py file,... so I turned on debug logging,.. and got a "exceptions.indentationerror", "unindent does not match any outer indentation level"

if anyone has any ideas about this,...
thanks
Legion


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - capfuturo - 2013-09-13

Good night Legion455,

Could you please post the full debug reproducing the error?

@rob_webset: Hi Rob, I hope the time at the pub was inspirational! I second nickr proposal for a patch file. That would minimise human errors at trying to manually get the tvtunes_backend.py updated with the changes.


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - Legion455 - 2013-09-13

(2013-09-13, 02:44)capfuturo Wrote: Good night Legion455,

Could you please post the full debug reproducing the error?

Sure thing ... I'm a newb at this , so I might not be posting the debug log correctly,.. all I did was zip it up and uploaded to here:
http://www.treasure-cove.net/tvtunes_errorlog.zip
If I need to do something different, please just lmk, and I'll try and get it right.

Also, I'm running Frodo 12.2, Aeon Nox 4.1.9, .. don't know if this might be the problem, but tvtunes runs on 4.0.9 or 4.1.9, so I 'm assuming the patch update will also run on either revision.

thanks
Legion

PS ... here's my edited py file as well...
http://www.treasure-cove.net/tvtunes_backend.zip


RE: [RELEASE] TvTunes Addon - TV Show Theme Music while browsing - robwebset - 2013-09-13

(2013-09-13, 02:36)Legion455 Wrote: I couldn't find any errors to my changes in the py file,... so I turned on debug logging,.. and got a "exceptions.indentationerror", "unindent does not match any outer indentation level"

if anyone has any ideas about this,...
thanks
Legion

Hi Legion, White space is important in python - so you will need to make sure that it all the indentation is correct.

I did originally create a patch file, but thought that it was hard to read for posting what I had done - infortunately when I posted the section from the file, it removed all whitespace

Patch file/diff:

Code:
*** C:/XBMC/workspace/Stubs/tvtunes_backend-Original.py    Thu Sep 12 14:28:28 2013
--- C:/XBMC/workspace/Stubs/tvtunes_backend.py    Thu Sep 12 15:38:35 2013
***************
*** 54,67 ****
          
      def run( self ):
          try:
              while not self._stop:           # the code
                  if not xbmc.getCondVisibility( "Window.IsVisible(10025)"): self.stop()      #destroy threading
  
!                 if xbmc.getCondVisibility( "Container.Content(Seasons)" ) or xbmc.getCondVisibility( "Container.Content(Episodes)" ) and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
                      if self.enable_custom_path == "true":
                          tvshow = xbmc.getInfoLabel( "ListItem.TVShowTitle" ).replace(":","")
                          tvshow = normalize_string( tvshow )
                          self.newpath = os.path.join(self.custom_path, tvshow).decode("utf-8")
                      else:
                          self.newpath = xbmc.getInfoLabel( "ListItem.Path" )
                      if not self.newpath == self.oldpath and not self.newpath == "" and not self.newpath == "videodb://2/2/":
--- 54,73 ----
          
      def run( self ):
          try:
+             isStartedDueToInfoScreen = False
              while not self._stop:           # the code
                  if not xbmc.getCondVisibility( "Window.IsVisible(10025)"): self.stop()      #destroy threading
+                
+                 if xbmc.getCondVisibility( "Window.IsVisible(12003)") and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
+                     isStartedDueToInfoScreen = True
  
!                 if isStartedDueToInfoScreen or xbmc.getCondVisibility( "Container.Content(Seasons)" ) or xbmc.getCondVisibility( "Container.Content(Episodes)" ) and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
                      if self.enable_custom_path == "true":
                          tvshow = xbmc.getInfoLabel( "ListItem.TVShowTitle" ).replace(":","")
                          tvshow = normalize_string( tvshow )
                          self.newpath = os.path.join(self.custom_path, tvshow).decode("utf-8")
+                     elif xbmc.getCondVisibility( "Window.IsVisible(12003)") and xbmc.getInfoLabel( "container.folderpath" ) == "videodb://2/2/":
+                         self.newpath = xbmc.getInfoLabel( "ListItem.FilenameAndPath" )
                      else:
                          self.newpath = xbmc.getInfoLabel( "ListItem.Path" )
                      if not self.newpath == self.oldpath and not self.newpath == "" and not self.newpath == "videodb://2/2/":
***************
*** 76,82 ****
                      if self.loud: self.raise_volume()
                      xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')
  
!                 if xbmc.getCondVisibility( "Container.Content(tvshows)" ) and self.playpath and not xbmc.getCondVisibility( "Window.IsVisible(12003)" ):
                      log( "### reinit condition" )
                      self.newpath = ""
                      self.oldpath = ""
--- 82,89 ----
                      if self.loud: self.raise_volume()
                      xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')
  
!                 if (xbmc.getCondVisibility( "Container.Content(tvshows)" ) or xbmc.getCondVisibility( "Container.Content(movies)" ) ) and self.playpath and not xbmc.getCondVisibility( "Window.IsVisible(12003)" ): # or (not xbmc.getCondVisibility( "Window.IsVisible(12003)") and self.playpath and isStartedDueToInfoScreen == True):
!                     isStartedDueToInfoScreen = False
                      log( "### reinit condition" )
                      self.newpath = ""
                      self.oldpath = ""