Esempio n. 1
0
    def one_rf(self, rf):

        pathname=os.path.join(self.show_dir, 'dv',
                rf.location.slug, rf.filename)

        if self.options.verbose: print(pathname)

        # print( "tsraw.get_start", (pathname, self.options.time_source ) )
        start = tsraw.get_start(pathname, self.options.time_source )

        """
        if offset is not None:
            start += datetime.timedelta(seconds=offset)
        """

        """
        # when did this start working?
        if os.path.splitext(rf.filename)[1] in [ '.ts' ]:
            seconds = 1800
        else:
            seconds = tsraw.get_duration(pathname)
        """
        seconds = tsraw.get_duration(pathname)

        print(( pathname, start, seconds ))
        rf.start = start

        hms = seconds//3600, (seconds%3600)//60, seconds%60
        duration = "%02d:%02d:%02d" % hms

        rf.duration = duration

        rf.save()
Esempio n. 2
0
    def one_rf(self, rf, offset):

        pathname = os.path.join(self.show_dir, 'dv', rf.location.slug,
                                rf.filename)

        if self.options.verbose: print(pathname)

        # print( "tsraw.get_start", (pathname, self.options.time_source ) )
        start = tsraw.get_start(pathname, self.options.time_source)

        if offset is not None:
            start += datetime.timedelta(seconds=offset)

        if os.path.splitext(rf.filename)[1] in ['.ts']:
            seconds = 1800
        else:
            seconds = tsraw.get_duration(pathname)

        print((pathname, start, seconds))
        rf.start = start

        hms = seconds // 3600, (seconds % 3600) // 60, seconds % 60
        duration = "%02d:%02d:%02d" % hms

        rf.duration = duration

        rf.save()
Esempio n. 3
0
    def one_rf(self, rf, offset):

        pathname=os.path.join(self.show_dir, 'dv',
                rf.location.slug, rf.filename)

        start = tsraw.get_start(pathname, "auto")
        if offset is not None:
            start += datetime.timedelta(seconds=offset)

        seconds = tsraw.get_duration(pathname)

        print( pathname, start, seconds )
        rf.start = start

        hms = seconds//3600, (seconds%3600)//60, seconds%60
        duration = "%02d:%02d:%02d" % hms

        rf.duration = duration

        rf.save()
Esempio n. 4
0
    def one_rf(self, rf):

        pathname = os.path.join(self.show_dir, 'dv', rf.location.slug,
                                rf.filename)

        if self.options.verbose: print(pathname)

        # print( "tsraw.get_start", (pathname, self.options.time_source ) )
        start = tsraw.get_start(pathname, self.options.time_source)
        """
        if offset is not None:
            start += datetime.timedelta(seconds=offset)
        """
        """
        # when did this start working?
        if os.path.splitext(rf.filename)[1] in [ '.ts' ]:
            seconds = 1800
        else:
            seconds = tsraw.get_duration(pathname)
        """
        if not os.path.exists(pathname):
            print('missing file: {}'.format(pathname))
            if self.options.delete_unknown:
                rf.delete()
            return
        seconds = tsraw.get_duration(pathname)

        print((pathname, start, seconds))
        rf.start = start

        hms = seconds // 3600, (seconds % 3600) // 60, seconds % 60
        duration = "%02d:%02d:%02d" % hms

        rf.duration = duration

        rf.save()