@@ -144,8 +144,10 @@ public function __construct($data) {
144144 $ this ->auto_expire = ($ this ->progflags & 0x00000004 ) ? true : false ; // FL_AUTOEXP = 0x00000004
145145 $ this ->is_editing = ($ this ->progflags & 0x00000008 ) ? true : false ; // FL_EDITING = 0x00000008
146146 $ this ->bookmark = ($ this ->progflags & 0x00000010 ) ? true : false ; // FL_BOOKMARK = 0x00000010
147- $ this ->is_recording = ($ this ->progflags & 0x00100000 ) ? true : false ; // FL_INUSERECORDING = 0x00100000
148- $ this ->is_playing = ($ this ->progflags & 0x00200000 ) ? true : false ; // FL_INUSEPLAYING = 0x00200000
147+ $ this ->chancommfree = ($ this ->progflags & 0x00000800 ) ? true : false ; // FL_CHANCOMMFREE = 0x00000800
148+ $ this ->is_repeat = ($ this ->progflags & 0x00001000 ) ? true : false ; // FL_REPEAT = 0x00001000
149+ $ this ->is_recording = ($ this ->progflags & 0x01000000 ) ? true : false ; // FL_INUSERECORDING = 0x01000000
150+ $ this ->is_playing = ($ this ->progflags & 0x02000000 ) ? true : false ; // FL_INUSEPLAYING = 0x02000000
149151 $ this ->is_transcoded = ($ this ->progflags & 0x00000100 ) ? true : false ; // FL_TRANSCODED = 0x00000100
150152 $ this ->is_watched = ($ this ->progflags & 0x00000200 ) ? true : false ; // FL_WATCHED = 0x00000200
151153 // Can be deleted?
@@ -184,29 +186,57 @@ public function __construct($data) {
184186 $ this ->recordedid = $ data ['recordedid ' ];
185187
186188 // These db fields should really get renamed...
187- $ this ->audioproperties = $ data ['stereo ' ];
188- $ this ->videoproperties = $ data ['hdtv ' ];
189- $ this ->subtitletype = $ data ['closecaptioned ' ];
189+ $ this ->audioproperties = $ data ['audioprop ' ];
190+ $ this ->videoproperties = $ data ['videoprop ' ];
191+ $ this ->subtitletype = $ data ['subtitletypes ' ];
190192 }
191193 // Assign shortcut names to the new audio/video/subtitle property flags
192- $ this ->stereo = $ this ->audioproperties & 0x01 ;
193- $ this ->mono = $ this ->audioproperties & 0x02 ;
194- $ this ->surround = $ this ->audioproperties & 0x04 ;
195- $ this ->dolby = $ this ->audioproperties & 0x08 ;
196- $ this ->audiohardhear = $ this ->audioproperties & 0x10 ;
197- $ this ->audiovisimpair = $ this ->audioproperties & 0x20 ;
198-
199- $ this ->widescreen = $ this ->videoproperties & 0x0001 ;
200- $ this ->hdtv = $ this ->videoproperties & 0x0002 ;
201- $ this ->avc = $ this ->videoproperties & 0x0008 ;
202- $ this ->hd_ready = $ this ->videoproperties & 0x0020 ;
203- $ this ->fullhd = $ this ->videoproperties & 0x0040 ;
204- $ this ->damaged = $ this ->videoproperties & 0x0400 ;
205-
206- $ this ->closecaptioned = $ this ->subtitletype & 0x01 ;
207- $ this ->has_subtitles = $ this ->subtitletype & 0x02 ;
208- $ this ->subtitled = $ this ->subtitletype & 0x04 ;
209- $ this ->deaf_signed = $ this ->subtitletype & 0x08 ;
194+ // Check if properties are MySQL SET strings (contain letters) or numeric bitflags
195+ if (!empty ($ this ->audioproperties ) && !is_numeric ($ this ->audioproperties )) {
196+ // Parse comma-separated string values from MySQL SET columns
197+ $ this ->stereo = strpos ($ this ->audioproperties , 'STEREO ' ) !== false ;
198+ $ this ->mono = strpos ($ this ->audioproperties , 'MONO ' ) !== false ;
199+ $ this ->surround = strpos ($ this ->audioproperties , 'SURROUND ' ) !== false ;
200+ $ this ->dolby = strpos ($ this ->audioproperties , 'DOLBY ' ) !== false ;
201+ $ this ->audiohardhear = strpos ($ this ->audioproperties , 'HARDHEAR ' ) !== false ;
202+ $ this ->audiovisimpair = strpos ($ this ->audioproperties , 'VISUALIMPAIR ' ) !== false ;
203+ } elseif (is_numeric ($ this ->audioproperties )) {
204+ // Parse numeric bitflags from mythproto (could be string '75' or int 75)
205+ $ this ->stereo = intval ($ this ->audioproperties ) & 0x01 ;
206+ $ this ->mono = intval ($ this ->audioproperties ) & 0x02 ;
207+ $ this ->surround = intval ($ this ->audioproperties ) & 0x04 ;
208+ $ this ->dolby = intval ($ this ->audioproperties ) & 0x08 ;
209+ $ this ->audiohardhear = intval ($ this ->audioproperties ) & 0x10 ;
210+ $ this ->audiovisimpair = intval ($ this ->audioproperties ) & 0x20 ;
211+ }
212+
213+ if (!empty ($ this ->videoproperties ) && !is_numeric ($ this ->videoproperties )) {
214+ $ this ->widescreen = strpos ($ this ->videoproperties , 'WIDESCREEN ' ) !== false ;
215+ $ this ->hdtv = strpos ($ this ->videoproperties , 'HDTV ' ) !== false ;
216+ $ this ->avc = strpos ($ this ->videoproperties , 'AVC ' ) !== false ;
217+ $ this ->hd_ready = strpos ($ this ->videoproperties , '720 ' ) !== false ;
218+ $ this ->fullhd = strpos ($ this ->videoproperties , '1080 ' ) !== false ;
219+ $ this ->damaged = strpos ($ this ->videoproperties , 'DAMAGED ' ) !== false ;
220+ } elseif (is_numeric ($ this ->videoproperties )) {
221+ $ this ->widescreen = intval ($ this ->videoproperties ) & 0x0001 ;
222+ $ this ->hdtv = intval ($ this ->videoproperties ) & 0x0002 ;
223+ $ this ->avc = intval ($ this ->videoproperties ) & 0x0008 ;
224+ $ this ->hd_ready = intval ($ this ->videoproperties ) & 0x0020 ;
225+ $ this ->fullhd = intval ($ this ->videoproperties ) & 0x0040 ;
226+ $ this ->damaged = intval ($ this ->videoproperties ) & 0x0400 ;
227+ }
228+
229+ if (!empty ($ this ->subtitletype ) && !is_numeric ($ this ->subtitletype )) {
230+ $ this ->closecaptioned = strpos ($ this ->subtitletype , 'HARDHEAR ' ) !== false ;
231+ $ this ->has_subtitles = strpos ($ this ->subtitletype , 'NORMAL ' ) !== false ;
232+ $ this ->subtitled = strpos ($ this ->subtitletype , 'ONSCREEN ' ) !== false ;
233+ $ this ->deaf_signed = strpos ($ this ->subtitletype , 'SIGNED ' ) !== false ;
234+ } elseif (is_numeric ($ this ->subtitletype )) {
235+ $ this ->closecaptioned = intval ($ this ->subtitletype ) & 0x01 ;
236+ $ this ->has_subtitles = intval ($ this ->subtitletype ) & 0x02 ;
237+ $ this ->subtitled = intval ($ this ->subtitletype ) & 0x04 ;
238+ $ this ->deaf_signed = intval ($ this ->subtitletype ) & 0x08 ;
239+ }
210240 // Generate the star string, since mysql has issues with REPEAT() and
211241 // decimals, and the backend doesn't do it for us, anyway.
212242 $ this ->starstring = @str_repeat (star_character, intVal ($ this ->stars * max_stars));
0 commit comments