Пример #1
0
def run(params):
    from resources.lib.modules import control

    params = params or {}

    control.log('[BRplay] - PARAMS: %s' % params)

    # Parameters
    action = params.get('action')

    meta = params.get('meta')

    try:
        meta_json = json.loads(meta) if meta else None
    except:
        control.log(traceback.format_exc(), control.LOGERROR)
        meta_json = {}

    # Actions
    if not action:
        from resources.lib.indexers import navigator, indexer
        syshandle = int(sys.argv[1])
        indexer.create_directory(navigator.root(), cache_to_disk=False)
        control.category(handle=syshandle, category=control.addonInfo('name'))

    elif action == 'settings':
        from resources.lib.indexers import navigator
        navigator.open_settings()

    elif action == 'clear':
        from resources.lib.indexers import navigator
        navigator.clear_cache()

    elif action == 'clearAuth':
        from resources.lib.indexers import navigator
        navigator.clear_credentials()

    elif action == 'refresh':
        from resources.lib.modules import control
        control.refresh()

    # Generic Tree

    elif action == 'generic':
        from resources.lib.indexers import indexer
        indexer.handle_route(meta_json)
Пример #2
0
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 2 of the License, or
        (at your option) any later version.
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import action, url, query

if action is None:
    from resources.lib.indexers import navigator
    navigator.root()

elif action == 'play':
    from resources.lib.modules import player
    player.play(url)

elif action == 'add':
    from resources.lib.modules import tools
    tools.add_to_history()

elif action == 'readme':
    from resources.lib.modules import tools
    tools.readme()

elif action == 'refresh':
    from resources.lib.modules import tools