DLSystem check for youtube-dl

This commit is contained in:
2022-07-02 00:36:36 +00:00
parent 4b52ccdd9f
commit ec92fe80ce
11 changed files with 50 additions and 12 deletions

View File

@@ -70,23 +70,28 @@
(= ,value (readComponent e ,componentType))))
,process))
(function :Array<String> tagList [archive :nat.Entry e]
(function :Array<String> tagList [:nat.Entry e]
(if (hasComponent e Tags)
(let [t (readComponent e Tags)]
(collect (t.keys)))
[]))
(function tagsMatch [archive e tagsBoolExp]
(BoolExpInterp.eval tagsBoolExp (tagList archive e)))
(function tagsMatch [e tagsBoolExp]
(BoolExpInterp.eval tagsBoolExp (tagList e)))
(function componentsMatch [:nat.Entry e componentsBoolExp]
(BoolExpInterp.eval componentsBoolExp (for =>cType cId e.components cType)))
(function componentsAndTagsMatch [:nat.Entry e componentsAndTagsBoolExp]
(BoolExpInterp.eval componentsAndTagsBoolExp (cast (concat (tagList e) (for =>cType cId e.components cType)))))
(defAlias &call catsMatch componentsAndTagsMatch)
(function addFiles [:nat.Archive archive :nat.Entry e :Array<String> files &opt leaveOriginalCopy]
(withWritableEntry archive e
(doFor file files
(let [pathWithoutDir (haxe.io.Path.withoutDirectory file)]
(unless !(= -1 (e.files.indexOf pathWithoutDir))
(unless (contains e.files pathWithoutDir)
(let [pathInArchive (joinPath archive.archiveDir "files" pathWithoutDir)]
(unless (sys.FileSystem.exists pathInArchive)
((if leaveOriginalCopy sys.io.File.copy sys.FileSystem.rename)