@@ -205,57 +205,52 @@ def build_main_menu(self, identifiers=[]):
205
205
of the menus to display.
206
206
"""
207
207
self .log ('build_main_menu' )
208
+
209
+ def display_item (item ):
210
+ return item in identifiers and self .get_boolean_setting (item )
211
+
208
212
main_menu_list = [
209
213
{
210
214
# All shows
211
215
'identifier' : 'All_Shows' ,
212
216
'name' : self .plugin_language (30050 ),
213
217
'mode' : 10 ,
214
- 'displayItem' : self . get_boolean_setting ('All_Shows' ),
218
+ 'displayItem' : display_item ('All_Shows' ),
215
219
'icon' : self .icon ,
216
220
}, {
217
221
# Favourite shows
218
222
'identifier' : 'Favourite_Shows' ,
219
223
'name' : self .plugin_language (30051 ),
220
224
'mode' : 11 ,
221
- 'displayItem' : self . get_boolean_setting ('Favourite_Shows' ),
225
+ 'displayItem' : display_item ('Favourite_Shows' ),
222
226
'icon' : self .icon ,
223
227
}, {
224
228
# Newest favourite shows
225
229
'identifier' : 'Newest_Favourite_Shows' ,
226
230
'name' : self .plugin_language (30052 ),
227
231
'mode' : 12 ,
228
- 'displayItem' : self .get_boolean_setting (
229
- 'Newest_Favourite_Shows' ),
230
- 'icon' : self .icon ,
231
- }, {
232
- # Recommendations
233
- 'identifier' : 'Recommendations' ,
234
- 'name' : self .plugin_language (30053 ),
235
- 'mode' : 16 ,
236
- 'displayItem' : self .get_boolean_setting ('Recommendations' ),
232
+ 'displayItem' : display_item ('Newest_Favourite_Shows' ),
237
233
'icon' : self .icon ,
238
234
}, {
239
235
# Topics
240
236
'identifier' : 'Topics' ,
241
237
'name' : self .plugin_language (30058 ),
242
238
'mode' : 13 ,
243
- 'displayItem' : self . get_boolean_setting ('Topics' ),
239
+ 'displayItem' : display_item ('Topics' ),
244
240
'icon' : self .icon ,
245
241
}, {
246
242
# Most searched TV shows
247
243
'identifier' : 'Most_Searched_TV_Shows' ,
248
244
'name' : self .plugin_language (30059 ),
249
245
'mode' : 14 ,
250
- 'displayItem' : self .get_boolean_setting (
251
- 'Most_Searched_TV_Shows' ),
246
+ 'displayItem' : display_item ('Most_Searched_TV_Shows' ),
252
247
'icon' : self .icon ,
253
248
}, {
254
249
# Shows by date
255
250
'identifier' : 'Shows_By_Date' ,
256
251
'name' : self .plugin_language (30057 ),
257
252
'mode' : 17 ,
258
- 'displayItem' : self . get_boolean_setting ('Shows_By_Date' ),
253
+ 'displayItem' : display_item ('Shows_By_Date' ),
259
254
'icon' : self .icon ,
260
255
}, {
261
256
# Live TV
@@ -276,22 +271,21 @@ def build_main_menu(self, identifiers=[]):
276
271
'identifier' : 'Search' ,
277
272
'name' : self .plugin_language (30085 ),
278
273
'mode' : 27 ,
279
- 'displayItem' : self . get_boolean_setting ('Search' ),
274
+ 'displayItem' : display_item ('Search' ),
280
275
'icon' : self .icon ,
281
276
}, {
282
277
# Homepage
283
278
'identifier' : 'Homepage' ,
284
279
'name' : self .plugin_language (30060 ),
285
280
'mode' : 200 ,
286
- 'displayItem' : self . get_boolean_setting ('Homepage' ),
281
+ 'displayItem' : display_item ('Homepage' ),
287
282
'icon' : self .icon ,
288
283
}, {
289
284
# YouTube
290
285
'identifier' : f'{ self .bu .upper ()} _YouTube' ,
291
286
'name' : self .plugin_language (30074 ),
292
287
'mode' : 30 ,
293
- 'displayItem' : self .get_boolean_setting (
294
- f'{ self .bu .upper ()} _YouTube' ),
288
+ 'displayItem' : display_item (f'{ self .bu .upper ()} _YouTube' ),
295
289
'icon' : self .get_youtube_icon (),
296
290
}
297
291
]
0 commit comments