Example #1
0
    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)
Example #2
0
def _create_fxd(prog, filename, start_time):
    """
    Create a .fxd file with the specified program information in.
    """
    from util.fxdimdb import FxdImdb, makeVideo
    fxd = FxdImdb()

    (filebase, fileext) = os.path.splitext(filename)
    fxd.setFxdFile(filebase, overwrite=True)

    video = makeVideo('file', 'f1', os.path.basename(filename))
    fxd.setVideo(video)
    if prog:
        fxd.title = prog.title
        fxd.info['tagline'] = fxd.str2XML(prog.sub_title)
        desc = prog.desc.replace('\n\n', '\n').replace('\n', '
')
        fxd.info['plot'] = fxd.str2XML(desc)
    else:
        fxd.title = _('Manual Recording')
    fxd.info['recording_timestamp'] = str(start_time)
    fxd.info['runtime'] = None
    # bad use of the movie year field :)
    try:
        fxd.info['year'] = time.strftime(config.TV_RECORD_YEAR_FORMAT,
                                         time.localtime(start_time))
    except:
        fxd.info['year'] = '2007'

    if plugin.is_active('tv.recordings_manager'):
        fxd.info['watched'] = 'False'
        fxd.info['keep'] = 'False'
    fxd.writeFxd()
Example #3
0
def _create_fxd(prog, filename, start_time):
    """
    Create a .fxd file with the specified program information in.
    """
    from util.fxdimdb import FxdImdb, makeVideo
    fxd = FxdImdb()

    (filebase, fileext) = os.path.splitext(filename)
    fxd.setFxdFile(filebase, overwrite=True)

    video = makeVideo('file', 'f1', os.path.basename(filename))
    fxd.setVideo(video)
    if prog:
        fxd.title = prog.title
        fxd.info['tagline'] = fxd.str2XML(prog.sub_title)
        desc = prog.desc.replace('\n\n','\n').replace('\n','
')
        fxd.info['plot'] = fxd.str2XML(desc)
    else:
        fxd.title = _('Manual Recording')
    fxd.info['recording_timestamp'] = str(start_time)
    fxd.info['runtime'] = None
    # bad use of the movie year field :)
    try:
        fxd.info['year'] = time.strftime(config.TV_RECORD_YEAR_FORMAT, time.localtime(start_time))
    except:
        fxd.info['year'] = '2007'

    if plugin.is_active('tv.recordings_manager'):
        fxd.info['watched'] = 'False'
        fxd.info['keep'] = 'False'
    fxd.writeFxd()
Example #4
0
    def create_fxd(self):
        from util.fxdimdb import FxdImdb, makeVideo
        fxd = FxdImdb()

        (filebase, fileext) = os.path.splitext(self.filename)
        fxd.setFxdFile(filebase, overwrite=True)

        desc = self.desc.replace('\n', '
')
        video = makeVideo('file', 'f1', os.path.basename(self.filename))
        fxd.setVideo(video)
        fxd.info['tagline'] = fxd.str2XML(self.episode)
        fxd.info['plot'] = fxd.str2XML(self.desc)
        fxd.title = self.title
        fxd.writeFxd()
Example #5
0
    def create_fxd(self):
        from util.fxdimdb import FxdImdb, makeVideo

        fxd = FxdImdb()

        (filebase, fileext) = os.path.splitext(self.filename)
        fxd.setFxdFile(filebase, overwrite=True)

        desc = self.desc.replace("\n", "
")
        video = makeVideo("file", "f1", os.path.basename(self.filename))
        fxd.setVideo(video)
        fxd.info["tagline"] = fxd.str2XML(self.episode)
        fxd.info["plot"] = fxd.str2XML(self.desc)
        fxd.title = self.title
        fxd.writeFxd()
Example #6
0
    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()
Example #7
0
        if o == '-g':
            if task:
                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'
Example #8
0
    elif opts.search and len(args) < 1:
        sys.exit(u'--search requires <search pattern>')
    elif opts.guess and len(args) < 1:
        sys.exit(u'--guess requires <guess pattern>')
    elif opts.bulk and len(args) < 2:
        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])
Example #9
0
    elif opts.search and len(args) < 1:
        sys.exit(u'--search requires <search pattern>')
    elif opts.guess and len(args) < 1:
        sys.exit(u'--guess requires <guess pattern>')
    elif opts.bulk and len(args) < 2:
        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],