Ticket #6913: jamu_data_filter.patch
| File jamu_data_filter.patch, 3.9 KB (added by , 16 years ago) |
|---|
-
mythplugins/mythvideo/mythvideo/scripts/jamu.py
47 47 fan art and banners and meta data. The richer the source the more valuable the script. 48 48 ''' 49 49 50 __version__=u"v0.4. 1" # 0.1.0 Initial development50 __version__=u"v0.4.2" # 0.1.0 Initial development 51 51 # 0.2.0 Inital beta release 52 52 # 0.3.0 Add mythvideo metadata updating including movie graphics through 53 53 # the use of tmdb.pl when the perl script exists … … 144 144 # For all movies IMDB numbers will be used instead of converting to TMDB 145 145 # numbers. This is done to maintain consistency with MythVideo movie inetref 146 146 # numbers. 147 # 0.4.1 Fixed an obscure video file rename (-F option) error 147 # 0.4.1 Fixed an obscure video file rename (-F option) error 148 # 0.4.2 Fixed a bug where bad data for either TMDB or TVDB would abort script 148 149 149 150 150 151 usage_txt=u''' … … 3264 3265 tmp_array=tmp_files.split('\n') 3265 3266 for element in tmp_array: 3266 3267 element = (element.rstrip('\n')).strip() 3267 if element == '' :3268 if element == '' or element == None: 3268 3269 continue 3269 3270 index = element.index(':') 3270 3271 key = element[:index].lower() 3271 3272 data = element[index+1:] 3273 if data == None or data == '': 3274 continue 3272 3275 if key == u'inetref' and len(cfile['inetref']) == 7: 3273 3276 meta_dict[key] = cfile['inetref'] 3274 3277 continue … … 3339 3342 meta_dict[key] = cfile['inetref'] 3340 3343 continue 3341 3344 data = meta_dict[key] 3345 if not data: 3346 continue 3342 3347 data = self._changeAmp(data) 3343 3348 data = self._changeToCommas(data) 3344 3349 if key == 'genres': … … 3358 3363 if key == 'trailer': 3359 3364 continue 3360 3365 if key == 'year': 3361 meta_dict[key] = int(data) 3366 try: 3367 meta_dict[key] = int(data) 3368 except: 3369 pass 3362 3370 continue 3363 3371 if key == 'userrating': 3364 meta_dict[key] = float(data) 3372 try: 3373 meta_dict[key] = float(data) 3374 except: 3375 pass 3365 3376 continue 3366 3377 if key == 'runtime': 3367 meta_dict['length'] = long(data) 3378 try: 3379 meta_dict['length'] = long(data) 3380 except: 3381 pass 3368 3382 continue 3369 3383 3370 3384 if meta_dict.has_key('rating'): … … 3465 3479 index = element.index(':') 3466 3480 key = element[:index].lower() 3467 3481 data = element[index+1:] 3482 if data == None: 3483 continue 3468 3484 if key == 'series': 3469 3485 meta_dict['title'] = data 3470 3486 continue 3471 3487 if key == 'seasonnumber': 3472 meta_dict['season'] = int(data) 3488 try: 3489 meta_dict['season'] = int(data) 3490 except: 3491 pass 3473 3492 continue 3474 3493 if key == 'episodenumber': 3475 meta_dict['episode'] = int(data) 3494 try: 3495 meta_dict['episode'] = int(data) 3496 except: 3497 pass 3476 3498 continue 3477 3499 if key == 'episodename': 3478 3500 meta_dict['subtitle'] = data … … 3484 3506 meta_dict['director'] = '' 3485 3507 continue 3486 3508 if key == u'firstaired' and len(data) > 4: 3487 meta_dict['year'] = int(data[:4]) 3509 try: 3510 meta_dict['year'] = int(data[:4]) 3511 except: 3512 pass 3488 3513 meta_dict['firstaired'] = data 3489 3514 continue 3490 3515 if key == 'year': 3491 meta_dict['year'] = int(data) 3516 try: 3517 meta_dict['year'] = int(data) 3518 except: 3519 pass 3492 3520 continue 3493 3521 if key == 'seriesid': 3494 3522 meta_dict['inetref'] = data 3495 3523 continue 3496 3524 if key == 'rating': 3497 meta_dict['userrating'] = float(data) 3525 try: 3526 meta_dict['userrating'] = float(data) 3527 except: 3528 pass 3498 3529 continue 3499 3530 if key == 'filename':# This "episodeimage URL clashed with the video file name and ep image 3500 3531 continue # is not used yet. So skip fixes the db video filename from being wiped. 3501 3532 if key == 'runtime': 3502 meta_dict['length'] = long(data) 3533 try: 3534 meta_dict['length'] = long(data) 3535 except: 3536 pass 3503 3537 continue 3504 3538 meta_dict[key] = data 3505 3539
