main
parent e49ed648e8
commit 1f631cca98

@ -0,0 +1,7 @@
# This file is machine-generated - editing it directly is not advised
julia_version = "1.10.0"
manifest_format = "2.0"
project_hash = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
[deps]

@ -1,3 +1,63 @@
io = open("meta.sql") # То же самое, но на julia
list = readlines(io)
println(list) using Logging
debuglogger = ConsoleLogger(stderr, Logging.Debug)
global_logger(debuglogger)
function new_name(name)
matches = Dict(
"Сек" => r"(.+) Сек.*",
"Сцен" => r"(.+) Сцен.*",
"Голые" => r"(.+) Голые.*",
"Откро" => r"(.+) Откро.*",
"Посте" => r"(.+) Посте.*",
"Изнас" => r"(.+) Изнас.*",
"Инцес" => r"(.+) Инцес.*",
"Лесб" => r"(.+) Лесб.*",
"Эро" => r"(.+) Эро.*"
)
for (k, v) in matches
if contains(name, k)
base, ext = splitext(name)
new_name = replace(base, v => s"\1")
# @debug base, new_name
return string(new_name, ext)
end
end
return name
end
function valid_file(filename)
valids = [".mp4", ".webm", ".mpeg"]
_, ext = splitext(filename)
return ext in valids
end
# file_info function returns information from file
function file_info(filename)
_, ext = splitext(filename)
info = stat(filename)
m = Dict(
"filename" => filename,
"size" => info.size,
"mtime" => info.mtime,
"ctime" => info.ctime,
"ext" => ext,
)
return m
end
function check_file(filename)
println(filename)
meta = file_info(filename)
println(meta)
end
# -------- основная программа --------------
dir = "d:\\vids\\ero"
@info "Обработка каталога: $dir"
files = readdir(dir, join=true)
for file in filter(valid_file, files)
meta = check_file(file)
end

Loading…
Cancel
Save