diff -Nru unity-scope-mythtv-2.2/debian/bzr-builder.manifest unity-scope-mythtv-2.4/debian/bzr-builder.manifest --- unity-scope-mythtv-2.2/debian/bzr-builder.manifest 2013-03-08 03:14:45.000000000 +0000 +++ unity-scope-mythtv-2.4/debian/bzr-builder.manifest 2013-03-21 04:57:50.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~92 -lp:~mythbuntu/mythbuntu/unity-scope-mythtv revid:thomas@mashos.com-20130308024717-7qs642i5gs6aq1mz +# bzr-builder format 0.3 deb-version {debupstream}-0~94 +lp:~mythbuntu/mythbuntu/unity-scope-mythtv revid:thomas@mashos.com-20130321034507-cle6mozqbyfeo2wc diff -Nru unity-scope-mythtv-2.2/debian/changelog unity-scope-mythtv-2.4/debian/changelog --- unity-scope-mythtv-2.2/debian/changelog 2013-03-08 03:14:45.000000000 +0000 +++ unity-scope-mythtv-2.4/debian/changelog 2013-03-21 04:57:50.000000000 +0000 @@ -1,10 +1,18 @@ -unity-scope-mythtv (2.2-0~92~precise1) precise; urgency=low +unity-scope-mythtv (2.4-0~94~precise1) precise; urgency=low * Auto build. - -- Launchpad Package Builder Fri, 08 Mar 2013 03:14:45 +0000 + -- Launchpad Package Builder Thu, 21 Mar 2013 04:57:50 +0000 -unity-scope-mythtv (2.2) quantal; urgency=low +unity-scope-mythtv (2.4) raring; urgency=low + + * Added start playback on detected mythtv frontends + * Fixed build dependency issues + * Web trailer now looks for HD version first, falls back to SD version + + -- Thomas Mashos Sun, 17 Mar 2013 16:14:37 -0700 + +unity-scope-mythtv (2.3) quantal; urgency=low * Added delete function for recordings * Added notifications diff -Nru unity-scope-mythtv-2.2/debian/control unity-scope-mythtv-2.4/debian/control --- unity-scope-mythtv-2.2/debian/control 2013-03-08 03:14:45.000000000 +0000 +++ unity-scope-mythtv-2.4/debian/control 2013-03-21 04:57:50.000000000 +0000 @@ -2,7 +2,7 @@ Section: gnome Priority: optional Maintainer: Thomas Mashos -Build-Depends: debhelper (>= 8), python3, python3-distutils-extra +Build-Depends: debhelper (>= 8), python3-all, python3-distutils-extra, python-distutils-extra Standards-Version: 3.9.3 Homepage: http://www.mythbuntu.org Vcs-Bzr: https://code.launchpad.net/~mythbuntu/mythbuntu/unity-scope-mythtv @@ -10,7 +10,7 @@ Package: unity-scope-mythtv Architecture: all Depends: ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, unity-lens-video, python3, python3-mythtvservices diff -Nru unity-scope-mythtv-2.2/src/search.py unity-scope-mythtv-2.4/src/search.py --- unity-scope-mythtv-2.2/src/search.py 2013-03-08 03:14:45.000000000 +0000 +++ unity-scope-mythtv-2.4/src/search.py 2013-03-21 04:57:50.000000000 +0000 @@ -33,9 +33,13 @@ def update_all(self): RECORDINGS = mythtvservices.Dvr().GetRecordedList(DESCENDING='true') VIDEOS = mythtvservices.Video().GetVideoList() + self.FELIST = mythtvservices.Connection().locateFE() self.lastupdated = time() return RECORDINGS, VIDEOS + def get_FE_List(self): + return self.FELIST + def search(self, SEARCHTERM=None): FILTEREDLIST=[] try: @@ -92,14 +96,18 @@ RESPONSE = self.querythemoviedb(url) - source=RESPONSE['youtube'][0]['source'] - - if RESPONSE['youtube'][0]['size'] == 'HD': - HD = '&hd=1' - else: - HD = '' - - LINK = 'http://www.youtube.com/watch?v=%s%s' % (source, HD) + LINK = '' + + for s in RESPONSE['youtube']: + if s['size'] == 'HD': + LINK = 'http://www.youtube.com/watch?v=%s&hd=1' % s['source'] + break + + if LINK == '': + for s in RESPONSE['youtube']: + LINK = 'http://www.youtube.com/watch?v=%s' % s['source'] + break + return LINK def getRating(self, INETREF): @@ -114,4 +122,5 @@ results = mt.search('Parks') for l in results: print(l['Title'], l['SubTitle']) + print(mt.get_FE_List()) exit(0) diff -Nru unity-scope-mythtv-2.2/src/unity-scope-mythtv unity-scope-mythtv-2.4/src/unity-scope-mythtv --- unity-scope-mythtv-2.2/src/unity-scope-mythtv 2013-03-08 03:14:45.000000000 +0000 +++ unity-scope-mythtv-2.4/src/unity-scope-mythtv 2013-03-21 04:57:50.000000000 +0000 @@ -255,6 +255,14 @@ rating=(round(vote_average/2)/10.0)*2 preview.set_rating(rating, vote_count) + self.FELIST = self.mt.get_FE_List() + fenum = 0 + while fenum < len(self.FELIST) and fenum < 4: + play_frontend = Unity.PreviewAction.new("Play on %s" % self.FELIST[fenum][0], _("Play on %s" % self.FELIST[fenum][0]), None) + fenum += 1 + play_frontend.connect('activated', getattr(self, "play_on_frontend%s" % fenum)) + preview.add_action(play_frontend) + if "Tagline" in details: tagline = details["Tagline"] if tagline: @@ -331,6 +339,45 @@ """Preview request - Play action handler""" return self.on_uri_activated (action, uri) + def play_on_frontend (self, FRONTENDINFO, uri): + """Preview request - Play action handler""" + URI, MIMETYPE, ID, STARTTIME, TYPE, INETREF = uri.split('lens-meta://') + FRONTENDNAME = FRONTENDINFO[0] + FRONTENDLOCATION = FRONTENDINFO[1] + if TYPE == 'RECORDING': + RESULT = mythtvservices.Frontend().PlayRecording(FRONTENDLOCATION, ID, STARTTIME) + else: + RESULT = mythtvservices.Frontend().PlayVideo(FRONTENDLOCATION, ID) + + print(RESULT) + + if RESULT['bool'] == 'true': + self.notification("Starting playback on %s" % FRONTENDNAME) + else: + self.notification("Error: Cannot start playback on %s" % FRONTENDNAME) + return Unity.ActivationResponse (handled = Unity.HandledType.HIDE_DASH, goto_uri = '') + + def play_on_frontend1 (self, action, uri): + """Preview request - Play action handler""" + FRONTENDINFO = self.FELIST[0] + self.play_on_frontend(FRONTENDINFO, uri) + return Unity.ActivationResponse (handled = Unity.HandledType.HIDE_DASH, goto_uri = '') + + def play_on_frontend2 (self, action, uri): + """Preview request - Play action handler""" + FRONTENDINFO = self.FELIST[1] + self.play_on_frontend(FRONTENDINFO, uri) + + def play_on_frontend3 (self, action, uri): + """Preview request - Play action handler""" + FRONTENDINFO = self.FELIST[2] + self.play_on_frontend(FRONTENDINFO, uri) + + def play_on_frontend4 (self, action, uri): + """Preview request - Play action handler""" + FRONTENDINFO = self.FELIST[3] + self.play_on_frontend(FRONTENDINFO, uri) + def play_web_trailer (self, action, uri): """Preview request - Play action handler""" URI, MIMETYPE, CHANID, STARTTIME, MEDIATYPE, INETREF = uri.split('lens-meta://')