diff options
author | Joris | 2023-09-17 12:23:47 +0200 |
---|---|---|
committer | Joris | 2023-09-17 12:23:47 +0200 |
commit | 1ebc55c72a1a17293bbf4ad86e0177a10a794750 (patch) | |
tree | 5fce0ea3a011ccbae85b0d3927f8ac33099585fb /src/library/command.py | |
parent | c236facb4d4c277773c83f1a4ee85b48833d7e67 (diff) |
Make app packageable
Diffstat (limited to 'src/library/command.py')
-rw-r--r-- | src/library/command.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/library/command.py b/src/library/command.py deleted file mode 100644 index 6b8577e..0000000 --- a/src/library/command.py +++ /dev/null @@ -1,21 +0,0 @@ -import glob -import json -import os -import tomllib - -def run(book_library): - print(get(book_library)) - -def get(book_library): - metadatas = [] - - for path in glob.glob(f'{book_library}/**/metadata.toml', recursive=True): - with open(path, 'rb') as f: - directory = os.path.dirname(os.path.realpath(path)) - metadata = tomllib.load(f) - for p in glob.glob(f'{directory}/cover.*'): - metadata['cover'] = p - break - metadatas.append(metadata) - - return json.dumps(metadatas) |