示例#1
0
 def setup_tracker(self):
     query = itemtrack.DeviceItemTrackerQuery()
     query.add_condition('file_type', '=', u'audio')
     query.set_order_by(['filename'])
     item_source = item.DeviceItemSource(self.device)
     self.tracker = itemtrack.ItemTracker(self.idle_scheduler, query,
                                          item_source)
示例#2
0
 def setup_tracker(self):
     # Set up our item tracker
     query = itemtrack.SharingItemTrackerQuery()
     query.add_condition('file_type', '=', u'audio')
     query.set_order_by(['title'])
     item_source = item.SharingItemSource(self.share.info)
     self.tracker = itemtrack.ItemTracker(self.idle_scheduler, query,
                                          item_source)
示例#3
0
 def _recently_played_tracker(self, file_type):
     query = itemtrack.ItemTrackerQuery()
     query.add_condition('file_type', '=', file_type)
     query.add_condition('watched_time', 'IS NOT', None)
     query.set_order_by(['-last_watched'])
     query.set_limit(self.ITEM_LIMIT)
     return itemtrack.ItemTracker(call_on_ui_thread, query,
                                  item.ItemSource())
示例#4
0
 def _recently_downloaded_tracker(self):
     query = itemtrack.ItemTrackerQuery()
     query.add_condition('downloaded_time', 'IS NOT', None)
     query.add_condition('expired', '=', False)
     query.add_condition('parent_id', 'IS', None)
     query.add_condition('watched_time', 'IS', None)
     query.set_order_by(['-downloaded_time'])
     query.set_limit(self.ITEM_LIMIT)
     return itemtrack.ItemTracker(call_on_ui_thread, query,
                                  item.ItemSource())
示例#5
0
 def make_tracker(self):
     query = itemtrack.ItemTrackerQuery()
     query.add_condition('feed_id', '=', self.feed.id)
     query.set_order_by(['release_date'])
     item_tracker = itemtrack.ItemTracker(self.idle_scheduler, query,
                                          item.ItemSource())
     self.list_changed_callback = mock.Mock()
     self.items_changed_callback = mock.Mock()
     item_tracker.connect('list-changed', self.list_changed_callback)
     item_tracker.connect('items-changed', self.items_changed_callback)
     return item_tracker
示例#6
0
 def setup_tracker(self):
     query = itemtrack.ItemTrackerQuery()
     query.add_condition('feed_id', '=', self.tracked_feed.id)
     query.set_order_by(['release_date'])
     self.tracker = itemtrack.ItemTracker(self.idle_scheduler, query,
                                          item.ItemSource())