コード例 #1
0
def do_search(section, name):
    plugin.set_content('movies')
    section = Section.find(section)
    sf = container.search_filter(section=section, name=str(name))
    if not make_search(sf):
        notify(lang(40312) % ensure_unicode(name))
    elif plugin.request.arg('new'):
        storage = container.search_storage()
        recent = storage.get('search_recent', [])
        if name in recent:
            recent.remove(name)
        recent.append(name)
        storage['search_recent'] = recent
        count = plugin.get_setting('search-items-count', int)
        if len(recent) > count:
            del recent[:len(recent)-count]
コード例 #2
0
# -*- coding: utf-8 -*-

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'resources', 'lib'))

from mediapoisk.plugin import plugin
from mediapoisk.common import LocalizedError, notify, lang
from xbmcswift2 import xbmcgui

if __name__ == '__main__':
    try:
        import mediapoisk.plugin.main
        import mediapoisk.plugin.contextmenu
        import mediapoisk.plugin.search
        import mediapoisk.plugin.advancedsearch
        plugin.run()
    except LocalizedError as e:
        e.log()
        if e.kwargs.get('dialog'):
            xbmcgui.Dialog().ok(lang(30000), *e.localized.split("|"))
        else:
            notify(e.localized)
        if e.kwargs.get('check_settings'):
            plugin.open_settings()