Subliminal update

This commit is contained in:
Ruud
2012-01-06 20:33:43 +01:00
parent f7d72dd5a9
commit d08d519ff2
15 changed files with 224 additions and 135 deletions
+5 -5
View File
@@ -27,7 +27,7 @@ from exceptions import InvalidLanguageError, PluginError, BadStateError, \
WrongTaskError, DownloadFailedError
from itertools import groupby
from languages import list_languages
from subliminal.utils import NullHandler
from utils import NullHandler
from tasks import Task, DownloadTask, ListTask, StopTask
import Queue
import guessit
@@ -216,16 +216,16 @@ class Subliminal(object):
key = ''
for sort_item in order:
if sort_item == LANGUAGE_INDEX:
key += '{:03d}'.format(len(self._languages) - self._languages.index(subtitle.language) - 1)
key += '{0:03d}'.format(len(self._languages) - self._languages.index(subtitle.language) - 1)
elif sort_item == PLUGIN_INDEX:
key += '{:02d}'.format(len(self._plugins) - self._plugins.index(subtitle.plugin) - 1)
key += '{0:02d}'.format(len(self._plugins) - self._plugins.index(subtitle.plugin) - 1)
elif sort_item == PLUGIN_CONFIDENCE:
key += '{:04d}'.format(int(subtitle.confidence * 1000))
key += '{0:04d}'.format(int(subtitle.confidence * 1000))
elif sort_item == MATCHING_CONFIDENCE:
confidence = 0
if subtitle.release:
confidence = matching_confidence(video, subtitle)
key += '{:04d}'.format(int(confidence * 1000))
key += '{0:04d}'.format(int(confidence * 1000))
return int(key)
def groupByVideo(self, list_result):