diff --git a/pandora/api/views.py b/pandora/api/views.py index 89c7d17..e66e641 100644 --- a/pandora/api/views.py +++ b/pandora/api/views.py @@ -37,7 +37,7 @@ def api(request): #FIXME: possible to do this in f #data = json.loads(request.POST['data']) - f = actions.get(function, None) + f = actions.get(function) if f: response = f(request) else: diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 7cd67ea..386f5b4 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -316,7 +316,7 @@ class File(models.Model): director = u'; '.join(director) director = re.sub(r'[:\\/]', '_', director) name = os.path.join(director, name) - year = self.item.get('year', None) + year = self.item.get('year') if year: name += u' (%s)' % year name = os.path.join(name[0].upper(), name) diff --git a/pandora/item/managers.py b/pandora/item/managers.py index 5ed6b0e..267d702 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -26,7 +26,7 @@ def parseCondition(condition): if not k: k = 'all' v = condition['value'] - op = condition.get('operator', None) + op = condition.get('operator') if not op: op = '' if op.startswith('!'): diff --git a/pandora/item/models.py b/pandora/item/models.py index 105ecc4..fd75b7f 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -232,7 +232,7 @@ class Item(models.Model): if self.poster_frame == -1 and self.sort.duration: self.poster_frame = self.sort.duration/2 update_poster = True - if not self.get('runtime', None) and self.sort.duration: + if not self.get('runtime') and self.sort.duration: self.data['runtime'] = self.sort.duration self.update_sort() self.json = self.get_json() @@ -361,7 +361,7 @@ class Item(models.Model): def oxdb_id(self): if not settings.USE_IMDB: return self.itemId - if not self.get('title', None) and not self.get('director', None): + if not self.get('title') and not self.get('director'): return None return utils.oxdb_id(self.get('title', ''), self.get('director', []), str(self.get('year', '')), self.get('season', ''), self.get('episode', ''), @@ -478,22 +478,22 @@ class Item(models.Model): set_value(s, name, value) elif sort_type in ('length', 'integer', 'float'): #can be length of strings or length of arrays, i.e. keywords - value = self.get(source, None) + value = self.get(source) if isinstance(value, list): value = len(value) set_value(s, name, value) elif sort_type == 'words': - value = self.get(source, None) + value = self.get(source) if isinstance(value, list): value = '\n'.join(value) if value: value = len(value.split(' ')) set_value(s, name, value) elif sort_type == 'year': - value = self.get(source, None) + value = self.get(source) set_value(s, name, value) elif sort_type == 'date': - value = self.get(source, None) + value = self.get(source) if isinstance(value, basestring): value = datetime.strptime(value, '%Y-%m-%d') set_value(s, name, value) diff --git a/pandora/item/views.py b/pandora/item/views.py index 66b7962..0b3dc6c 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -528,7 +528,7 @@ def video(request, id, profile): path = stream.video.path content_type = path.endswith('.mp4') and 'video/mp4' or 'video/webm' #server side cutting - t = request.GET.get('t', None) + t = request.GET.get('t') if t: t = map(float, t.split(',')) ext = os.path.splitext(profile)[1] diff --git a/pandora/itemlist/managers.py b/pandora/itemlist/managers.py index 08961be..d1b4c3c 100644 --- a/pandora/itemlist/managers.py +++ b/pandora/itemlist/managers.py @@ -28,7 +28,7 @@ def parseCondition(condition, user): if not k: k = 'name' v = condition['value'] - op = condition.get('operator', None) + op = condition.get('operator') if not op: op = '' if op.startswith('!'): diff --git a/pandora/place/managers.py b/pandora/place/managers.py index 2ee0767..70963a3 100644 --- a/pandora/place/managers.py +++ b/pandora/place/managers.py @@ -23,7 +23,7 @@ def parseCondition(condition, user): if not k: k = 'name' v = condition['value'] - op = condition.get('operator', None) + op = condition.get('operator') if not op: op = '' if op.startswith('!'):