def info(self):
     info = namedtuple('LoadingShowInfo',
                       'id name sort_name network quality')
     if self.show:
         return info(id=self.show.indexerid,
                     name=self.show.name,
                     sort_name=self.show.sort_name,
                     network=self.show.network,
                     quality=self.show.quality)
     return info(id=self.show_name,
                 name=self.show_name,
                 sort_name=sortable_name(self.show_name),
                 network=_('Loading'),
                 quality=0)
Beispiel #2
0
 def info(self):
     info = namedtuple('LoadingShowInfo',
                       'id name sort_name network quality')
     if self.show:
         return info(id=self.show.indexerid,
                     name=self.show.name,
                     sort_name=self.show.sort_name,
                     network=self.show.network,
                     quality=self.show.quality)
     # noinspection PyUnresolvedReferences
     return info(id=self.show_name,
                 name=self.show_name,
                 sort_name=sortable_name(self.show_name),
                 network=_('Loading'),
                 quality=0)
Beispiel #3
0
 def test_sortable_name(self):
     """
     Test that sortable_name returns the correct show name
     """
     cases = [
         # raw_name, SORT_ARTICLE, expected
         ('The Big Bang Theory', False, 'big bang theory'),
         ('A Big World', False, 'big world'),
         ('An Unexpected Journey', False, 'unexpected journey'),
         ('The Big Bang Theory', True, 'the big bang theory'),
         ('A Big World', True, 'a big world'),
         ('An Unexpected Journey', True, 'an unexpected journey'),
     ]
     for raw_name, option, expected in cases:
         sickbeard.SORT_ARTICLE = option
         self.assertEqual(helpers.sortable_name(raw_name), expected)
Beispiel #4
0
 def test_sortable_name(self):
     """
     Test that sortable_name returns the correct show name
     """
     cases = [
         # raw_name, SORT_ARTICLE, expected
         ('The Big Bang Theory', False, 'big bang theory'),
         ('A Big World', False, 'big world'),
         ('An Unexpected Journey', False, 'unexpected journey'),
         ('The Big Bang Theory', True, 'the big bang theory'),
         ('A Big World', True, 'a big world'),
         ('An Unexpected Journey', True, 'an unexpected journey'),
     ]
     for raw_name, option, expected in cases:
         sickbeard.SORT_ARTICLE = option
         self.assertEqual(helpers.sortable_name(raw_name), expected)
Beispiel #5
0
 def info(self):
     info = namedtuple('LoadingShowInfo', 'id name sort_name network quality')
     if self.show:
         return info(id=self.show.indexerid, name=self.show.name, sort_name=self.show.sort_name, network=self.show.network, quality=self.show.quality)
     # noinspection PyUnresolvedReferences
     return info(id=self.show_name, name=self.show_name, sort_name=sortable_name(self.show_name), network=_('Loading'), quality=0)
Beispiel #6
0
 def info(self):
     info = namedtuple('LoadingShowInfo', 'id name sort_name network quality')
     if self.show:
         return info(id=self.show.indexerid, name=self.show.name, sort_name=self.show.sort_name, network=self.show.network, quality=self.show.quality)
     return info(id=self.show_name, name=self.show_name, sort_name=sortable_name(self.show_name), network=_('Loading'), quality=0)