Ticket #4055: metadata_fixes_svn_head.diff

File metadata_fixes_svn_head.diff, 1.3 KB (added by anonymous, 19 years ago)
  • mythvideo/scripts/find_meta.py

     
    325326                0.0, None, 0, None, None, child, "")
    326327
    327328        intid = mythvideo.getMetadataId(videopath)
    328         if intid is not None:
    329                 if not overwrite:
     329        has_metadata = mythvideo.hasMetadata(videopath)
     330        if intid is not None :
     331                if not overwrite and has_metadata:
    330332                        print_verbose("Metadata already exist in MythDB, not overwriting it.")
    331333                        return None
     334                else:
     335                        print_verbose("Entry exists in MythDB with default metadata.  Updating.")
     336                        mythvideo.setMetadata({'filename': videopath}, id=intid)
    332337        else:
    333338                print_verbose("No metadata in MythDB, creating a new one.")
    334339                # Create a new empty entry at this point so we can use the common UPDATE code
     
    557562                        pass
    558563
    559564                if candidates is not None and len(candidates) > 0:
    560 
    561565                        index = 0
    562                         if len(candidates) > 1:
    563 
     566                        if (len(candidates) == 2) and (candidates[0][0] == candidates[1][0]):
     567                                imdb_id = candidates[0][0]
     568                        elif len(candidates) > 1:
     569                                import pdb; pdb.set_trace()
    564570                                print "Got multiple candidates for title search '%s'. " % title
    565571                                if not interactive:
    566572                                        print "Use the '-a' or '-i' switch to choose the correct one."