This repository has been archived by the owner on May 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdefault.py
122 lines (100 loc) · 4.32 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# -*- coding: utf-8 -*-
#
import os
import xbmcgui,xbmcaddon,xbmc
from utilities import *
from sync_update import *
from watchlist import *
from recommend import *
from friends import *
from trending import *
__author__ = "Ralph-Gordon Paul, Adrian Cowan"
__credits__ = ["Ralph-Gordon Paul", "Justin Nemeth", "Sean Rudford"]
__license__ = "GPL"
__maintainer__ = "Ralph-Gordon Paul"
__email__ = "[email protected]"
__status__ = "Production"
#read settings
__settings__ = xbmcaddon.Addon( "script.traktutilities" )
__language__ = __settings__.getLocalizedString
Debug("default: " + __settings__.getAddonInfo("id") + " - version: " + __settings__.getAddonInfo("version"))
# Usermenu:
def menu():
# check if needed settings are set
if checkSettings() == False:
return
options = [__language__(1210).encode( "utf-8", "ignore" ), __language__(1211).encode( "utf-8", "ignore" ), __language__(1212).encode( "utf-8", "ignore" ), __language__(1213).encode( "utf-8", "ignore" ), __language__(1214).encode( "utf-8", "ignore" )]
while True:
select = xbmcgui.Dialog().select("Trakt Utilities", options)
Debug("Select: " + str(select))
if select == -1:
Debug ("menu quit by user")
return
else:
if select == 0: # Watchlist
submenuWatchlist()
elif select == 1: # Friends
showFriends()
elif select == 2: # Recommendations
submenuRecommendations()
elif select == 3: # Trending Movies / TV Shows
submenuTrendingMoviesTVShows()
elif select == 4: # Update / Sync / Clean
submenuUpdateSyncClean()
def submenuUpdateSyncClean():
options = [__language__(1217).encode( "utf-8", "ignore" ), __language__(1218).encode( "utf-8", "ignore" ), __language__(1219).encode( "utf-8", "ignore" ), __language__(1220).encode( "utf-8", "ignore" ), __language__(1221).encode( "utf-8", "ignore" ), __language__(1222).encode( "utf-8", "ignore" )]
while True:
select = xbmcgui.Dialog().select("Trakt Utilities", options)
Debug("Select: " + str(select))
if select == -1:
Debug ("menu quit by user")
return
elif select == 0: # Update Movie Collection
updateMovieCollection()
elif select == 1: # Sync seen Movies
syncSeenMovies()
elif select == 2: # Update TV Show Collection
updateTVShowCollection()
elif select == 3: # Sync seen TV Shows
syncSeenTVShows()
elif select == 4: # Clean Movie Collection
cleanMovieCollection()
elif select == 5: # Clean TV Show Collection
cleanTVShowCollection()
def submenuTrendingMoviesTVShows():
options = [__language__(1250).encode( "utf-8", "ignore" ), __language__(1251).encode( "utf-8", "ignore" )]
while True:
select = xbmcgui.Dialog().select(__language__(1213).encode( "utf-8", "ignore" ), options)
Debug("Select: " + str(select))
if select == -1:
Debug ("menu quit by user")
return
if select == 0: # Trending Movies
showTrendingMovies()
elif select == 1: # Trending TV Shows
showTrendingTVShows()
def submenuWatchlist():
options = [__language__(1252).encode( "utf-8", "ignore" ), __language__(1253).encode( "utf-8", "ignore" )]
while True:
select = xbmcgui.Dialog().select(__language__(1210).encode( "utf-8", "ignore" ), options)
Debug("Select: " + str(select))
if select == -1:
Debug ("menu quit by user")
return
if select == 0: # Watchlist Movies
showWatchlistMovies()
elif select == 1: # Watchlist TV Shows
showWatchlistTVShows()
def submenuRecommendations():
options = [__language__(1255).encode( "utf-8", "ignore" ), __language__(1256).encode( "utf-8", "ignore" )]
while True:
select = xbmcgui.Dialog().select(__language__(1212).encode( "utf-8", "ignore" ), options)
Debug("Select: " + str(select))
if select == -1:
Debug ("menu quit by user")
return
if select == 0: # Watchlist Movies
showRecommendedMovies()
elif select == 1: # Watchlist TV Shows
showRecommendedTVShows()
menu()