コード例 #1
0
ファイル: serie.py プロジェクト: gabri1135/4k
    def initialize(detail: tuple, _outputFolder: PathModel,
                   m3u8Path: PathModel) -> None:
        temp = _outputFolder.temp(space='').add('.%d_%d' %
                                                (detail[0] + 1, detail[1] + 1))
        if temp.exist():
            m3u8Path.remove()
            return

        temp.create()
        m3u8Path.move(temp.add(".m3u8"))

        temp.add("temp.txt").write("ffconcat version 1.0\n\n", "w")
コード例 #2
0
ファイル: film.py プロジェクト: gabri1135/4k
    def initialize(
        _outputFile: PathModel, m3u8Path: PathModel
    ) -> Tuple[Literal['created', 'continuare', 'sostituire',
                       'outPath different'], str | None, str | None]:
        _temp = _outputFile.temp()

        data = Data.create(_outputFile)
        if data == 'created':
            _temp.create()
            m3u8Path.move(_temp.add(".m3u8"))
            _temp.add("temp.txt").write("ffconcat version 1.0\n\n", "w")
            return data, None, None
        elif data == 'exist':
            if m3u8Path.read() == _temp.add(".m3u8").read():
                if m3u8Path.path != _temp.add(".m3u8").path:
                    m3u8Path.remove()
                return "continuare", None, None
            else:
                return "sostituire", None, None
        else:
            return data, _outputFile.path, m3u8Path.path