/
default.py
69 lines (62 loc) · 2.2 KB
/
default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# AFL Video Kodi Add-on
# Copyright (C) 2016 Andy Botting
#
# AFL Video is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# AFL Video 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 add-on. If not, see <http://www.gnu.org/licenses/>.
#
import os
import sys
import xbmcaddon
from aussieaddonscommon import utils
# Add our resources/lib to the python path
addon_dir = xbmcaddon.Addon().getAddonInfo('path')
sys.path.insert(0, os.path.join(addon_dir, 'resources', 'lib'))
import index # noqa: E402
import matches # noqa: E402
import ooyalahelper # noqa: E402
import play # noqa: E402
import play_replay # noqa: E402
import rounds # noqa: E402
import teams # noqa: E402
import videos # noqa: E402
# Print our platform/version debugging information
utils.log_kodi_platform_version()
if __name__ == "__main__":
params_str = sys.argv[2]
params = utils.get_url(params_str)
if len(params) == 0:
index.make_list()
elif 'category' in params:
if params['category'] == 'Settings':
xbmcaddon.Addon().openSettings()
elif params['category'] == 'Team Video':
teams.make_list()
elif params['category'] == 'All Match Replays':
index.make_seasons_list()
else:
videos.make_list(params_str)
elif 'season' in params:
rounds.make_rounds(params)
elif 'team' in params:
videos.make_list(params_str)
elif 'round_id' in params:
# Match list for a round
matches.make_list(params)
elif 'title' in params:
play.play(params_str)
elif 'action' in params:
if params['action'] == 'cleartoken':
ooyalahelper.clear_token()
if params['action'] == 'sendreport':
utils.user_report()