mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2025-01-10 03:00:21 +00:00
fd5b639811
Altspeed: https://github.com/correl/Transmission-XBMC/pull/22 Ended Playback: the addon only detected when used stopped the video player and not when the video ended. Now it can detect when playback ended. Added a delay so if user finishes to watch a video and started a new video a few seconds later the addon would start all torrents then immediately stopped again. Now user can select between 1-60 seconds until execute the action.
31 lines
974 B
Python
31 lines
974 B
Python
# -*- coding: utf-8 -*-
|
|
# Copyright (c) 2013 Artem Glebov
|
|
|
|
import sys
|
|
import transmissionrpc
|
|
|
|
__settings__ = sys.modules[ "__main__" ].__settings__
|
|
|
|
def get_settings():
|
|
params = {
|
|
'address': __settings__.getSetting('rpc_host'),
|
|
'port': __settings__.getSetting('rpc_port'),
|
|
'user': __settings__.getSetting('rpc_user'),
|
|
'password': __settings__.getSetting('rpc_password'),
|
|
'action_on_playback': __settings__.getSetting('action_on_playback'),
|
|
'seconds_playback_finished': __settings__.getSetting('seconds_playback_finished')
|
|
}
|
|
return params
|
|
|
|
def get_params():
|
|
params = {
|
|
'address': __settings__.getSetting('rpc_host'),
|
|
'port': __settings__.getSetting('rpc_port'),
|
|
'user': __settings__.getSetting('rpc_user'),
|
|
'password': __settings__.getSetting('rpc_password'),
|
|
}
|
|
return params
|
|
|
|
def get_rpc_client():
|
|
params = get_params()
|
|
return transmissionrpc.Client(**params)
|