~josephjamesmills/+junk/mythtv-scope

« back to all changes in this revision

Viewing changes to unity-scope-mythtv

  • Committer: Thomas Mashos
  • Date: 2012-01-17 00:18:09 UTC
  • Revision ID: thomas@mashos.com-20120117001809-7n1ok05ufl8eac80
Removed some of the leftover youtube stuff
Added some install notes

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
_m = dir(Dee.SequenceModel)
31
31
from gi.repository import Unity
32
32
import mythtvapi
33
 
import preferences
 
33
#import preferences
34
34
import socket
35
35
 
36
36
socket.setdefaulttimeout(5)
47
47
        self.scope.connect ("activate-uri", self.on_activate_uri)
48
48
        self.scope.search_in_global = True
49
49
        self.scope.export()
50
 
        self.preferences = preferences.Preferences()
 
50
#        self.preferences = preferences.Preferences()
51
51
 
52
52
    def on_activate_uri (self, scope, uri):
53
53
        GLib.spawn_command_line_async(uri)
66
66
        results.flush_revision_queue ()
67
67
 
68
68
    def update_results_model(self, search, model):
69
 
        select_rating = int(self.scope.get_filter('rating').props.rating*5)
70
 
        if self.scope.get_filter('order').get_active_option() != None:
71
 
           order_by = self.scope.get_filter('order').get_active_option().props.id
72
 
        else:
73
 
           order_by = 'viewCount'
74
 
        if self.scope.get_filter('time').get_active_option() != None:
75
 
            from_time = self.scope.get_filter('time').get_active_option().props.id
76
 
        else:
77
 
            from_time = 'all_time'
78
 
 
 
69
#        select_rating = int(self.scope.get_filter('rating').props.rating*5)
 
70
#        if self.scope.get_filter('order').get_active_option() != None:
 
71
#           order_by = self.scope.get_filter('order').get_active_option().props.id
 
72
#        else:
 
73
#           order_by = 'viewCount'
 
74
#        if self.scope.get_filter('time').get_active_option() != None:
 
75
#            from_time = self.scope.get_filter('time').get_active_option().props.id
 
76
#        else:
 
77
#            from_time = 'all_time'
 
78
        BACKEND = "http://10.167.16.26:6544" ## TODO TESTING
79
79
 
80
80
        '''
81
81
        Autos,Comedy,Education,Entertainment,Film,Games,Howto,Music,News,
90
90
            categories = []
91
91
        print 'search %s'%search
92
92
        print 'categories %s'%categories
93
 
        print 'Order by %s'%order_by
94
 
        print 'From time %s'%from_time
95
 
        print 'Rating %s'%select_rating
96
 
        self.player = self.preferences.get_active_viewer()
 
93
#        print 'Order by %s'%order_by
 
94
#        print 'From time %s'%from_time
 
95
#        print 'Rating %s'%select_rating
 
96
#        self.player = self.preferences.get_active_viewer()
97
97
        for result in self.mt.search(SEARCHTERM = search, CATEGORY = categories):
98
98
    #       model.append (self.player[2] % result['href'], result['icon'], 0,'text/html', result['title'], result['summary'], result['href'])
99
99
            model.append(BACKEND+"/Content/GetFile?StorageGroup="+result['storagegroup']+"&FileName="+result['filename'], 'firefox', 0,'video', result['title'], result['subtitle'], BACKEND+"/Content/GetFile?StorageGroup="+result['storagegroup']+"&FileName="+result['filename'])