From e7b86872a791b3142435d22dbed86b0d51a487fd Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 13 Jul 2013 10:36:41 +0000 Subject: [PATCH] add option to force loading of subtitles --- pandora/item/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 6b1baa97..508a51f2 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1297,9 +1297,13 @@ class Item(models.Model): pass return icon - def load_subtitles(self): + def load_subtitles(self, force=False): subtitles = utils.get_by_key(settings.CONFIG['layers'], 'isSubtitles', True) - if not settings.USE_IMDB or not subtitles: + if not subtitles: + return + # only import on 0xdb for now or if forced manually + # since this will remove all existing subtitles + if not force or not settings.USE_IMDB: return False with transaction.commit_on_success(): layer = subtitles['id']