@@ -0,0 +1,998 @@
+# coding=utf-8%0A%0Afrom subzero.lib.dict import DictProxy%0A%0A%0Aclass SubtitleHistoryItem(object):%0A    title = None%0A    rating_key = None%0A%0A    def __init__(self, title, rating_key):%0A        self.title = title%0A        self.rating_key = str(rating_key)%0A%0A    def __hash__(self):%0A        return hash((self.title, self.rating_key))%0A%0A%0Aclass SubtitleHistory(DictProxy):%0A    store = %22history%22%0A    size = 100%0A%0A    def __init__(self, storage, size=100):%0A        super(SubtitleHistory, self).__init__(storage)%0A        self.size = size%0A%0A    def setup_defaults(self):%0A        return %7B%22history_items%22: %5B%5D%7D%0A%0A    def add(self, title, rating_key):%0A        # create copy%0A        items = self.history_items%5B:%5D%0A        item = SubtitleHistoryItem(title, rating_key)%0A%0A        # remove duplicates%0A        if item in items:%0A            items.remove(item)%0A%0A        # insert item%0A        items.insert(0, item)%0A%0A        # clamp item amount%0A        items = items%5B:self.size%5D%0A%0A        # store items%0A        self.history_items = items%0A

move history dictproxy storage