diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 422010f..568f295 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -303,7 +303,11 @@ class File(models.Model): return None def get_folder(self): + instance = self.get_instance() + if instance: + return instance.folder name = os.path.splitext(self.get_name())[0] + name = name.replace('. ', '||').split('.')[0].replace('||', '. ') if self.item: if settings.USE_IMDB: director = self.item.get('director', ['Unknown Director']) @@ -321,16 +325,13 @@ class File(models.Model): def get_name(self): instance = self.get_instance() if instance: - return self.get_instance().name + return instance.name if self.item: name = self.item.get('title', 'Untitled') name = re.sub(r'[:\\/]', '_', name) if not name: name = 'Untitled' - if self.instances.count() > 0: - ext = os.path.splitext(self.instances.all()[0].name)[-1] - else: - ext = '.unknown' + ext = '.unknown' return name + ext class Volume(models.Model): diff --git a/pandora/settings.py b/pandora/settings.py index 60d9d00..e92ca72 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -87,6 +87,11 @@ STATIC_URL = '/static/' # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/admin/media/' + +#max upload size, +#needs to be in line with setting in nginx/apache +FILE_UPLOAD_MAX_MEMORY_SIZE=32*1024*1024 + # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader',