This commit is contained in:
randogoth 2023-06-07 00:15:45 +03:00
parent 42c9cbf002
commit 534152eb9f
5 changed files with 88 additions and 20 deletions

26
metareaders.py Normal file
View file

@ -0,0 +1,26 @@
import taglib
with taglib.File("/home/flux/Documents/230605-191750.wav", save_on_exit=True) as song:
import frontmatter
with open('README.md', 'r') as data:
y = frontmatter.load(data)
print(y.metadata)
@orvani.metareader
def yaml_read(conf, db):
for (root,dirs,files) in os.walk(path):
if files:
for file in files:
rpath = os.path.join(root, dir)
f, ext = os.path.splitext(file)
if ext[1:] in conf['index'] and ext[1:] in ['md', 'txt']:
with open(file, 'r') as data:
y = frontmatter.load(data)
print(y)
if y.metadata:
for meta in y.metadata:
db[file][meta] = y.metadata[meta]
return db