[RELEASE] PseudoTV Addon: Virtual EPG and TV Channel Surfing Script - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +----- Forum: PseudoTV / PseudoTV Live (https://forum.kodi.tv/forumdisplay.php?fid=231) +----- Thread: [RELEASE] PseudoTV Addon: Virtual EPG and TV Channel Surfing Script (/showthread.php?tid=90738) Pages:
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
- jtucker1972 - 2011-02-17 zepfan Wrote:Night does in some view types. Here's the answer: Whenever you go to TV Shows in XBMC it makes a SQL query to get the tvshows data. The studio information resides in the tvshow table so it is available in the returned data to be displayed in the Night skin when you are viewing TV Shows. Here is the SQL that gets executed by XBMC to pull the tvshows for the tvshow window. GetTvShowsByWhere query: Code: SELECT tvshow.*,path.strPath AS strPath,counts.totalcount AS totalCount,counts.watchedcount AS watchedCount,counts.totalcount=counts.watchedcount AS watched FROM tvshow JOIN tvshowlinkpath ON tvshow.idShow=tvshowlinkpath.idShow JOIN path ON path.idpath=tvshowlinkpath.idPath LEFT OUTER join ( SELECT tvshow.idShow AS idShow,count(1) AS totalcount,count(files.playCount) AS watchedcount FROM tvshow JOIN tvshowlinkepisode ON tvshow.idShow=tvshowlinkepisode.idShow JOIN episode ON episode.idEpisode=tvshowlinkepisode.idEpisode JOIN files ON files.idFile=episode.idFile GROUP BY tvshow.idShow) counts ON tvshow.idShow=counts.idShow The next queries retrieve the seasons data for the tvshow selected. GetStackedTvShowList query: Code: select idShow from tvshow where c00 like (select c00 from tvshow where idShow=67) order by idShow TV studio data is stored in tvshow.c14 field. Based on the sql query below, this data is returned for the season view so it could be shown on this skin window. GetSeasonsNav query: Code: select episode.c12,path.strPath,tvshow.c00,tvshow.c08,tvshow.c14,tvshow.c13,count(1),count(files.playCount) from episode join tvshowlinkepisode on tvshowlinkepisode.idEpisode=episode.idEpisode join tvshow on tvshow.idShow=tvshowlinkepisode.idShow join files on files.idFile=episode.idFile join tvshowlinkpath on tvshowlinkpath.idShow = tvshow.idShow join path on path.idPath = tvshowlinkpath.idPath where tvshow.idShow = 67 group by episode.c12 Next query run gets whether the tv show has an associated movie linked to it. No tv studio available from this query. GetMoviesByWhere query: Code: select * from movieview join movielinktvshow on movielinktvshow.idMovie=movieview.idMovie where movielinktvshow.idShow = 67 Next query doesn't return studio data. GetStackedTvShowList query: Code: select idShow from tvshow where c00 like (select c00 from tvshow where idShow=67) order by idShow Finally, we get to episodes query. The episodeview does return the studio data as strStudio so it is available to be displayed in the tv episode window of a skin. GetEpisodesByWhere query: Code: select * from episodeview where idShow = 67 and (c12=1 or (c12=0 and (c15=0 or c15=1))) So at this point we can see where a skin has access to the data via the standard video tvshow windows. Now let's look at how XBMC queries the data when using playlists. TVShow playlist filter by studio = cbs executes the following SQL. Since we already know studio data is stored in tvshow table, it would be available, but tvshow playlists don't return episodes to watch, just a list of the tv shows. GetTvShowsByWhere query: Code: SELECT tvshow.*,path.strPath AS strPath,counts.totalcount AS totalCount,counts.watchedcount AS watchedCount,counts.totalcount=counts.watchedcount AS watched FROM tvshow JOIN tvshowlinkpath ON tvshow.idShow=tvshowlinkpath.idShow JOIN path ON path.idpath=tvshowlinkpath.idPath LEFT OUTER join ( SELECT tvshow.idShow AS idShow,count(1) AS totalcount,count(files.playCount) AS watchedcount FROM tvshow JOIN tvshowlinkepisode ON tvshow.idShow=tvshowlinkepisode.idShow JOIN episode ON episode.idEpisode=tvshowlinkepisode.idEpisode JOIN files ON files.idFile=episode.idFile GROUP BY tvshow.idShow) counts ON tvshow.idShow=counts.idShow WHERE ('1') So next lets look at what is returned for an episode playlist and how XBMC queries the database for it. Episode playlist filter by genre = comedy limit 50. This playlist queries the episodeview which also contains the studio data in the strStudio field returned. Looks good right? GetEpisodesByWhere query: Code: select * from episodeview WHERE (idShow in (select idShow from genrelinktvshow join genre on genre.idGenre=genrelinktvshow.idGenre where genre.strGenre LIKE 'Comedy')) ORDER BY RANDOM() LIMIT 50 Let's try to create a playlist to query for cbs as the studio. The data is in episodesview so it could be queried against to return episodes where strStudio=cbs Here is the playlist xml. Code: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> which executes the following sql in XBMC Code: GetEpisodesByWhere query: select * from episodeview WHERE ('1') ORDER BY RANDOM() LIMIT 50 See what happened? The XBMC code does not know how to handle rule field=studio so it just creates a random episode playlist. This would be the same as not passing a rule at all. This is why we cannot create a playlist by studio so we could have a CBS channel, HBO channel, etc. I know this was long but hopefully it can put to rest what the capabilities are for playlists and how XBMC converts them to SQL database queries. thanks - ryan03rr - 2011-02-17 just a note incase there any space cadets out there like me... when converting from winblows... to *nix make sure you respect "C"hannel_1 vs "c"hannel_1 just a hint since i spent a hour confused .... btw theres a missspelling in the pluginin when scanning i say "chanbles" awsome plugin thanks again.... - zepfan - 2011-02-17 jtucker1972 Wrote:See what happened? The XBMC code does not know how to handle rule field=studio so it just creates a random episode playlist. This would be the same as not passing a rule at all. Ahh. Oh well, worth a try. ryan03rr Wrote:just a note incase there any space cadets out there like me... Yea, jason and I had some issues with that. Nix is case sensitive. - Jason102 - 2011-02-18 Ok, so an update. This duration issue has really been bugging me. XBMC doesn't give a developer a way to set or get a duration that isn't already known without playing it, and that wasn't so much of an option. So I took the slightly ridiculous route. I've spent the last few days reading video file format specs. I then wrote routines that will open the video files, read the durations, and use those. Currently, I only support 3 file formats: AVI, MKV, and MP4/M4V. My library is 99% composed of these types, so I figured that was good enough for the moment. I've tested the routines on most of my files and nearly everything retrieved a proper duration. The file that didn't work (a random MKV) didn't get any duration, so it shouldn't screw up anything. The code will use the XBMC duration if it's there, or it will attempt to determine the duration directly from the file itself if it isn't. The code is in stable-pre if anyone wants to try it out. It's not as well tested as it should be (as is true with so much of my work) but it is performing well for me. Try it out, report any bugs. If things go well, it'll be in there with the release this weekend! - mwkurt - 2011-02-18 Jason, Is this new code embedded in PseudoTV or is it something that we have to download separately? Is there a special link we need as I don't see anything in your last post? Thanks, Mark - Jason102 - 2011-02-18 It's embedded...just more python that I wrote to do it. - branlr - 2011-02-18 Damn, you are sick Jason. All hail the greatest addon ever! For some reason, though, the new stable-pre version is failing for me (win 7 x64). I'll keep playing with it, though. @mwkurt--check out the link to the repository on the first post in the thread, and change the branch to stable-pre. - Sranshaft - 2011-02-18 Got a bit bored while working on a Confluence skin so I decided to whip up one for Jezz_X's SLik skin. Download from here and place the skin.slik folder into your %appdata%\XBMC\addons\script.pseudotv\resources\skins folder. Jason102 Wrote:Ok, so an update. This duration issue has really been bugging me. XBMC doesn't give a developer a way to set or get a duration that isn't already known without playing it, and that wasn't so much of an option. So I took the slightly ridiculous route. I've spent the last few days reading video file format specs. I then wrote routines that will open the video files, read the durations, and use those. Currently, I only support 3 file formats: AVI, MKV, and MP4/M4V. My library is 99% composed of these types, so I figured that was good enough for the moment. I've tested the routines on most of my files and nearly everything retrieved a proper duration. The file that didn't work (a random MKV) didn't get any duration, so it shouldn't screw up anything. Good lord man, going above and beyond! I'll give it a thorough testing and see if I can break it. @Jason: I'll have the Confluence skin ready for you tomorrow. I ran into two things that'll need your fix. [STRIKE]As you can see in the screenshot above, the time / date labels aren't inheriting the textcolor setting in the skin for some reason.[/STRIKE] I also needed to add in a font="font11" into the EPG code where the listing buttons are created. This should help displaying videos with longer names. - Jason102 - 2011-02-18 @Sranshaft: the skin, of course, looks excellent. I worry about changing the font of the buttons in the EPG, though. I want to make sure that the skin looks good on a TV and as it is my wife can't really read the text on our bedroom TV. Smaller may not help with readability. @branlr: Still not working? Is it failing while starting up, or while bringing up the EPG? If you can get a debug log, that'd be great. - tungmeister - 2011-02-18 Sranshaft Wrote:Got a bit bored while working on a Confluence skin so I decided to whip up one for Jezz_X's SLik skin. How about giving fusion some love? :p - Sranshaft - 2011-02-18 tungmeister Wrote:How about giving fusion some love? :p I'll look into it as soon as I get through some of the other ones. - zepfan - 2011-02-19 Sranshaft Wrote:I'll look into it as soon as I get through some of the other ones.Which ones do you have planned? Can we use one's with different skins? Example slik with alaska? - Sranshaft - 2011-02-19 zepfan Wrote:Which ones do you have planned? Can we use one's with different skins? Example slik with alaska? You can but I wouldn't recommend it. The font sizes vary depending on the skin and because of that, the text will not look as planned. Also, the skins can have images that depend on the skin they were created for. This is particularly the case in the SLik skin where the majority of the images displayed come directly from the SLik's skin folder and not from PseudoTV. As for which skins I have planned...I'm currently finishing up one for Confluence. After that, I'm not sure. It'd be ideal if the skin's designer created a skin for PseudoTV as they have a better idea of what they want to see. At the moment though, I'm working on skinning the addon ForumBrowser for reFocus and a few other skins so it may be a while before I can get back to doing some for Alaska, etc. - zepfan - 2011-02-19 Sranshaft Wrote:You can but I wouldn't recommend it. The font sizes vary depending on the skin and because of that, the text will not look as planned. Also, the skins can have images that depend on the skin they were created for. This is particularly the case in the SLik skin where the majority of the images displayed come directly from the SLik's skin folder and not from PseudoTV.I see. Thanks for the response, and all your work! - jtucker1972 - 2011-02-19 @Jason102, unbelievable what you are doing. I am going to download your latest version and do some testing with it. |