From 192e296a509390a931f2aa5cbcfe5181cb53a965 Mon Sep 17 00:00:00 2001
From: Luca <l.dimarino@gmail.com>
Date: Sat, 18 May 2013 11:23:41 +0200
Subject: [PATCH] =?UTF-8?q?PostProcessor=201=C2=B0Try=20to=20get=20rid=20o?=
 =?UTF-8?q?f=20double=20language=20subtitle=20extension?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 sickbeard/postProcessor.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py
index 2a01cc9c5..58cc2e7fc 100644
--- a/sickbeard/postProcessor.py
+++ b/sickbeard/postProcessor.py
@@ -253,11 +253,13 @@ class PostProcessor(object):
             cur_file_name = ek.ek(os.path.basename, cur_file_path)
             
             # get the extension
-            cur_extension = cur_file_path.rpartition('.')[-1]
+#            cur_extension = cur_file_path.rpartition('.')[-1]
+            cur_extension = ek.ek(os.path.splitext, cur_file_path)[1][1:]
             
-            # check if file have language of subtitles
+            # check if file have subtitles language
             if cur_extension in common.subtitleExtensions:
-                cur_lang = cur_file_path.rpartition('.')[0].rpartition('.')[-1]
+#                cur_lang = cur_file_path.rpartition('.')[0].rpartition('.')[-1]
+                cur_lang = ek.ek(os.path.splitext, ek.ek(os.path.splitext, cur_file_path)[0])[1][1:]
                 if cur_lang in sickbeard.SUBTITLES_LANGUAGES:
                     cur_extension = cur_lang + '.' + cur_extension
         
-- 
GitLab