def imdb_add_to_fxd(self, arg=None, menuw=None): """ add item to fxd file BROKEN, PLEASE FIX """ #if this exists we got a cdrom/dvdrom if self.item.media and self.item.media.devicename: devicename = self.item.media.devicename else: devicename = None fxd = FxdImdb() fxd.setFxdFile(arg[0].fxd_file) if self.item.mode in ('dvd', 'vcd'): fxd.setDiscset(devicename, None) else: num = len(fxd.video) + 1 video = makeVideo('file', 'f%s' % num, self.item.filename, device=devicename) fxd.setVideo(video) if arg[1] == 'variant': part = makePart('Variant %d' % num, 'f%s' % num) if fxd.variant: part = [makePart('Variant 1', 'f1'), part] fxd.setVariants(part) fxd.writeFxd() self.imdb_menu_back(menuw)
def imdb_create_fxd(self, arg=None, menuw=None): """ create fxd file for the item """ fxd = FxdImdb() box = PopupBox(text=_('getting data...')) box.show() #if this exists we got a cdrom/dvdrom if self.item.media and self.item.media.devicename: devicename = self.item.media.devicename else: devicename = None # restore season/episode if we have it fxd.setImdbId(arg[0], self.season, self.episode) if self.disc_set: fxd.setDiscset(devicename, None) else: if self.item.subitems: for i in range(len(self.item.subitems)): video = makeVideo('file', 'f%s' % i, os.path.basename( self.item.subitems[i].filename), device=devicename) fxd.setVideo(video) else: video = makeVideo('file', 'f1', os.path.basename(self.item.filename), device=devicename) fxd.setVideo(video) fxd.setFxdFile(os.path.splitext(self.item.filename)[0]) fxd.writeFxd() self.imdb_menu_back(menuw) box.destroy()
usage() task = 'guess' search_arg = a if o == '--rom-drive': drive = a driveset = TRUE fxd = FxdImdb() if task == 'add': if len(args) == 2: usage() fxd.setFxdFile(arg[0]) if fxd.isDiscset() == TRUE: fxd.setDiscset(drive, None) elif fxd.isDiscset() == FALSE: type = 'file' if arg[1].find('[dvd]') != -1: type = 'dvd' if arg[1].find('[vcd]') != -1: type = 'vcd' id = abs(Random() * 100) if driveset == TRUE: video = makeVideo(type, 'f' + str(id), arg[1], device=drive) else: video = makeVideo(type, 'f' + str(id), arg[1]) fxd.setVideo(video) else: print 'Fxd file is not valid, updating failed' sys.exit(1) fxd.writeFxd()
sys.exit(u'requires <imdb id> <directory>') tv_marker = (opts.tv or opts.season or opts.episode) and '"' or '' if opts.rom_drive is not None: driveset = True fxd = FxdImdb() if opts.add: fxd.setFxdFile(args[0]) fxd.setFxdFile(arg[0]) if fxd.isDiscset() is None: sys.exit(u'Fxd file is not valid, updating failed') elif fxd.isDiscset(): fxd.setDiscset(opts.rom_drive, None) else: type = 'file' if arg[1].find('[dvd]') != -1: type = 'dvd' if arg[1].find('[vcd]') != -1: type = 'vcd' id = abs( Random() * 100 ) if driveset: video = makeVideo(type, 'f'+str(id), arg[1], device=opts.rom_drive) else: video = makeVideo(type, 'f'+str(id), arg[1]) fxd.setVideo(video) fxd.writeFxd() sys.exit(0) if opts.search:
sys.exit(u'requires <imdb id> <directory>') tv_marker = (opts.tv or opts.season or opts.episode) and '"' or '' if opts.rom_drive is not None: driveset = True fxd = FxdImdb() if opts.add: fxd.setFxdFile(args[0]) fxd.setFxdFile(arg[0]) if fxd.isDiscset() is None: sys.exit(u'Fxd file is not valid, updating failed') elif fxd.isDiscset(): fxd.setDiscset(opts.rom_drive, None) else: type = 'file' if arg[1].find('[dvd]') != -1: type = 'dvd' if arg[1].find('[vcd]') != -1: type = 'vcd' id = abs(Random() * 100) if driveset: video = makeVideo(type, 'f' + str(id), arg[1], device=opts.rom_drive) else: video = makeVideo(type, 'f' + str(id), arg[1]) fxd.setVideo(video) fxd.writeFxd()