public
Description: Simple to use TVDB (thetvdb.com) API in Python, and automatic TV episode namer
Homepage: http://dbr.lighthouseapp.com/projects/13342-tvdb_api/tickets
Clone URL: git://github.com/dbr/tvdb_api.git
Search Repo:
Each t['show'][1][2] instance now has a ['seasonnumber'] and ['episode'] 
element, and no longer always has ['name'] set to None if no name is 
found
dbr (author)
Fri Jul 25 12:10:07 -0700 2008
commit  0e71baa294b5bce4e828d4521b75b02ca9fc22ea
tree    e84d57e085a52fd9563966d126bdedb4ef140c0c
parent  8c6f92154aedb1a95b328a5dd235c31b5f8490b5
...
426
427
428
429
430
 
431
432
433
...
465
466
467
468
469
470
471
 
 
 
472
473
 
474
475
476
...
489
490
491
492
493
 
494
495
496
...
426
427
428
 
 
429
430
431
432
...
464
465
466
 
 
 
 
467
468
469
470
 
471
472
473
474
...
487
488
489
 
490
491
492
493
494
0
@@ -426,8 +426,7 @@ class Tvdb:
0
                     allSeries[i]['sid'].encode("UTF-8","ignore")
0
                 )
0
             
0
- valid_input = False
0
- while not valid_input:
0
+ while True: # return breaks this loop
0
                 try:
0
                     print "Enter choice (first number, ? for help):"
0
                     ans = raw_input()
0
@@ -465,12 +464,11 @@ class Tvdb:
0
         for ep in epsSoup.findAll('episode'):
0
             ep_no = int( ep.find('episodenumber').contents[0] )
0
             seas_no = int( ep.find('seasonnumber').contents[0] )
0
- if len( ep.find('episodename').contents ) == 0:
0
- self.log.debug('Could not find episode name for seas:%s ep:%s' % (seas_no, ep_no))
0
- ep_name = None
0
- else:
0
+ self._setItem(sid, seas_no, ep_no, 'episodenumber', ep_no)
0
+ self._setItem(sid, seas_no, ep_no, 'seasonnumber', seas_no)
0
+ if len( ep.find('episodename').contents ) > 0:
0
                 ep_name = str( ep.find('episodename').contents[0] )
0
- self._setItem(sid, seas_no, ep_no, 'name', ep_name)
0
+ self._setItem(sid, seas_no, ep_no, 'name', ep_name)
0
         #end for ep
0
     #end _geEps
0
     
0
@@ -489,8 +487,8 @@ class Tvdb:
0
             sname, sid = selected_series['name'], selected_series['sid']
0
             self.log.debug('Got %s, sid %s' % (sname, sid) )
0
             
0
- self._setShowData(sid, 'showname', sname)
0
             self.corrections[name] = sid
0
+ self._setShowData(sid, 'showname', sname)
0
             self._getEps( sid )
0
         #end if self.corrections.has_key
0
         return sid

Comments

    No one has commented yet.