@@ -42,44 +42,40 @@ def __init__(self, session, runtype):
42
42
with open (skin , "r" ) as f :
43
43
self .skin = f .read ()
44
44
else :
45
- current_width = screenwidth .width ()
46
- if current_width <= 1280 :
47
- self .skin = """
45
+ skin = """
46
+ <screen name="Updater" position="0,0" size="1920,1080" backgroundColor="#ff000000" flags="wfNoBorder">
47
+ <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/BouquetMakerXtream/icons/plugin-icon.png" position="30,25" size="150,60" alphatest="blend" zPosition="4" />
48
+ <eLabel position="180,30" size="360,50" backgroundColor="#10232323" transparent="0" zPosition="-1"/>
49
+ <widget name="status" position="210,30" size="300,50" font="Regular;24" foregroundColor="#ffffff" backgroundColor="#000000" valign="center" noWrap="1" transparent="1" zPosition="5" />
50
+ </screen>"""
51
+
52
+ if screenwidth .width () <= 1280 :
53
+ skin = """
48
54
<screen name="Updater" position="0,0" size="1280,720" backgroundColor="#ff000000" flags="wfNoBorder">
49
55
<ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/BouquetMakerXtream/icons/plugin-icon_sd.png" position="20,16" size="100,40" alphatest="blend" zPosition="4" />
50
56
<eLabel position="120,20" size="240,32" backgroundColor="#10232323" transparent="0" zPosition="-1"/>
51
57
<widget name="status" position="140,20" size="200,32" font="Regular;16" foregroundColor="#ffffff" backgroundColor="#000000" valign="center" noWrap="1" transparent="1" zPosition="5" />
52
58
</screen>"""
53
- else :
54
- self .skin = """
55
- <screen name="Updater" position="0,0" size="1920,1080" backgroundColor="#ff000000" flags="wfNoBorder">
56
- <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/BouquetMakerXtream/icons/plugin-icon.png" position="30,25" size="150,60" alphatest="blend" zPosition="4" />
57
- <eLabel position="180,30" size="360,50" backgroundColor="#10232323" transparent="0" zPosition="-1"/>
58
- <widget name="status" position="210,30" size="300,50" font="Regular;24" foregroundColor="#ffffff" backgroundColor="#000000" valign="center" noWrap="1" transparent="1" zPosition="5" />
59
- </screen>"""
59
+
60
+ self .skin = skin
60
61
61
62
self .setup_title = _ ("Building Bouquets" )
62
63
self .categories = []
63
- self .live_categories = ""
64
- self .vod_categories = ""
65
- self .series_categories = ""
66
- self .live_streams = ""
67
- self .vod_streams = ""
68
- self .series_streams = ""
64
+ self ["action" ] = Label ("" )
65
+ self ["info" ] = Label ("" )
66
+ self ["status" ] = Label ("" )
67
+ self ["progress" ] = ProgressBar ()
68
+
69
69
self .bouq = 0
70
70
71
+ if self .runtype == "manual" :
72
+ self ["action" ] = Label (_ ("Building Bouquets..." ))
73
+
71
74
self ["actions" ] = ActionMap (["BMXActions" ], {
72
75
"red" : self .void ,
73
76
"cancel" : self .void ,
74
77
}, - 2 )
75
78
76
- if self .runtype == "manual" :
77
- self ["action" ] = Label (_ ("Building Bouquets..." ))
78
- self ["info" ] = Label ("" )
79
- self ["progress" ] = ProgressBar ()
80
-
81
- self ["status" ] = Label ("" )
82
-
83
79
self .playlists_all = bmx .getPlaylistJson ()
84
80
85
81
if self .playlists_all :
@@ -89,7 +85,7 @@ def __init__(self, session, runtype):
89
85
self .bouquets = []
90
86
self .bouquets_len = 0
91
87
92
- if self .bouquets and epgimporter :
88
+ if self .bouquets :
93
89
self .looptimer = eTimer ()
94
90
try :
95
91
self .looptimer_conn = self .looptimer .timeout .connect (self .bouquetLoop )
@@ -112,38 +108,38 @@ def loopPlaylists(self):
112
108
self .done ()
113
109
114
110
def bouquetLoop (self ):
115
- self .live_categories = []
116
- self .vod_categories = []
117
- self .series_categories = []
118
- self .live_streams = []
119
- self .vod_streams = []
120
- self .series_streams = []
111
+ glob .current_playlist = self .bouquets [self .bouq ]
121
112
122
- if self .bouquets :
123
- glob .current_playlist = self .bouquets [self .bouq ]
113
+ self .bouquet_tv = False
114
+ self .userbouquet = False
115
+ self .total_count = 0
116
+ self .unique_ref = 0
117
+ self .progress_value = 0
118
+ self .progress_range = 0
124
119
125
- self .bouquet_tv = False
126
- self .userbouquet = False
127
- self .total_count = 0
128
- self .unique_ref = 0
129
- self .progress_value = 0
130
- self .progress_range = 0
120
+ if glob .current_playlist ["playlist_info" ]["playlist_type" ] == "xtream" :
121
+ if glob .current_playlist ["settings" ]["show_live" ] is True :
122
+ self .progress_range += 2
131
123
132
- if glob .current_playlist ["playlist_info" ]["playlist_type" ] == "xtream" :
133
- self .progress_range += 2 * sum ([
134
- glob .current_playlist ["settings" ]["show_live" ],
135
- glob .current_playlist ["settings" ]["show_vod" ],
136
- glob .current_playlist ["settings" ]["show_series" ]
137
- ])
138
- else :
139
- self .progress_range += 1 # Base range for non-xtream playlists
140
- self .progress_range += sum ([
141
- glob .current_playlist ["settings" ]["show_live" ],
142
- glob .current_playlist ["settings" ]["show_vod" ],
143
- glob .current_playlist ["settings" ]["show_series" ]
144
- ])
124
+ if glob .current_playlist ["settings" ]["show_vod" ] is True :
125
+ self .progress_range += 2
145
126
146
- self .start ()
127
+ if glob .current_playlist ["settings" ]["show_series" ] is True :
128
+ self .progress_range += 2
129
+
130
+ else :
131
+ self .progress_range += 1
132
+
133
+ if glob .current_playlist ["settings" ]["show_live" ] is True :
134
+ self .progress_range += 1
135
+
136
+ if glob .current_playlist ["settings" ]["show_vod" ] is True :
137
+ self .progress_range += 1
138
+
139
+ if glob .current_playlist ["settings" ]["show_series" ] is True :
140
+ self .progress_range += 1
141
+
142
+ self .start ()
147
143
148
144
def nextJob (self , actiontext , function ):
149
145
if self .runtype == "manual" :
@@ -162,7 +158,6 @@ def start(self):
162
158
self ["progress" ].setValue (self .progress_value )
163
159
164
160
self .safe_name = bmx .safeName (glob .current_playlist ["playlist_info" ]["name" ])
165
-
166
161
self ["status" ].setText (_ ("Updating Playlist %d of %d" ) % (self .bouq + 1 , self .bouquets_len ))
167
162
self .deleteExistingRefs ()
168
163
@@ -172,16 +167,14 @@ def deleteExistingRefs(self):
172
167
f .seek (0 )
173
168
f .truncate ()
174
169
175
- # Patterns to skip
176
- patterns_to_skip = [
177
- "bouquetmakerxtream_live_" + self .safe_name + "_" ,
178
- "bouquetmakerxtream_vod_" + self .safe_name + "_" ,
179
- "bouquetmakerxtream_series_" + self .safe_name + "_" ,
180
- "bouquetmakerxtream_" + self .safe_name + ".tv"
181
- ]
182
-
183
170
for line in lines :
184
- if any (pattern in line for pattern in patterns_to_skip ):
171
+ if "bouquetmakerxtream_live_" + str (self .safe_name ) + "_" in line :
172
+ continue
173
+ if "bouquetmakerxtream_vod_" + str (self .safe_name ) + "_" in line :
174
+ continue
175
+ if "bouquetmakerxtream_series_" + str (self .safe_name ) + "_" in line :
176
+ continue
177
+ if "bouquetmakerxtream_" + str (self .safe_name ) + ".tv" in line :
185
178
continue
186
179
f .write (line )
187
180
@@ -222,11 +215,11 @@ def makeUrlList(self):
222
215
if glob .current_playlist ["playlist_info" ]["playlist_type" ] == "xtream" :
223
216
player_api = str (glob .current_playlist ["playlist_info" ]["player_api" ])
224
217
self .xmltv_api = str (glob .current_playlist ["playlist_info" ]["xmltv_api" ])
225
-
226
- next_days = glob .current_playlist ["settings" ]. get ( " next_days", "0" )
227
-
228
- if next_days != "0" :
229
- self . xmltv_api += "&next_days=" + str ( next_days )
218
+ try :
219
+ if " next_days" in glob .current_playlist ["settings" ] and glob . current_playlist [ "settings" ][ " next_days"] != "0" :
220
+ self . xmltv_api = str ( glob . current_playlist [ "playlist_info" ][ "xmltv_api" ]) + "&next_days=" + str ( glob . current_playlist [ "settings" ][ "next_days" ])
221
+ except :
222
+ pass
230
223
231
224
self .username = glob .current_playlist ["playlist_info" ]["username" ]
232
225
self .password = glob .current_playlist ["playlist_info" ]["password" ]
@@ -313,6 +306,14 @@ def processDownloads(self, stream_type, outputtype=None):
313
306
output_file = '/var/volatile/tmp/bouquetmakerxtream/temp'
314
307
315
308
for url in self .url_list :
309
+
310
+ self .live_categories = []
311
+ self .vod_categories = []
312
+ self .series_categories = []
313
+ self .live_streams = []
314
+ self .vod_streams = []
315
+ self .series_streams = []
316
+
316
317
if outputtype == "json" :
317
318
result = bmx .downloadUrlCategory (url )
318
319
else :
0 commit comments